Changeset 18007 in josm for trunk/test


Ignore:
Timestamp:
2021-07-12T16:25:33+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21044 - keep all tags when merging geojson nodes at the same location

Location:
trunk/test
Files:
2 added
1 edited

Legend:

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

    r17661 r18007  
    217217
    218218    /**
     219     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/21044">Bug #21044</a>.
     220     * @throws Exception in case of error
     221     */
     222    @Test
     223    void testTicket21044Duplicates() throws Exception {
     224        try (InputStream in = TestUtils.getRegressionDataStream(21044, "test.geojson")) {
     225            final List<OsmPrimitive> primitives = new ArrayList<>(
     226                    new GeoJSONReader().doParseDataSet(in, null).getPrimitives(it -> true));
     227            assertEquals(1, primitives.size());
     228            OsmPrimitive primitive = primitives.get(0);
     229            assertTrue(primitive instanceof Node);
     230            Node n = (Node) primitive;
     231            assertNull(n.get("addr:building"));
     232            assertEquals("06883", n.get("addr:postcode"));
     233            assertEquals("22;26", n.get("addr:housenumber"));
     234        }
     235    }
     236
     237    /**
    219238     * Tests error reporting for an invalid FeatureCollection
    220239     * @throws Exception in case of error
     
    229248        }
    230249    }
    231 
    232250}
Note: See TracChangeset for help on using the changeset viewer.