Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
r8509 r8510 135 135 136 136 for (Object propKey: layersIndex.keySet()) { 137 String s = (String)propKey; 137 String s = (String) propKey; 138 138 if (url.equals(layersIndex.getProperty(s))) { 139 139 cacheDirName = s; … … 186 186 WmsCacheType cacheEntries; 187 187 try (InputStream is = new FileInputStream(indexFile)) { 188 cacheEntries = (WmsCacheType)unmarshaller.unmarshal(is); 188 cacheEntries = (WmsCacheType) unmarshaller.unmarshal(is); 189 189 } 190 190 totalFileSize = cacheEntries.getTotalFileSize(); … … 440 440 drawAtLeastOnce = true; 441 441 442 int xDiff = (int)((ce.east - east) * pixelPerDegree); 443 int yDiff = (int)((ce.north - north) * pixelPerDegree); 444 int size = (int)(pixelPerDegree / ce.pixelPerDegree * tileSize); 442 int xDiff = (int) ((ce.east - east) * pixelPerDegree); 443 int yDiff = (int) ((ce.north - north) * pixelPerDegree); 444 int size = (int) (pixelPerDegree / ce.pixelPerDegree * tileSize); 445 445 446 446 int x = xDiff; … … 467 467 double deltaLat = Math.abs(ll3.lat() - ll1.lat()); 468 468 double deltaLon = Math.abs(ll3.lon() - ll1.lon()); 469 int precisionLat = Math.max(0, -(int)Math.ceil(Math.log10(deltaLat)) + 1); 470 int precisionLon = Math.max(0, -(int)Math.ceil(Math.log10(deltaLon)) + 1); 469 int precisionLat = Math.max(0, -(int) Math.ceil(Math.log10(deltaLat)) + 1); 470 int precisionLon = Math.max(0, -(int) Math.ceil(Math.log10(deltaLon)) + 1); 471 471 472 472 String zoom = SystemOfMeasurement.METRIC.getDistText(ll1.greatCircleDistance(ll2)); … … 493 493 while (true) { 494 494 String result = String.format("%s_%." + precisionLat + "f_%." + precisionLon +"f%s.%s", 495 zoom, ll1.lat(), ll1.lon(), counter ==0?"":"_" + counter, extension);495 zoom, ll1.lat(), ll1.lon(), counter == 0 ? "" : "_" + counter, extension); 496 496 for (CacheEntry entry: projectionEntries.entries) { 497 497 if (entry.filename.equals(result)) { … … 528 528 } 529 529 entry = new CacheEntry(pixelPerDegree, east, north, 530 tileSize,generateFileName(projectionEntries, pixelPerDegree, projection, east, north, mimeType)); 530 tileSize, generateFileName(projectionEntries, pixelPerDegree, projection, east, north, mimeType)); 531 531 entry.lastUsed = System.currentTimeMillis(); 532 532 entry.lastModified = entry.lastUsed;
Note:
See TracChangeset
for help on using the changeset viewer.
