Changeset 17185 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2020-10-13T11:57:39+02:00 (4 years ago)
Author:
GerdP
Message:

fix #19822: Inconsistent behavior with GeoJSON multipolygons
Handle care when one polygon is part of two(or more) multipolygons. e.g. serves as inner in relation A, but as a outer for relation B

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java

    r17131 r17185  
    198198                    new GeoJSONReader().doParseDataSet(in, null).getPrimitives(it -> true));
    199199            assertTrue(primitives.stream().anyMatch(p -> p instanceof Relation && p.isMultipolygon()));
     200            assertEquals(3, primitives.stream().filter(Way.class::isInstance).count());
     201        }
     202    }
     203
     204    /**
     205     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/19822">Bug #19822</a>.
     206     * @throws Exception in case of error
     207     */
     208    @Test
     209    public void testTicket19822Nested() throws Exception {
     210        try (InputStream in = TestUtils.getRegressionDataStream(19822, "problem3.geojson")) {
     211            final List<OsmPrimitive> primitives = new ArrayList<>(
     212                    new GeoJSONReader().doParseDataSet(in, null).getPrimitives(it -> true));
     213            assertTrue(primitives.stream().anyMatch(p -> p instanceof Relation && p.isMultipolygon()));
     214            assertEquals(3, primitives.stream().filter(Way.class::isInstance).count());
    200215        }
    201216    }
Note: See TracChangeset for help on using the changeset viewer.