Changeset 2693 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-12-28T10:04:15+01:00 (15 years ago)
Author:
Gubaer
Message:

added getRoundedToOsmPrecision(), going to be used in the validator plugin shortly

File:
1 edited

Legend:

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

    r2612 r2693  
    195195    }
    196196
     197    /**
     198     * Replies a clone of this lat LatLon, rounded to OSM precisions, i.e. to
     199     * 10^-7
     200     *
     201     * @return a clone of this lat LatLon
     202     */
     203    public LatLon getRoundedToOsmPrecision() {
     204        return new LatLon(
     205                Math.round(lat() * 10e7) / 10e7d,
     206                Math.round(lon() * 10e7) / 10e7d
     207        );
     208    }
     209
     210
    197211    @Override
    198212    public int hashCode() {
Note: See TracChangeset for help on using the changeset viewer.