Changeset 12163 in josm for trunk/src/org/openstreetmap/josm/data/osm/visitor
- Timestamp:
- 2017-05-15T15:57:36+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r10806 r12163 7 7 import org.openstreetmap.josm.data.Bounds; 8 8 import org.openstreetmap.josm.data.ProjectionBounds; 9 import org.openstreetmap.josm.data.coor.CachedLatLon;10 9 import org.openstreetmap.josm.data.coor.EastNorth; 10 import org.openstreetmap.josm.data.coor.ILatLon; 11 11 import org.openstreetmap.josm.data.coor.LatLon; 12 12 import org.openstreetmap.josm.data.osm.Node; … … 27 27 @Override 28 28 public void visit(Node n) { 29 visit( n.getEastNorth());29 visit((ILatLon) n); 30 30 } 31 31 … … 75 75 public void visit(LatLon latlon) { 76 76 if (latlon != null) { 77 if (latlon instanceof CachedLatLon) {78 visit(((CachedLatLon) latlon).getEastNorth());79 } else {80 visit(Main.getProjection().latlon2eastNorth(latlon)); 81 }82 }77 visit((ILatLon) latlon); 78 } 79 } 80 81 private void visit(ILatLon latlon) { 82 visit(latlon.getEastNorth()); 83 83 } 84 84 … … 134 134 LatLon minLatlon = Main.getProjection().eastNorth2latlon(bounds.getMin()); 135 135 LatLon maxLatlon = Main.getProjection().eastNorth2latlon(bounds.getMax()); 136 bounds = new ProjectionBounds( 137 Main.getProjection().latlon2eastNorth(new LatLon( 136 bounds = new ProjectionBounds(new LatLon( 138 137 Math.max(-90, minLatlon.lat() - enlargeDegree), 139 Math.max(-180, minLatlon.lon() - enlargeDegree)) ),140 Main.getProjection().latlon2eastNorth(new LatLon(138 Math.max(-180, minLatlon.lon() - enlargeDegree)).getEastNorth(), 139 new LatLon( 141 140 Math.min(90, maxLatlon.lat() + enlargeDegree), 142 Math.min(180, maxLatlon.lon() + enlargeDegree)) ));141 Math.min(180, maxLatlon.lon() + enlargeDegree)).getEastNorth()); 143 142 } 144 143
Note:
See TracChangeset
for help on using the changeset viewer.