Changeset 8495 in josm


Ignore:
Timestamp:
2015-06-19T19:20:50+02:00 (9 years ago)
Author:
simon04
Message:

fix #11150 - False validator warning on ford if node is outside the downloaded area and highway or waterway is not loaded

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/combinations.mapcss

    r8480 r8495  
    264264way[waterway] > node[ford?] { set ford_on_waterway; }
    265265way[highway] > node[ford?] { set ford_on_highway; }
    266 node[ford?]!.ford_on_waterway, node[ford?]!.ford_on_highway {
     266node[ford?]:in-downloaded-area!.ford_on_waterway, node[ford?]:in-downloaded-area!.ford_on_highway {
    267267    throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
    268268}
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r8470 r8495  
    13021302     * Matches objects within source area ("downloaded area").
    13031303     */
    1304     private static class InDataSourceArea extends InArea {
     1304    public static class InDataSourceArea extends InArea {
    13051305
    13061306        public InDataSourceArea(boolean all) {
     
    13101310        @Override
    13111311        protected Bounds getBounds() {
    1312             return new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D());
     1312            return Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
     1313                    ? null : new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D());
    13131314        }
    13141315    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r8494 r8495  
    1313
    1414import org.openstreetmap.josm.Main;
     15import org.openstreetmap.josm.actions.search.SearchCompiler;
    1516import org.openstreetmap.josm.data.osm.Node;
    1617import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    467468                    !MultipolygonCache.getInstance().get(Main.map.mapView, (Relation) e.osm).getOpenEnds().isEmpty();
    468469        }
     470
     471        private static final Predicate<OsmPrimitive> IN_DOWNLOADED_AREA = new SearchCompiler.InDataSourceArea(false);
     472
     473        /**
     474         * {@code in-downloaded-area} tests whether the object is within source area ("downloaded area").
     475         * @see SearchCompiler.InDataSourceArea
     476         */
     477        static boolean inDownloadedArea(Environment e) {
     478            return IN_DOWNLOADED_AREA.evaluate(e.osm);
     479        }
     480
    469481    }
    470482
Note: See TracChangeset for help on using the changeset viewer.