Changeset 17612 in josm for trunk/src/org
- Timestamp:
- 2021-03-21T08:56:56+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r17377 r17612 41 41 public class DuplicateNode extends Test { 42 42 43 private static class NodeHash implements Hash<Object, Object> { 44 45 private final double precision = Config.getPref().getDouble("validator.duplicatenodes.precision", 0.); 46 47 private LatLon roundCoord(LatLon coor) { 43 protected static class NodeHash implements Hash<Object, Object> { 44 45 /** 46 * Rounding on OSM server and via {@link LatLon#roundToOsmPrecision} sometimes differs in the last digit by 1. 47 * Thus, for the duplicate node test, we reduce the precision by one to find errors before uploading. 48 * @see LatLon#MAX_SERVER_INV_PRECISION 49 */ 50 private final double precision = 51 1 / Config.getPref().getDouble("validator.duplicatenodes.precision", LatLon.MAX_SERVER_PRECISION * 10); 52 53 /** 54 * @see LatLon#roundToOsmPrecision 55 */ 56 protected LatLon roundCoord(LatLon coor) { 48 57 return new LatLon( 49 Math.round(coor.lat() /precision)*precision,50 Math.round(coor.lon() /precision)*precision58 Math.round(coor.lat() * precision) / precision, 59 Math.round(coor.lon() * precision) / precision 51 60 ); 52 61 }
Note:
See TracChangeset
for help on using the changeset viewer.
