Changeset 15959 in josm for trunk/test


Ignore:
Timestamp:
2020-02-29T08:07:39+01:00 (2 years ago)
Author:
GerdP
Message:

fix #13165 Validator did not warn about overlapping multipolygons

  • let CrossingFinder accept multipolygons
  • improve highlighting of overlapping areas
  • if incomplete multipolygons are tested the area calculation is used unless open ends are found, else the same algortihm as in CrossingWays is used to hilite the crossing segments. In the later case overlaps with shared nodes are not (yet) found.
Location:
trunk/test
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java

    r15073 r15959  
    357357    }
    358358
     359    /**
     360     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13165">Bug #13165</a>.
     361     * @throws Exception if an error occurs
     362     */
     363    @Test
     364    public void testTicket13165() throws Exception {
     365        final MapCSSTagChecker test = buildTagChecker(
     366                "area:closed[tag(\"landuse\") = parent_tag(\"landuse\")] ⧉ area:closed[landuse] {"
     367                        + "throwWarning: tr(\"Overlapping Identical Landuses\");"
     368                        + "}");
     369        try (InputStream is = TestUtils.getRegressionDataStream(13165, "13165.osm")) {
     370            test.visit(OsmReader.parseDataSet(is, null).allPrimitives());
     371            List<TestError> errors = test.getErrors();
     372            assertEquals(3, errors.size());
     373        }
     374    }
     375
     376    /**
     377     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13165">Bug #13165</a>.
     378     * @throws Exception if an error occurs
     379     */
     380    @Test
     381    public void testTicket13165IncompleteMP() throws Exception {
     382        final MapCSSTagChecker test = buildTagChecker(
     383                "area:closed[tag(\"landuse\") = parent_tag(\"landuse\")] ⧉ area:closed[landuse] {"
     384                        + "throwWarning: tr(\"Overlapping Identical Landuses\");"
     385                        + "}");
     386        try (InputStream is = TestUtils.getRegressionDataStream(13165, "13165-incomplete.osm.bz2")) {
     387            test.visit(OsmReader.parseDataSet(is, null).allPrimitives());
     388            List<TestError> errors = test.getErrors();
     389            assertEquals(3, errors.size());
     390        }
     391    }
     392
    359393}
Note: See TracChangeset for help on using the changeset viewer.