|
28 | 28 | import java.io.FileInputStream;
|
29 | 29 | import java.io.IOException;
|
30 | 30 | import java.io.InputStream;
|
| 31 | +import java.util.Locale; |
| 32 | + |
| 33 | +import static com.graphhopper.util.Helper.*; |
31 | 34 |
|
32 | 35 | /**
|
33 | 36 | * Elevation data from Global Multi-resolution Terrain Elevation Data 2010 (GMTED2010).
|
@@ -198,7 +201,7 @@ public double getEle(double lat, double lon) {
|
198 | 201 | throw new RuntimeException("Can't decode " + file.getName(), e);
|
199 | 202 | } finally {
|
200 | 203 | if (ss != null)
|
201 |
| - Helper.close(ss); |
| 204 | + close(ss); |
202 | 205 | }
|
203 | 206 |
|
204 | 207 | fillDataAccessWithElevationData(raster, heights, WIDTH);
|
@@ -226,17 +229,17 @@ String getFileName(double lat, double lon) {
|
226 | 229 | int latInt = getMinLatForTile(lat);
|
227 | 230 | String north = getNorthString(latInt);
|
228 | 231 | String east = getEastString(lonInt);
|
229 |
| - String lonString = String.format("%03d", Math.abs(lonInt)); |
230 |
| - return (String.format("%02d", Math.abs(latInt)) + north + lonString + east + FILE_NAME_END).toLowerCase(); |
| 232 | + String lonString = String.format(Locale.ROOT, "%03d", Math.abs(lonInt)); |
| 233 | + return toLowerCase(String.format(Locale.ROOT, "%02d", Math.abs(latInt)) + north + lonString + east + FILE_NAME_END); |
231 | 234 | }
|
232 | 235 |
|
233 | 236 | String getDownloadURL(double lat, double lon) {
|
234 | 237 | int lonInt = getMinLonForTile(lon);
|
235 | 238 | int latInt = getMinLatForTile(lat);
|
236 | 239 | String north = getNorthString(latInt);
|
237 | 240 | String east = getEastString(lonInt);
|
238 |
| - String lonString = String.format("%03d", Math.abs(lonInt)); |
239 |
| - return east + lonString + "/" + String.format("%02d", Math.abs(latInt)) + north + lonString + east + FILE_NAME_END + ".tif"; |
| 241 | + String lonString = String.format(Locale.ROOT, "%03d", Math.abs(lonInt)); |
| 242 | + return east + lonString + "/" + String.format(Locale.ROOT, "%02d", Math.abs(latInt)) + north + lonString + east + FILE_NAME_END + ".tif"; |
240 | 243 | }
|
241 | 244 |
|
242 | 245 | private String getNorthString(int lat) {
|
|
0 commit comments