Changeset 17131 in josm
- Timestamp:
- 2020-10-09T06:59:05+02:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GeoJSONReader.java
r17115 r17131 163 163 // create misc. non-geometry feature 164 164 final Relation relation = new Relation(); 165 fillTagsFromFeature(feature, relation); 165 166 relation.put(TYPE, type.toString()); 166 fillTagsFromFeature(feature, relation);167 167 getDataSet().addPrimitive(relation); 168 168 } … … 325 325 } 326 326 327 /** 328 * Replace all existing tags in primitive by the values given in the GeoJSON feature. 329 * @param feature the GeoJSON feature 330 * @param primitive the OSM primitive 331 */ 327 332 private static void fillTagsFromFeature(final JsonObject feature, final OsmPrimitive primitive) { 328 333 if (feature != null) { -
trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java
r16935 r17131 25 25 import org.openstreetmap.josm.data.osm.Node; 26 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 27 import org.openstreetmap.josm.data.osm.Relation; 27 28 import org.openstreetmap.josm.data.osm.Way; 28 29 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 186 187 .allMatch(i -> areEqualNodes(((Way) p1).getNode(i), ((Way) p2).getNode(i))); 187 188 } 189 190 /** 191 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/19822">Bug #19822</a>. 192 * @throws Exception in case of error 193 */ 194 @Test 195 public void testTicket19822() throws Exception { 196 try (InputStream in = TestUtils.getRegressionDataStream(19822, "data.geojson")) { 197 final List<OsmPrimitive> primitives = new ArrayList<>( 198 new GeoJSONReader().doParseDataSet(in, null).getPrimitives(it -> true)); 199 assertTrue(primitives.stream().anyMatch(p -> p instanceof Relation && p.isMultipolygon())); 200 } 201 } 202 188 203 }
Note:
See TracChangeset
for help on using the changeset viewer.