Ticket #13415: patch-latlon-generic.patch

File patch-latlon-generic.patch, 45.4 KB (added by michael2402, 8 years ago)
  • src/org/openstreetmap/josm/actions/AddNodeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AddNodeAction.java b/src/org/openstreetmap/josm/actions/AddNodeAction.java
    index 5cc050f..8130bf2 100644
    a b public final class AddNodeAction extends JosmAction {  
    6666        Main.main.undoRedo.add(new AddCommand(nnew));
    6767        getLayerManager().getEditDataSet().setSelected(nnew);
    6868        if (Main.map.mapView != null) {
    69             if (Main.map.mapView.getRealBounds().contains(nnew.getCoor())) {
     69            if (Main.map.mapView.getRealBounds().contains(nnew)) {
    7070                Main.map.mapView.repaint();
    7171            } else {
    7272                AutoScaleAction.zoomTo(Collections.<OsmPrimitive>singleton(nnew));
  • src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java b/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java
    index f13f2db..e07dfa1 100644
    a b public class CopyCoordinatesAction extends JosmAction {  
    3030    public void actionPerformed(ActionEvent ae) {
    3131        StringBuilder s = new StringBuilder();
    3232        for (Node n : getSelectedNodes()) {
    33             s.append(n.getCoor().lat());
     33            s.append(n.lat());
    3434            s.append(", ");
    35             s.append(n.getCoor().lon());
     35            s.append(n.lon());
    3636            s.append('\n');
    3737        }
    3838        ClipboardUtils.copyString(s.toString().trim());
  • src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SimplifyWayAction.java b/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
    index 8a979c3..c828c68 100644
    a b public class SimplifyWayAction extends JosmAction {  
    227227        for (int i = from + 1; i < to; i++) {
    228228            Node n = wnew.get(i);
    229229            double xte = Math.abs(Ellipsoid.WGS84.a
    230                     * xtd(fromN.getCoor().lat() * Math.PI / 180, fromN.getCoor().lon() * Math.PI / 180, toN.getCoor().lat() * Math.PI
    231                             / 180, toN.getCoor().lon() * Math.PI / 180, n.getCoor().lat() * Math.PI / 180, n.getCoor().lon() * Math.PI
    232                             / 180));
     230                    * xtd(fromN.lat() * Math.PI / 180, fromN.lon() * Math.PI / 180, toN.lat() * Math.PI / 180,
     231                            toN.lon() * Math.PI / 180,     n.lat() * Math.PI / 180,   n.lon() * Math.PI / 180));
    233232            if (xte > xtemax) {
    234233                xtemax = xte;
    235234                imax = i;
  • src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java b/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
    index ca1ede9..7f3ba05 100644
    a b public class ExtrudeAction extends MapMode implements MapViewPaintable, KeyPress  
    10621062                    }
    10631063                } else if (mode == Mode.translate || mode == Mode.translate_node) {
    10641064                    g2.setColor(mainColor);
    1065                     if (p1.distance(p2) < 3) {
     1065                    MapViewPath line = new MapViewPath(mv.getState()).moveTo(p1).lineTo(p2);
     1066                    if (line.getBounds2D().getWidth() < 3 && line.getBounds2D().getHeight() < 3) {
    10661067                        g2.setStroke(mainStroke);
    1067                         g2.draw(new MapViewPath(mv.getState()).shapeAround(p1, SymbolShape.CIRCLE, symbolSize));
     1068                        g2.draw(new MapViewPath(mv.getState()).shapeAround(p1.interpolate(p2, .5), SymbolShape.CIRCLE, symbolSize));
    10681069                    } else {
    10691070                        g2.setStroke(oldLineStroke);
    1070                         g2.draw(new MapViewPath(mv.getState()).moveTo(p1).lineTo(p2));
     1071                        g2.draw(line);
    10711072                    }
    10721073
    10731074                    if (dualAlignActive) {
  • src/org/openstreetmap/josm/data/Bounds.java

    diff --git a/src/org/openstreetmap/josm/data/Bounds.java b/src/org/openstreetmap/josm/data/Bounds.java
    index 5cdbd0e..9c8c620 100644
    a b import java.text.MessageFormat;  
    99import java.util.Objects;
    1010import java.util.function.Consumer;
    1111
     12import org.openstreetmap.josm.data.coor.ILatLon;
    1213import org.openstreetmap.josm.data.coor.LatLon;
    1314import org.openstreetmap.josm.data.osm.BBox;
    1415import org.openstreetmap.josm.data.projection.Projection;
    public class Bounds {  
    345346
    346347    /**
    347348     * Determines if the given point {@code ll} is within these bounds.
     349     * <p>
     350     * Points with unknown coordinates are always outside the coordinates.
    348351     * @param ll The lat/lon to check
    349352     * @return {@code true} if {@code ll} is within these bounds, {@code false} otherwise
    350353     */
    351354    public boolean contains(LatLon ll) {
     355        // binary compatibility
     356        return contains((ILatLon) ll);
     357    }
     358
     359    /**
     360     * Determines if the given point {@code ll} is within these bounds.
     361     * <p>
     362     * Points with unknown coordinates are always outside the coordinates.
     363     * @param ll The lat/lon to check
     364     * @return {@code true} if {@code ll} is within these bounds, {@code false} otherwise
     365     */
     366    public boolean contains(ILatLon ll) {
     367        if (!ll.isLatLonKnown()) {
     368            return false;
     369        }
    352370        if (ll.lat() < minLat || ll.lat() > maxLat)
    353371            return false;
    354372        if (crosses180thMeridian()) {
  • src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    diff --git a/src/org/openstreetmap/josm/data/coor/CachedLatLon.java b/src/org/openstreetmap/josm/data/coor/CachedLatLon.java
    index 12ee12b..36cc364 100644
    a b package org.openstreetmap.josm.data.coor;  
    44import java.util.Objects;
    55
    66import org.openstreetmap.josm.Main;
    7 import org.openstreetmap.josm.data.projection.Projection;
     7import org.openstreetmap.josm.data.projection.Projecting;
    88
    99/**
    1010 * LatLon class that maintains a cache of projected EastNorth coordinates.
    public class CachedLatLon extends LatLon {  
    1919    private static final long serialVersionUID = 1L;
    2020
    2121    private EastNorth eastNorth;
    22     private transient Projection proj;
     22    private transient Object proj;
    2323
    2424    /**
    2525     * Constructs a new {@code CachedLatLon}.
    public class CachedLatLon extends LatLon {  
    4545     */
    4646    public CachedLatLon(EastNorth eastNorth) {
    4747        super(Main.getProjection().eastNorth2latlon(eastNorth));
    48         proj = Main.getProjection();
     48        proj = Main.getProjection().getCacheKey();
    4949        this.eastNorth = eastNorth;
    5050    }
    5151
    public class CachedLatLon extends LatLon {  
    5454     *
    5555     * @return the internally cached east/north coordinates. null, if the globally defined projection is null
    5656     */
    57     public final EastNorth getEastNorth() {
    58         if (!Objects.equals(proj, Main.getProjection())) {
    59             proj = Main.getProjection();
    60             eastNorth = proj.latlon2eastNorth(this);
     57    @Override
     58    public final EastNorth getEastNorth(Projecting projecting) {
     59        if (!Objects.equals(proj, projecting.getCacheKey())) {
     60            proj = projecting.getCacheKey();
     61            eastNorth = projecting.latlon2eastNorth(this);
    6162        }
    6263        return eastNorth;
    6364    }
  • new file src/org/openstreetmap/josm/data/coor/ILatLon.java

    diff --git a/src/org/openstreetmap/josm/data/coor/ILatLon.java b/src/org/openstreetmap/josm/data/coor/ILatLon.java
    new file mode 100644
    index 0000000..8447e68
    - +  
     1// License: GPL. For details, see LICENSE file.
     2package org.openstreetmap.josm.data.coor;
     3
     4import org.openstreetmap.josm.Main;
     5import org.openstreetmap.josm.data.projection.Projecting;
     6
     7/**
     8 * This interface represents a coordinate in LatLon space.
     9 * <p>
     10 * It provides methods to get the coordinates. The coordinates may be unknown.
     11 * In this case, both {@link #lat()} and {@link #lon()} need to return a NaN value and {@link #isLatLonKnown()} needs to return false.
     12 * <p>
     13 * Whether the coordinates are immutable or not is implementation specific.
     14 *
     15 * @author Michael Zangl
     16 * @since xxx
     17 */
     18public interface ILatLon {
     19
     20    /**
     21     * Returns the longitude, i.e., the east-west position in degrees.
     22     * @return the longitude or NaN if {@link #isLatLonKnown()} returns false
     23     */
     24    public double lon();
     25
     26    /**
     27     * Returns the latitude, i.e., the north-south position in degrees.
     28     * @return the latitude or NaN if {@link #isLatLonKnown()} returns false
     29     */
     30    public double lat();
     31
     32    /**
     33     * Determines if this object has valid coordinates.
     34     * @return {@code true} if this object has valid coordinates
     35     */
     36    default boolean isLatLonKnown() {
     37        return !Double.isNaN(lat()) && !Double.isNaN(lon());
     38    }
     39
     40    /**
     41     * <p>Replies the projected east/north coordinates.</p>
     42     *
     43     * <p>Uses the {@link Main#getProjection() global projection} to project the lan/lon-coordinates.</p>
     44     *
     45     * @return the east north coordinates or {@code null} if #is
     46     */
     47    default EastNorth getEastNorth() {
     48        return getEastNorth(Main.getProjection());
     49    }
     50
     51    /**
     52     * Replies the projected east/north coordinates.
     53     * <p>
     54     * The result of the last conversion is cached. The cache object is used as cache key.
     55     * @param projecting The projection to use.
     56     * @return The projected east/north coordinates
     57     * @since 10827
     58     */
     59    default EastNorth getEastNorth(Projecting projecting) {
     60        return projecting.latlon2eastNorth(this);
     61    }
     62}
  • src/org/openstreetmap/josm/data/coor/LatLon.java

    diff --git a/src/org/openstreetmap/josm/data/coor/LatLon.java b/src/org/openstreetmap/josm/data/coor/LatLon.java
    index 2a7e628..f6257e9 100644
    a b import org.openstreetmap.josm.tools.Utils;  
    3838 *
    3939 * @author Imi
    4040 */
    41 public class LatLon extends Coordinate {
     41public class LatLon extends Coordinate implements ILatLon {
    4242
    4343    private static final long serialVersionUID = 1L;
    4444
    public class LatLon extends Coordinate {  
    213213        super(lon, lat);
    214214    }
    215215
    216     protected LatLon(LatLon coor) {
     216    /**
     217     * Creates a new LatLon object for the given coordinate
     218     * @param coor The coordinates to copy from.
     219     */
     220    public LatLon(ILatLon coor) {
    217221        super(coor.lon(), coor.lat());
    218222    }
    219223
    public class LatLon extends Coordinate {  
    225229        this(coor.getLat(), coor.getLon());
    226230    }
    227231
    228     /**
    229      * Returns the latitude, i.e., the north-south position in degrees.
    230      * @return the latitude
    231      */
     232    @Override
    232233    public double lat() {
    233234        return y;
    234235    }
    public class LatLon extends Coordinate {  
    251252        }
    252253    }
    253254
    254     /**
    255      * Returns the longitude, i.e., the east-west position in degrees.
    256      * @return the longitude
    257      */
     255    @Override
    258256    public double lon() {
    259257        return x;
    260258    }
  • src/org/openstreetmap/josm/data/osm/BBox.java

    diff --git a/src/org/openstreetmap/josm/data/osm/BBox.java b/src/org/openstreetmap/josm/data/osm/BBox.java
    index a5c5d78..e4bafc9 100644
    a b import java.awt.geom.Rectangle2D;  
    55import java.util.Arrays;
    66import java.util.Objects;
    77
     8import org.openstreetmap.josm.data.coor.ILatLon;
    89import org.openstreetmap.josm.data.coor.LatLon;
    910import org.openstreetmap.josm.data.coor.QuadTiling;
    1011import org.openstreetmap.josm.tools.Utils;
    public class BBox {  
    7576
    7677    public BBox(Way w) {
    7778        for (Node n : w.getNodes()) {
    78             LatLon coor = n.getCoor();
    79             if (coor == null) {
    80                 continue;
    81             }
    82             add(coor);
     79            add(n);
    8380        }
    8481    }
    8582
    86     public BBox(Node n) {
    87         LatLon coor = n.getCoor();
    88         if (coor == null) {
     83    public BBox(ILatLon n) {
     84        if (!n.isLatLonKnown()) {
    8985            xmin = xmax = ymin = ymax = 0;
    9086        } else {
    91             xmin = xmax = coor.lon();
    92             ymin = ymax = coor.lat();
     87            xmin = xmax = n.lon();
     88            ymin = ymax = n.lat();
    9389        }
    9490    }
    9591
     92    public BBox(Node n) {
     93        this((ILatLon) n);
     94    }
     95
    9696    private void sanity() {
    9797        if (xmin < -180.0) {
    9898            xmin = -180.0;
    public class BBox {  
    112112        add(c.lon(), c.lat());
    113113    }
    114114
     115    public final void add(ILatLon c) {
     116        if (c.isLatLonKnown()) {
     117            add(c.lon(), c.lat());
     118        }
     119    }
     120
    115121    /**
    116122     * Extends this bbox to include the point (x, y)
    117123     * @param x X coordinate
  • src/org/openstreetmap/josm/data/osm/INode.java

    diff --git a/src/org/openstreetmap/josm/data/osm/INode.java b/src/org/openstreetmap/josm/data/osm/INode.java
    index b9b43c5..02d7b8a 100644
    a b  
    22package org.openstreetmap.josm.data.osm;
    33
    44import org.openstreetmap.josm.data.coor.EastNorth;
     5import org.openstreetmap.josm.data.coor.ILatLon;
    56import org.openstreetmap.josm.data.coor.LatLon;
    67
    78/**
    89 * INode captures the common functions of {@link Node} and {@link NodeData}.
    910 * @since 4098
    1011 */
    11 public interface INode extends IPrimitive {
     12public interface INode extends IPrimitive, ILatLon {
    1213
    1314    /**
    1415     * Returns lat/lon coordinates of this node.
    public interface INode extends IPrimitive {  
    2324    void setCoor(LatLon coor);
    2425
    2526    /**
    26      * Returns east/north coordinates of this node.
    27      * @return east/north coordinates of this node
    28      */
    29     EastNorth getEastNorth();
    30 
    31     /**
    3227     * Sets east/north coordinates of this node.
    3328     * @param eastNorth east/north coordinates of this node
    3429     */
  • src/org/openstreetmap/josm/data/osm/Node.java

    diff --git a/src/org/openstreetmap/josm/data/osm/Node.java b/src/org/openstreetmap/josm/data/osm/Node.java
    index cb753f0..80e302e 100644
    a b import org.openstreetmap.josm.data.coor.EastNorth;  
    1212import org.openstreetmap.josm.data.coor.LatLon;
    1313import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
    1414import org.openstreetmap.josm.data.osm.visitor.Visitor;
    15 import org.openstreetmap.josm.data.projection.Projection;
     15import org.openstreetmap.josm.data.projection.Projecting;
    1616import org.openstreetmap.josm.data.projection.Projections;
    1717import org.openstreetmap.josm.tools.CheckParameterUtil;
    1818import org.openstreetmap.josm.tools.Utils;
    public final class Node extends OsmPrimitive implements INode {  
    4545     * @return {@code true} if this node has valid coordinates
    4646     * @since 7828
    4747     */
     48    @Override
    4849    public boolean isLatLonKnown() {
     50        // We cannot use default implementation - if we remove this implementation, we will break binary compatibility.
    4951        return !Double.isNaN(lat) && !Double.isNaN(lon);
    5052    }
    5153
    public final class Node extends OsmPrimitive implements INode {  
    7476
    7577    @Override
    7678    public LatLon getCoor() {
    77         if (!isLatLonKnown()) return null;
    78         return new LatLon(lat, lon);
     79        if (!isLatLonKnown()) {
     80            return null;
     81        } else {
     82            return new LatLon(lat, lon);
     83        }
    7984    }
    8085
    81     /**
    82      * <p>Replies the projected east/north coordinates.</p>
    83      *
    84      * <p>Uses the {@link Main#getProjection() global projection} to project the lan/lon-coordinates.
    85      * Internally caches the projected coordinates.</p>
    86      *
    87      * <p>Replies {@code null} if this node doesn't know lat/lon-coordinates, i.e. because it is an incomplete node.
    88      *
    89      * @return the east north coordinates or {@code null}
    90      * @see #invalidateEastNorthCache()
    91      *
    92      */
    9386    @Override
    94     public EastNorth getEastNorth() {
    95         return getEastNorth(Main.getProjection());
     87    public double lat() {
     88        return lat;
    9689    }
    9790
    98     /**
    99      * Replies the projected east/north coordinates.
    100      * <p>
    101      * The result of the last conversion is cached. The cache object is used as cache key.
    102      * @param projection The projection to use.
    103      * @return The projected east/north coordinates
    104      * @since 10827
    105      */
    106     public EastNorth getEastNorth(Projection projection) {
     91    @Override
     92    public double lon() {
     93        return lon;
     94    }
     95
     96    @Override
     97    public EastNorth getEastNorth(Projecting projection) {
    10798        if (!isLatLonKnown()) return null;
    10899
    109100        if (Double.isNaN(east) || Double.isNaN(north) || !Objects.equals(projection.getCacheKey(), eastNorthCacheKey)) {
  • src/org/openstreetmap/josm/data/osm/NodeData.java

    diff --git a/src/org/openstreetmap/josm/data/osm/NodeData.java b/src/org/openstreetmap/josm/data/osm/NodeData.java
    index 650ab19..d3a0578 100644
    a b public class NodeData extends PrimitiveData implements INode {  
    3131        setCoor(data.getCoor());
    3232    }
    3333
    34     private boolean isLatLonKnown() {
     34    @Override
     35    public double lat() {
     36        return lat;
     37    }
     38
     39    @Override
     40    public double lon() {
     41        return lon;
     42    }
     43
     44    @Override
     45    public boolean isLatLonKnown() {
    3546        return !Double.isNaN(lat) && !Double.isNaN(lon);
    3647    }
    3748
  • src/org/openstreetmap/josm/data/osm/NodePositionComparator.java

    diff --git a/src/org/openstreetmap/josm/data/osm/NodePositionComparator.java b/src/org/openstreetmap/josm/data/osm/NodePositionComparator.java
    index a6b0312..96aa69a 100644
    a b public class NodePositionComparator implements Comparator<Node>, Serializable {  
    1919        if (n1.getCoor().equalsEpsilon(n2.getCoor()))
    2020            return 0;
    2121
    22         int dLat = Double.compare(n1.getCoor().lat(), n2.getCoor().lat());
    23         return dLat != 0 ? dLat : Double.compare(n1.getCoor().lon(), n2.getCoor().lon());
     22        int dLat = Double.compare(n1.lat(), n2.lat());
     23        return dLat != 0 ? dLat : Double.compare(n1.lon(), n2.lon());
    2424    }
    2525}
  • src/org/openstreetmap/josm/data/projection/AbstractProjection.java

    diff --git a/src/org/openstreetmap/josm/data/projection/AbstractProjection.java b/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
    index 8129cbc..eeefb8a 100644
    a b import java.util.function.DoubleUnaryOperator;  
    99import org.openstreetmap.josm.data.Bounds;
    1010import org.openstreetmap.josm.data.ProjectionBounds;
    1111import org.openstreetmap.josm.data.coor.EastNorth;
     12import org.openstreetmap.josm.data.coor.ILatLon;
    1213import org.openstreetmap.josm.data.coor.LatLon;
    1314import org.openstreetmap.josm.data.projection.datum.Datum;
    1415import org.openstreetmap.josm.data.projection.proj.Proj;
    public abstract class AbstractProjection implements Projection {  
    113114    }
    114115
    115116    @Override
    116     public EastNorth latlon2eastNorth(LatLon ll) {
     117    public EastNorth latlon2eastNorth(ILatLon ll) {
    117118        ll = datum.fromWGS84(ll);
    118119        double[] en = proj.project(Math.toRadians(ll.lat()), Math.toRadians(LatLon.normalizeLon(ll.lon() - lon0 - pm)));
    119120        return new EastNorth((ellps.a * k0 * en[0] + x0) / toMeter, (ellps.a * k0 * en[1] + y0) / toMeter);
    public abstract class AbstractProjection implements Projection {  
    121122
    122123    @Override
    123124    public LatLon eastNorth2latlon(EastNorth en) {
     125        // We know it is a latlon. Nice would be to change this method return type to ILatLon
    124126        return eastNorth2latlon(en, LatLon::normalizeLon);
    125127    }
    126128
    127129    @Override
    128130    public LatLon eastNorth2latlonClamped(EastNorth en) {
    129         LatLon ll = eastNorth2latlon(en, lon -> Utils.clamp(lon, -180, 180));
     131        ILatLon ll = eastNorth2latlon(en, lon -> Utils.clamp(lon, -180, 180));
    130132        Bounds bounds = getWorldBoundsLatLon();
    131133        return new LatLon(Utils.clamp(ll.lat(), bounds.getMinLat(), bounds.getMaxLat()),
    132134                Utils.clamp(ll.lon(), bounds.getMinLon(), bounds.getMaxLon()));
  • src/org/openstreetmap/josm/data/projection/Ellipsoid.java

    diff --git a/src/org/openstreetmap/josm/data/projection/Ellipsoid.java b/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
    index 4ea41db..a7e60c7 100644
    a b  
    66 */
    77package org.openstreetmap.josm.data.projection;
    88
     9import org.openstreetmap.josm.data.coor.ILatLon;
    910import org.openstreetmap.josm.data.coor.LatLon;
    1011
    1112/**
    public final class Ellipsoid {  
    347348     * @param coord The Latitude and longitude in degrees
    348349     * @return the corresponding (X, Y Z) cartesian coordinates in meters.
    349350     */
    350     public double[] latLon2Cart(LatLon coord) {
     351    public double[] latLon2Cart(ILatLon coord) {
    351352        double phi = Math.toRadians(coord.lat());
    352353        double lambda = Math.toRadians(coord.lon());
    353354
  • src/org/openstreetmap/josm/data/projection/Projecting.java

    diff --git a/src/org/openstreetmap/josm/data/projection/Projecting.java b/src/org/openstreetmap/josm/data/projection/Projecting.java
    index 80d0101..6cdca12 100644
    a b import java.util.Map;  
    55
    66import org.openstreetmap.josm.data.ProjectionBounds;
    77import org.openstreetmap.josm.data.coor.EastNorth;
     8import org.openstreetmap.josm.data.coor.ILatLon;
    89import org.openstreetmap.josm.data.coor.LatLon;
    910
    1011/**
    public interface Projecting {  
    1819
    1920    /**
    2021     * Convert from lat/lon to easting/northing.
     22     * <p>
     23     * This method exists to not break binary compatibility with old plugins
    2124     *
    2225     * @param ll the geographical point to convert (in WGS84 lat/lon)
    2326     * @return the corresponding east/north coordinates
    2427     */
    25     EastNorth latlon2eastNorth(LatLon ll);
     28    default EastNorth latlon2eastNorth(LatLon ll) {
     29        return latlon2eastNorth((ILatLon) ll);
     30    }
     31
     32    /**
     33     * Convert from lat/lon to easting/northing. This method uses the newer {@link ILatLon} interface.
     34     *
     35     * @param ll the geographical point to convert (in WGS84 lat/lon)
     36     * @return the corresponding east/north coordinates
     37     */
     38    EastNorth latlon2eastNorth(ILatLon ll);
    2639
    2740    /**
    2841     * Convert a east/north coordinate to the {@link LatLon} coordinate.
    public interface Projecting {  
    4760     * @return a map of non-overlapping {@link ProjectionBounds} instances mapped to the {@link Projecting} object to use for that area.
    4861     */
    4962    Map<ProjectionBounds, Projecting> getProjectingsForArea(ProjectionBounds area);
     63
     64    /**
     65     * Gets the object used as cache identifier when caching results of this projection.
     66     * @return The object to use as cache key
     67     * @since 10827
     68     */
     69    default Object getCacheKey() {
     70        return this;
     71    }
    5072}
  • src/org/openstreetmap/josm/data/projection/Projection.java

    diff --git a/src/org/openstreetmap/josm/data/projection/Projection.java b/src/org/openstreetmap/josm/data/projection/Projection.java
    index e2739d1..62c7050 100644
    a b public interface Projection extends Projecting {  
    102102     * @return true if natural order of coordinates is North East, false if East North
    103103     */
    104104    boolean switchXY();
    105 
    106     /**
    107      * Gets the object used as cache identifier when caching results of this projection.
    108      * @return The object to use as cache key
    109      * @since 10827
    110      */
    111     default Object getCacheKey() {
    112         return this;
    113     }
    114105}
  • src/org/openstreetmap/josm/data/projection/ShiftedProjecting.java

    diff --git a/src/org/openstreetmap/josm/data/projection/ShiftedProjecting.java b/src/org/openstreetmap/josm/data/projection/ShiftedProjecting.java
    index 3b30174..6638263 100644
    a b import java.util.Map;  
    66
    77import org.openstreetmap.josm.data.ProjectionBounds;
    88import org.openstreetmap.josm.data.coor.EastNorth;
     9import org.openstreetmap.josm.data.coor.ILatLon;
    910import org.openstreetmap.josm.data.coor.LatLon;
    1011
    1112/**
    public class ShiftedProjecting implements Projecting {  
    2829    }
    2930
    3031    @Override
    31     public EastNorth latlon2eastNorth(LatLon ll) {
     32    public EastNorth latlon2eastNorth(ILatLon ll) {
    3233        return base.latlon2eastNorth(ll).add(offset);
    3334    }
    3435
  • src/org/openstreetmap/josm/data/projection/datum/CentricDatum.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/CentricDatum.java b/src/org/openstreetmap/josm/data/projection/datum/CentricDatum.java
    index 0def3ea..fd938a1 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.datum;
    33
     4import org.openstreetmap.josm.data.coor.ILatLon;
    45import org.openstreetmap.josm.data.coor.LatLon;
    56import org.openstreetmap.josm.data.projection.Ellipsoid;
    67
    public class CentricDatum extends AbstractDatum {  
    1516    }
    1617
    1718    @Override
    18     public LatLon toWGS84(LatLon ll) {
     19    public LatLon toWGS84(ILatLon ll) {
    1920        return Ellipsoid.WGS84.cart2LatLon(ellps.latLon2Cart(ll));
    2021    }
    2122
    2223    @Override
    23     public LatLon fromWGS84(LatLon ll) {
     24    public ILatLon fromWGS84(ILatLon ll) {
    2425        return this.ellps.cart2LatLon(Ellipsoid.WGS84.latLon2Cart(ll));
    2526    }
    2627
  • src/org/openstreetmap/josm/data/projection/datum/Datum.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/Datum.java b/src/org/openstreetmap/josm/data/projection/datum/Datum.java
    index 16cf527..04a30d7 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.datum;
    33
     4import org.openstreetmap.josm.data.coor.ILatLon;
    45import org.openstreetmap.josm.data.coor.LatLon;
    56import org.openstreetmap.josm.data.projection.Ellipsoid;
    67
    public interface Datum {  
    3334     * @param ll original lat/lon in this datum
    3435     * @return lat/lon converted to WGS84
    3536     */
    36     LatLon toWGS84(LatLon ll);
     37    LatLon toWGS84(ILatLon ll);
    3738
    3839    /**
    3940     * Convert lat/lon from {@link Ellipsoid#WGS84} to this datum.
    4041     * @param ll original lat/lon in WGS84
    4142     * @return converted lat/lon in this datum
    4243     */
    43     LatLon fromWGS84(LatLon ll);
     44    ILatLon fromWGS84(ILatLon ll);
    4445}
  • src/org/openstreetmap/josm/data/projection/datum/NTV2Datum.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/NTV2Datum.java b/src/org/openstreetmap/josm/data/projection/datum/NTV2Datum.java
    index dd427b8..fcf69c8 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.datum;
    33
     4import org.openstreetmap.josm.data.coor.ILatLon;
    45import org.openstreetmap.josm.data.coor.LatLon;
    56import org.openstreetmap.josm.data.projection.Ellipsoid;
    67
    public class NTV2Datum extends AbstractDatum {  
    1718    }
    1819
    1920    @Override
    20     public LatLon toWGS84(LatLon ll) {
     21    public LatLon toWGS84(ILatLon ll) {
    2122        NTV2GridShift gs = new NTV2GridShift(ll);
    2223        nadgrids.getShiftFile().gridShiftForward(gs);
    2324        return new LatLon(ll.lat() + gs.getLatShiftDegrees(), ll.lon() + gs.getLonShiftPositiveEastDegrees());
    2425    }
    2526
    2627    @Override
    27     public LatLon fromWGS84(LatLon ll) {
     28    public ILatLon fromWGS84(ILatLon ll) {
    2829        NTV2GridShift gs = new NTV2GridShift(ll);
    2930        nadgrids.getShiftFile().gridShiftReverse(gs);
    3031        return new LatLon(ll.lat() + gs.getLatShiftDegrees(), ll.lon() + gs.getLonShiftPositiveEastDegrees());
  • src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java b/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java
    index f38e97d..9ab56d0 100644
    a b package org.openstreetmap.josm.data.projection.datum;  
    2121
    2222import java.io.Serializable;
    2323
    24 import org.openstreetmap.josm.data.coor.LatLon;
     24import org.openstreetmap.josm.data.coor.ILatLon;
    2525import org.openstreetmap.josm.data.projection.Ellipsoid;
    2626
    2727/**
    public class NTV2GridShift implements Serializable {  
    6262     * Constructs a new {@code NTV2GridShift} from a {@code LatLon}.
    6363     * @param p lat/lon
    6464     */
    65     public NTV2GridShift(LatLon p) {
     65    public NTV2GridShift(ILatLon p) {
    6666        setLatDegrees(p.lat());
    6767        setLonPositiveEastDegrees(p.lon());
    6868    }
  • src/org/openstreetmap/josm/data/projection/datum/NullDatum.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/NullDatum.java b/src/org/openstreetmap/josm/data/projection/datum/NullDatum.java
    index b86a59c..24d0cdd 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.datum;
    33
     4import org.openstreetmap.josm.data.coor.ILatLon;
    45import org.openstreetmap.josm.data.coor.LatLon;
    56import org.openstreetmap.josm.data.projection.Ellipsoid;
    67
    public class NullDatum extends AbstractDatum {  
    1516    }
    1617
    1718    @Override
    18     public LatLon toWGS84(LatLon ll) {
    19         return ll;
     19    public LatLon toWGS84(ILatLon ll) {
     20        return new LatLon(ll);
    2021    }
    2122
    2223    @Override
    23     public LatLon fromWGS84(LatLon ll) {
     24    public ILatLon fromWGS84(ILatLon ll) {
    2425        return ll;
    2526    }
    2627
  • src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java b/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java
    index 65c28d7..114eefb 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.datum;
    33
     4import org.openstreetmap.josm.data.coor.ILatLon;
    45import org.openstreetmap.josm.data.coor.LatLon;
    56import org.openstreetmap.josm.data.projection.Ellipsoid;
    67
    public class SevenParameterDatum extends AbstractDatum {  
    4546    }
    4647
    4748    @Override
    48     public LatLon toWGS84(LatLon ll) {
     49    public LatLon toWGS84(ILatLon ll) {
    4950        double[] xyz = ellps.latLon2Cart(ll);
    5051        double x = dx + xyz[0]*(1+s) + xyz[2]*ry - xyz[1]*rz;
    5152        double y = dy + xyz[1]*(1+s) + xyz[0]*rz - xyz[2]*rx;
    public class SevenParameterDatum extends AbstractDatum {  
    5455    }
    5556
    5657    @Override
    57     public LatLon fromWGS84(LatLon ll) {
     58    public ILatLon fromWGS84(ILatLon ll) {
    5859        double[] xyz = Ellipsoid.WGS84.latLon2Cart(ll);
    5960        double x = (1-s)*(-dx + xyz[0] + ((-dz+xyz[2])*(-ry) - (-dy+xyz[1])*(-rz)));
    6061        double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])*(-rz) - (-dz+xyz[2])*(-rx)));
  • src/org/openstreetmap/josm/data/projection/datum/ThreeParameterDatum.java

    diff --git a/src/org/openstreetmap/josm/data/projection/datum/ThreeParameterDatum.java b/src/org/openstreetmap/josm/data/projection/datum/ThreeParameterDatum.java
    index 7311915..1fe6f73 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.datum;
    33
     4import org.openstreetmap.josm.data.coor.ILatLon;
    45import org.openstreetmap.josm.data.coor.LatLon;
    56import org.openstreetmap.josm.data.projection.Ellipsoid;
    67
    public class ThreeParameterDatum extends AbstractDatum {  
    1920    }
    2021
    2122    @Override
    22     public LatLon toWGS84(LatLon ll) {
     23    public LatLon toWGS84(ILatLon ll) {
    2324        double[] xyz = ellps.latLon2Cart(ll);
    2425        xyz[0] += dx;
    2526        xyz[1] += dy;
    public class ThreeParameterDatum extends AbstractDatum {  
    2829    }
    2930
    3031    @Override
    31     public LatLon fromWGS84(LatLon ll) {
     32    public ILatLon fromWGS84(ILatLon ll) {
    3233        double[] xyz = Ellipsoid.WGS84.latLon2Cart(ll);
    3334        xyz[0] -= dx;
    3435        xyz[1] -= dy;
  • src/org/openstreetmap/josm/data/validation/PaintVisitor.java

    diff --git a/src/org/openstreetmap/josm/data/validation/PaintVisitor.java b/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
    index 18181ae..185d6c2 100644
    a b  
    22package org.openstreetmap.josm.data.validation;
    33
    44import java.awt.Color;
    5 import java.awt.Graphics;
     5import java.awt.Graphics2D;
    66import java.awt.Point;
    77import java.util.HashSet;
    88import java.util.List;
    import org.openstreetmap.josm.data.osm.Way;  
    1717import org.openstreetmap.josm.data.osm.WaySegment;
    1818import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    1919import org.openstreetmap.josm.gui.MapView;
     20import org.openstreetmap.josm.gui.draw.MapViewPath;
     21import org.openstreetmap.josm.gui.mappaint.styleelement.Symbol.SymbolShape;
    2022
    2123/**
    2224 * Visitor that highlights the primitives affected by an error
    import org.openstreetmap.josm.gui.MapView;  
    2527 */
    2628public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {
    2729    /** The graphics */
    28     private final Graphics g;
     30    private final Graphics2D g;
    2931    /** The MapView */
    3032    private final MapView mv;
    3133
    public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {  
    4244     * @param g The graphics
    4345     * @param mv The Mapview
    4446     */
    45     public PaintVisitor(Graphics g, MapView mv) {
     47    public PaintVisitor(Graphics2D g, MapView mv) {
    4648        this.g = g;
    4749        this.mv = mv;
    4850    }
    public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {  
    119121        PaintedPoint pp = new PaintedPoint(n.getCoor(), color);
    120122
    121123        if (!paintedPoints.contains(pp)) {
    122             Point p = mv.getPoint(n);
     124            MapViewPath circle = new MapViewPath(mv.getState()).shapeAround(n, SymbolShape.CIRCLE, 10);
    123125
    124126            if (selected) {
    125127                g.setColor(getHighlightColor(color));
    126                 g.fillOval(p.x - 5, p.y - 5, 10, 10);
     128                g.fill(circle);
    127129            }
    128130            g.setColor(color);
    129             g.drawOval(p.x - 5, p.y - 5, 10, 10);
     131            g.draw(circle);
    130132            paintedPoints.add(pp);
    131133        }
    132134    }
  • src/org/openstreetmap/josm/gui/MapViewState.java

    diff --git a/src/org/openstreetmap/josm/gui/MapViewState.java b/src/org/openstreetmap/josm/gui/MapViewState.java
    index e3bbe51..cef7239 100644
    a b import org.openstreetmap.josm.Main;  
    1717import org.openstreetmap.josm.data.Bounds;
    1818import org.openstreetmap.josm.data.ProjectionBounds;
    1919import org.openstreetmap.josm.data.coor.EastNorth;
     20import org.openstreetmap.josm.data.coor.ILatLon;
    2021import org.openstreetmap.josm.data.coor.LatLon;
    21 import org.openstreetmap.josm.data.osm.Node;
    2222import org.openstreetmap.josm.data.projection.Projecting;
    2323import org.openstreetmap.josm.data.projection.Projection;
    2424import org.openstreetmap.josm.gui.download.DownloadDialog;
    public final class MapViewState implements Serializable {  
    174174    }
    175175
    176176    /**
    177      * Gets the {@link MapViewPoint} for the given {@link LatLon} coordinate.
    178      * @param latlon the position
    179      * @return The point for that position.
    180      * @since 10651
    181      */
    182     public MapViewPoint getPointFor(LatLon latlon) {
    183         return getPointFor(getProjection().latlon2eastNorth(latlon));
    184     }
    185 
    186     /**
    187      * Gets the {@link MapViewPoint} for the given node. This is faster than {@link #getPointFor(LatLon)} because it uses the node east/north
    188      * cache.
    189      * @param node The node
    190      * @return The position of that node.
    191      * @since 10827
     177     * Gets the {@link MapViewPoint} for the given lat lon coordinates.
     178     * @param latlon The lat lon position, e.g. a node
     179     * @return The position of that object.
     180     * @since xxx
    192181     */
    193     public MapViewPoint getPointFor(Node node) {
    194         return getPointFor(node.getEastNorth(getProjection()));
     182    public MapViewPoint getPointFor(ILatLon latlon) {
     183        return getPointFor(latlon.getEastNorth(getProjecting()));
    195184    }
    196185
    197186    /**
    public final class MapViewState implements Serializable {  
    248237    /**
    249238     * Gets the current projection used for the MapView.
    250239     * @return The projection.
     240     * @see #getProjecting()
    251241     */
    252242    public Projection getProjection() {
    253243        return projecting.getBaseProjection();
    254244    }
    255245
    256246    /**
     247     * Gets the current projecting instance that is used to convert between east/north and lat/lon space.
     248     * @return The projection.
     249     * @since xxx
     250     */
     251    public Projecting getProjecting() {
     252        return projecting;
     253    }
     254
     255    /**
    257256     * Creates an affine transform that is used to convert the east/north coordinates to view coordinates.
    258257     * @return The affine transform. It should not be changed.
    259258     * @since 10375
  • src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDataText.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDataText.java b/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDataText.java
    index 11cb3f9..99a0649 100644
    a b public class InspectPrimitiveDataText {  
    202202    }
    203203
    204204    void addCoordinates(Node n) {
    205         if (n.getCoor() != null) {
     205        if (n.isLatLonKnown()) {
    206206            add(tr("Coordinates: "),
    207                     Double.toString(n.getCoor().lat()), ", ",
    208                     Double.toString(n.getCoor().lon()));
     207                    Double.toString(n.lat()), ", ",
     208                    Double.toString(n.lon()));
    209209            add(tr("Coordinates (projected): "),
    210210                    Double.toString(n.getEastNorth().east()), ", ",
    211211                    Double.toString(n.getEastNorth().north()));
  • src/org/openstreetmap/josm/gui/draw/MapViewPath.java

    diff --git a/src/org/openstreetmap/josm/gui/draw/MapViewPath.java b/src/org/openstreetmap/josm/gui/draw/MapViewPath.java
    index 7b2fb49..55d29a9 100644
    a b  
    22package org.openstreetmap.josm.gui.draw;
    33
    44import org.openstreetmap.josm.data.coor.EastNorth;
    5 import org.openstreetmap.josm.data.osm.Node;
     5import org.openstreetmap.josm.data.coor.ILatLon;
    66import org.openstreetmap.josm.gui.MapViewState;
    77import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
    88import org.openstreetmap.josm.gui.mappaint.styleelement.Symbol.SymbolShape;
    public class MapViewPath extends MapPath2D {  
    2929     * @param n The node
    3030     * @return this for easy chaining.
    3131     */
    32     public MapViewPath moveTo(Node n) {
    33         moveTo(n.getEastNorth());
     32    public MapViewPath moveTo(ILatLon n) {
     33        moveTo(n.getEastNorth(state.getProjecting()));
    3434        return this;
    3535    }
    3636
    public class MapViewPath extends MapPath2D {  
    5555     * @param n The node
    5656     * @return this for easy chaining.
    5757     */
    58     public MapViewPath lineTo(Node n) {
    59         lineTo(n.getEastNorth());
     58    public MapViewPath lineTo(ILatLon n) {
     59        lineTo(n.getEastNorth(state.getProjecting()));
    6060        return this;
    6161    }
    6262
    public class MapViewPath extends MapPath2D {  
    8383     * @param size The size of the symbol in pixel
    8484     * @return this for easy chaining.
    8585     */
    86     public MapViewPath shapeAround(Node p1, SymbolShape symbol, double size) {
    87         shapeAround(p1.getEastNorth(), symbol, size);
     86    public MapViewPath shapeAround(ILatLon p1, SymbolShape symbol, double size) {
     87        shapeAround(p1.getEastNorth(state.getProjecting()), symbol, size);
    8888        return this;
    8989    }
    9090
    public class MapViewPath extends MapPath2D {  
    112112     * @param connect <code>true</code> if we should use a lineTo as first command.
    113113     * @return this for easy chaining.
    114114     */
    115     public MapViewPath append(Iterable<Node> nodes, boolean connect) {
     115    public MapViewPath append(Iterable<? extends ILatLon> nodes, boolean connect) {
    116116        appendWay(nodes, connect, false);
    117117        return this;
    118118    }
    public class MapViewPath extends MapPath2D {  
    123123     * @param connect <code>true</code> if we should use a lineTo as first command.
    124124     * @return this for easy chaining.
    125125     */
    126     public MapViewPath appendClosed(Iterable<Node> nodes, boolean connect) {
     126    public MapViewPath appendClosed(Iterable<? extends ILatLon> nodes, boolean connect) {
    127127        appendWay(nodes, connect, true);
    128128        return this;
    129129    }
    130130
    131     private void appendWay(Iterable<Node> nodes, boolean connect, boolean close) {
     131    private void appendWay(Iterable<? extends ILatLon> nodes, boolean connect, boolean close) {
    132132        boolean useMoveTo = !connect;
    133         Node first = null;
    134         for (Node n : nodes) {
     133        ILatLon first = null;
     134        for (ILatLon n : nodes) {
    135135            if (useMoveTo) {
    136136                moveTo(n);
    137137            } else {
  • src/org/openstreetmap/josm/tools/Geometry.java

    diff --git a/src/org/openstreetmap/josm/tools/Geometry.java b/src/org/openstreetmap/josm/tools/Geometry.java
    index 7cafef3..d399d89 100644
    a b import org.openstreetmap.josm.command.AddCommand;  
    2121import org.openstreetmap.josm.command.ChangeCommand;
    2222import org.openstreetmap.josm.command.Command;
    2323import org.openstreetmap.josm.data.coor.EastNorth;
    24 import org.openstreetmap.josm.data.coor.LatLon;
    2524import org.openstreetmap.josm.data.osm.BBox;
    2625import org.openstreetmap.josm.data.osm.MultipolygonBuilder;
    2726import org.openstreetmap.josm.data.osm.MultipolygonBuilder.JoinedPolygon;
    public final class Geometry {  
    218217
    219218        BBox bounds = new BBox(nodes.get(0));
    220219        for (Node n: nodes) {
    221             bounds.add(n.getCoor());
     220            bounds.add(n);
    222221        }
    223222        return bounds;
    224223    }
    public final class Geometry {  
    413412        else if (segmentOnly && offset >= 1)
    414413            return p2;
    415414        else
    416             return new EastNorth(p1.getX() + ldx * offset, p1.getY() + ldy * offset);
     415            return p1.interpolate(p2, offset);
    417416    }
    418417
    419418    /**
    public final class Geometry {  
    510509        boolean begin = true;
    511510        for (Node n : polygon) {
    512511            if (begin) {
    513                 path.moveTo(n.getCoor().lon(), n.getCoor().lat());
     512                path.moveTo(n.lon(), n.lat());
    514513                begin = false;
    515514            } else {
    516                 path.lineTo(n.getCoor().lon(), n.getCoor().lat());
     515                path.lineTo(n.lon(), n.lat());
    517516            }
    518517        }
    519518        if (!begin) {
    public final class Geometry {  
    706705        double area2 = 0.;
    707706
    708707        for (int node = 1; node <= /*sic! consider last-first as well*/ nodesCount; node++) {
    709             LatLon coorPrev = nodes.get(node - 1).getCoor();
    710             LatLon coorCurr = nodes.get(node % nodesCount).getCoor();
     708            Node coorPrev = nodes.get(node - 1);
     709            Node coorCurr = nodes.get(node % nodesCount);
    711710            area2 += coorPrev.lon() * coorCurr.lat();
    712711            area2 -= coorCurr.lon() * coorPrev.lat();
    713712        }
    public final class Geometry {  
    966965        CheckParameterUtil.ensureParameterNotNull(nodes, "nodes");
    967966        double area = 0;
    968967        double perimeter = 0;
     968        Projection useProjection = projection == null ? Main.getProjection() : projection;
     969
    969970        if (!nodes.isEmpty()) {
    970971            boolean closed = nodes.get(0) == nodes.get(nodes.size() - 1);
    971972            int numSegments = closed ? nodes.size() - 1 : nodes.size();
    972             EastNorth p1 = projection == null ? nodes.get(0).getEastNorth() : projection.latlon2eastNorth(nodes.get(0).getCoor());
     973            EastNorth p1 = nodes.get(0).getEastNorth(useProjection);
    973974            for (int i = 1; i <= numSegments; i++) {
    974975                final Node node = nodes.get(i == numSegments ? 0 : i);
    975                 final EastNorth p2 = projection == null ? node.getEastNorth() : projection.latlon2eastNorth(node.getCoor());
     976                final EastNorth p2 = node.getEastNorth(useProjection);
    976977                if (p1 != null && p2 != null) {
    977978                    area += p1.east() * p2.north() - p2.east() * p1.north();
    978979                    perimeter += p1.distance(p2);
  • test/unit/org/openstreetmap/josm/data/projection/ShiftedProjectionTest.java

    diff --git a/test/unit/org/openstreetmap/josm/data/projection/ShiftedProjectionTest.java b/test/unit/org/openstreetmap/josm/data/projection/ShiftedProjectionTest.java
    index 8a2b625..7e5c2a1 100644
    a b import java.util.stream.Collectors;  
    1313import org.junit.Test;
    1414import org.openstreetmap.josm.data.ProjectionBounds;
    1515import org.openstreetmap.josm.data.coor.EastNorth;
     16import org.openstreetmap.josm.data.coor.ILatLon;
    1617import org.openstreetmap.josm.data.coor.LatLon;
    1718
    1819/**
    import org.openstreetmap.josm.data.coor.LatLon;  
    2223public class ShiftedProjectionTest {
    2324    private static final class ProjectingBase implements Projecting {
    2425        @Override
    25         public EastNorth latlon2eastNorth(LatLon ll) {
     26        public EastNorth latlon2eastNorth(ILatLon ll) {
    2627            return new EastNorth(ll.lat() * 2, ll.lon() * 3);
    2728        }
    2829
    public class ShiftedProjectionTest {  
    5253    }
    5354
    5455    /**
    55      * Test {@link ShiftedProjecting#latlon2eastNorth(LatLon)}
     56     * Test {@link ShiftedProjecting#latlon2eastNorth(ILatLon)}
    5657     */
    5758    @Test
    5859    public void testLatlon2eastNorth() {