Changeset 9790 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2016-02-12T14:31:47+01:00 (8 years ago)
Author:
bastiK
Message:

use intended units for east/north coordinates (see #12186)

When east/north coordinates are not in meter, but
feet, ... convert them to correct units.
Currently they are always stored in meters or degrees.
This makes no difference to JOSM internally, but affects
services like WMS/WMTS.
Only relevant for projections with +units=... or +to_meter=...
parameter set to non-default value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r9628 r9790  
    293293            }
    294294            Projection proj = Projections.getProjectionByCode(ref.code);
    295             double scale = ((CustomProjection) proj).getMetersPerUnitProj();
     295            double scale = ((CustomProjection) proj).getToMeter();
    296296            for (Pair<LatLon, EastNorth> p : ref.data) {
    297297                LatLon ll = p.a;
     
    303303                    en = new EastNorth(en.north(), en.east());
    304304                }
     305                en = new EastNorth(en.east() * scale, en.north() * scale); // convert to meter
    305306                final double EPSILON_EN = 1e-2; // 1cm
    306307                if (!isEqual(enRef, en, EPSILON_EN, true)) {
Note: See TracChangeset for help on using the changeset viewer.