Ignore:
Timestamp:
2011-09-15T15:14:22+02:00 (8 years ago)
Author:
bastiK
Message:

applied #6834 - Imagery providers slippy map enhancements: polygon support (patch by Don-vip, modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r4206 r4423  
    223223        return "LatLon[lat="+lat()+",lon="+lon()+"]";
    224224    }
    225 
     225   
     226    /**
     227     * Returns the value rounded to OSM precisions, i.e. to
     228     * LatLon.MAX_SERVER_PRECISION
     229     *
     230     * @return rounded value
     231     */
     232    public static double roundToOsmPrecision(double value) {
     233        return Math.round(value / MAX_SERVER_PRECISION) * MAX_SERVER_PRECISION;
     234    }
     235   
    226236    /**
    227237     * Replies a clone of this lat LatLon, rounded to OSM precisions, i.e. to
     
    232242    public LatLon getRoundedToOsmPrecision() {
    233243        return new LatLon(
    234                 Math.round(lat() / MAX_SERVER_PRECISION) * MAX_SERVER_PRECISION,
    235                 Math.round(lon() / MAX_SERVER_PRECISION) * MAX_SERVER_PRECISION
     244                roundToOsmPrecision(lat()),
     245                roundToOsmPrecision(lon())
    236246        );
    237247    }
Note: See TracChangeset for help on using the changeset viewer.