Changeset 14802 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
- Timestamp:
- 2019-02-23T17:46:51+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r14484 r14802 25 25 26 26 import org.openstreetmap.josm.data.coor.LatLon; 27 import org.openstreetmap.josm.data.gpx.GpxDistance; 27 28 import org.openstreetmap.josm.data.osm.IPrimitive; 28 29 import org.openstreetmap.josm.data.osm.Node; 30 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 31 import org.openstreetmap.josm.data.osm.Way; 30 32 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 31 33 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match; 32 34 import org.openstreetmap.josm.data.osm.search.SearchParseError; 35 import org.openstreetmap.josm.gui.MainApplication; 33 36 import org.openstreetmap.josm.gui.mappaint.Cascade; 34 37 import org.openstreetmap.josm.gui.mappaint.Environment; … … 520 523 521 524 /** 525 * Returns the lowest distance between the OSM object and a GPX point 526 * <p> 527 * @param env the environment 528 * @return the distance between the object and the closest gpx point or {@code Double.MAX_VALUE} 529 * @since 14802 530 */ 531 public static double gpx_distance(final Environment env) { // NO_UCD (unused code) 532 if (env.osm instanceof OsmPrimitive) { 533 return MainApplication.getLayerManager().getAllGpxData().stream() 534 .mapToDouble(gpx -> GpxDistance.getLowestDistance((OsmPrimitive) env.osm, gpx)) 535 .min().orElse(Double.MAX_VALUE); 536 } 537 return Double.MAX_VALUE; 538 } 539 540 /** 522 541 * Determines whether the object has a tag with the given key. 523 542 * @param env the environment
Note:
See TracChangeset
for help on using the changeset viewer.
