Changeset 4178 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-06-28T08:17:37+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Bounds.java
r4087 r4178 215 215 } 216 216 217 public boolean isOutOfTheWorld() { 218 return 219 minLat < -90 || minLat > 90 || 220 maxLat < -90 || maxLat > 90 || 221 minLon < -180 || minLon > 180 || 222 maxLon < -180 || maxLon > 180; 223 } 224 225 private double toInterval(double value, double min, double max) { 226 if (value < min) 227 return min; 228 if (value > max) 229 return max; 230 return value; 231 } 232 233 public void normalize() { 234 minLat = toInterval(minLat, -90, 90); 235 maxLat = toInterval(maxLat, -90, 90); 236 minLon = toInterval(minLon, -180, 180); 237 maxLon = toInterval(maxLon, -180, 180); 238 } 239 217 240 @Override 218 241 public int hashCode() { -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r3719 r4178 731 731 // search spot can not cover the current 732 732 // search 733 while ( !search_cache.bbox().bounds(search_bbox)) {733 while (search_cache != null && !search_cache.bbox().bounds(search_bbox)) { 734 734 if (debug) { 735 735 out("bbox: " + search_bbox); … … 743 743 out("new search_cache: " + search_cache); 744 744 } 745 } 746 747 if (search_cache == null) { 748 search_cache = root; 749 out("bbox: " + search_bbox + " is out of the world"); 745 750 } 746 751 } else { -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r3791 r4178 151 151 } 152 152 Bounds bounds = new Bounds( 153 new LatLon(Double.parseDouble(minlat), Double.parseDouble(minlon)), 154 new LatLon(Double.parseDouble(maxlat), Double.parseDouble(maxlon))); 153 Double.parseDouble(minlat), Double.parseDouble(minlon), 154 Double.parseDouble(maxlat), Double.parseDouble(maxlon)); 155 if (bounds.isOutOfTheWorld()) { 156 Bounds copy = new Bounds(bounds); 157 bounds.normalize(); 158 System.out.println("Bbox " + copy + " is out of the world, normalized to " + bounds); 159 } 155 160 DataSource src = new DataSource(bounds, origin); 156 161 ds.dataSources.add(src);
Note:
See TracChangeset
for help on using the changeset viewer.