Ticket #13538: 13538-deprecate.patch
File 13538-deprecate.patch, 2.2 KB (added by , 6 years ago) |
---|
-
src/org/openstreetmap/josm/data/coor/LatLon.java
17 17 import java.util.Objects; 18 18 19 19 import org.openstreetmap.josm.data.Bounds; 20 import org.openstreetmap.josm.data.osm.Node; 20 21 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 21 22 import org.openstreetmap.josm.tools.Logging; 22 23 import org.openstreetmap.josm.tools.Utils; … … 192 193 /** 193 194 * Determines if this lat/lon is outside of the world 194 195 * @return <code>true</code>, if the coordinate is outside the world, compared by using lat/lon. 196 * @deprecated use {@link Node#isOutSideWorld} instead, see also #13538. 195 197 */ 198 @Deprecated 196 199 public boolean isOutSideWorld() { 197 200 Bounds b = ProjectionRegistry.getProjection().getWorldBoundsLatLon(); 198 201 return lat() < b.getMinLat() || lat() > b.getMaxLat() || -
src/org/openstreetmap/josm/data/osm/Node.java
10 10 import java.util.function.Predicate; 11 11 import java.util.stream.Collectors; 12 12 13 import org.openstreetmap.josm.data.Bounds; 13 14 import org.openstreetmap.josm.data.coor.EastNorth; 14 15 import org.openstreetmap.josm.data.coor.LatLon; 15 16 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor; … … 411 412 public boolean isOutSideWorld() { 412 413 LatLon ll = getCoor(); 413 414 if (ll != null) { 414 if (ll.isOutSideWorld()) 415 Bounds b = ProjectionRegistry.getProjection().getWorldBoundsLatLon(); 416 if (lat() < b.getMinLat() || lat() > b.getMaxLat() || lon() < b.getMinLon() || lon() > b.getMaxLon()) { 415 417 return true; 418 } 416 419 if (!ProjectionRegistry.getProjection().latlon2eastNorth(ll).equalsEpsilon(getEastNorth(), 1.0)) { 417 420 // we get here if a node was moved or created left from -180 or right from +180 418 421 return true;