Ticket #13538: 13538-deprecate.patch

File 13538-deprecate.patch, 2.2 KB (added by GerdP, 6 years ago)
  • src/org/openstreetmap/josm/data/coor/LatLon.java

     
    1717import java.util.Objects;
    1818
    1919import org.openstreetmap.josm.data.Bounds;
     20import org.openstreetmap.josm.data.osm.Node;
    2021import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    2122import org.openstreetmap.josm.tools.Logging;
    2223import org.openstreetmap.josm.tools.Utils;
     
    192193    /**
    193194     * Determines if this lat/lon is outside of the world
    194195     * @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.
    195197     */
     198    @Deprecated
    196199    public boolean isOutSideWorld() {
    197200        Bounds b = ProjectionRegistry.getProjection().getWorldBoundsLatLon();
    198201        return lat() < b.getMinLat() || lat() > b.getMaxLat() ||
  • src/org/openstreetmap/josm/data/osm/Node.java

     
    1010import java.util.function.Predicate;
    1111import java.util.stream.Collectors;
    1212
     13import org.openstreetmap.josm.data.Bounds;
    1314import org.openstreetmap.josm.data.coor.EastNorth;
    1415import org.openstreetmap.josm.data.coor.LatLon;
    1516import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
     
    411412    public boolean isOutSideWorld() {
    412413        LatLon ll = getCoor();
    413414        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()) {
    415417                return true;
     418            }
    416419            if (!ProjectionRegistry.getProjection().latlon2eastNorth(ll).equalsEpsilon(getEastNorth(), 1.0)) {
    417420                // we get here if a node was moved or created left from -180 or right from +180
    418421                return true;