Changeset 12820 in josm


Ignore:
Timestamp:
2017-09-10T15:49:59+02:00 (7 years ago)
Author:
bastiK
Message:

see #15229 - wrap around +180 degrees, for consistency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java

    r12819 r12820  
    148148        if (proj.lonIsLinearToEast()) {
    149149            //FIXME: Respect datum?
    150             // wrap the wrold around
     150            // wrap the world around
    151151            Bounds bounds = getWorldBoundsLatLon();
    152152            double minEast = latlon2eastNorth(bounds.getMin()).east();
     
    225225
    226226    private void visitOutline(Bounds b, int nPoints, Consumer<EastNorth> visitor) {
    227         double minlon = b.getMinLon();
     227        double maxlon = b.getMaxLon();
    228228        if (b.crosses180thMeridian()) {
    229             minlon -= 360.0;
    230         }
    231         double spanLon = b.getMaxLon() - minlon;
     229            maxlon += 360.0;
     230        }
     231        double spanLon = maxlon - b.getMinLon();
    232232        double spanLat = b.getMaxLat() - b.getMinLat();
    233233
     
    235235        for (int step = 0; step < nPoints; step++) {
    236236            visitor.accept(latlon2eastNorth(
    237                     new LatLon(b.getMinLat(), minlon + spanLon * step / nPoints)));
    238         }
    239         for (int step = 0; step < nPoints; step++) {
    240             visitor.accept(latlon2eastNorth(
    241                     new LatLon(b.getMinLat() + spanLat * step / nPoints, b.getMaxLon())));
    242         }
    243         for (int step = 0; step < nPoints; step++) {
    244             visitor.accept(latlon2eastNorth(
    245                     new LatLon(b.getMaxLat(), b.getMaxLon() - spanLon * step / nPoints)));
    246         }
    247         for (int step = 0; step < nPoints; step++) {
    248             visitor.accept(latlon2eastNorth(
    249                     new LatLon(b.getMaxLat() - spanLat * step / nPoints, minlon)));
     237                    new LatLon(b.getMinLat(), b.getMinLon() + spanLon * step / nPoints)));
     238        }
     239        for (int step = 0; step < nPoints; step++) {
     240            visitor.accept(latlon2eastNorth(
     241                    new LatLon(b.getMinLat() + spanLat * step / nPoints, maxlon)));
     242        }
     243        for (int step = 0; step < nPoints; step++) {
     244            visitor.accept(latlon2eastNorth(
     245                    new LatLon(b.getMaxLat(), maxlon - spanLon * step / nPoints)));
     246        }
     247        for (int step = 0; step < nPoints; step++) {
     248            visitor.accept(latlon2eastNorth(
     249                    new LatLon(b.getMaxLat() - spanLat * step / nPoints, b.getMinLon())));
    250250        }
    251251    }
Note: See TracChangeset for help on using the changeset viewer.