Changeset 8495 in josm for trunk/src


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/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.