Changeset 17131 in josm for trunk/src/org


Ignore:
Timestamp:
2020-10-09T06:59:05+02:00 (4 years ago)
Author:
GerdP
Message:

see #19822: Inconsistent behavior with GeoJSON multipolygons

  • fix another place were fillTagsFromFeature() was called after a tag was added to the OSM primitive
  • add javadoc for the rather confusing behaviour of fillTagsFromFeature()
  • add unit test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GeoJSONReader.java

    r17115 r17131  
    163163        // create misc. non-geometry feature
    164164        final Relation relation = new Relation();
     165        fillTagsFromFeature(feature, relation);
    165166        relation.put(TYPE, type.toString());
    166         fillTagsFromFeature(feature, relation);
    167167        getDataSet().addPrimitive(relation);
    168168    }
     
    325325    }
    326326
     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     */
    327332    private static void fillTagsFromFeature(final JsonObject feature, final OsmPrimitive primitive) {
    328333        if (feature != null) {
Note: See TracChangeset for help on using the changeset viewer.