Changeset 12169 in josm


Ignore:
Timestamp:
2017-05-15T17:39:43+02:00 (8 days ago)
Author:
michael2402
Message:

Fix lat/lon swapped for GPX conversion, add asymetric test case

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r12167 r12169  
    9090    @Override
    9191    public double lon() {
     92        return lon;
     93    }
     94
     95    @Override
     96    public double lat() {
    9297        return lat;
    93     }
    94 
    95     @Override
    96     public double lat() {
    97         return lon;
    9898    }
    9999
  • trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java

    r12167 r12169  
    326326
    327327        WayPoint closeToMiddle = data.nearestPointOnTrack(new EastNorth(10, 0), 10);
    328         assertEquals(points.get(1).lat(), closeToMiddle.lat(), 1e-4);
    329         assertEquals(points.get(1).lon(), closeToMiddle.lon(), 1e-4);
     328        assertEquals(points.get(1), closeToMiddle);
    330329
    331330        WayPoint close = data.nearestPointOnTrack(new EastNorth(5, 5), 10);
     331        assertEquals(10, close.getEastNorth().east(), .01);
     332        assertEquals(5, close.getEastNorth().north(), .01);
     333
     334        close = data.nearestPointOnTrack(new EastNorth(15, 5), 10);
    332335        assertEquals(10, close.getEastNorth().east(), .01);
    333336        assertEquals(5, close.getEastNorth().north(), .01);
Note: See TracChangeset for help on using the changeset viewer.