- Timestamp:
- 2020-11-17T01:55:12+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java
r16936 r17320 121 121 LatLon ll = n.getCoor(); 122 122 if (ll != null) { 123 geomObj.add("coordinates", getCoorArray(null, n.getCoor()));123 geomObj.add("coordinates", getCoorArray(null, ll)); 124 124 } 125 125 } … … 154 154 final JsonArrayBuilder polygon = Json.createArrayBuilder(); 155 155 Stream.concat(mp.a.stream(), mp.b.stream()) 156 .map(p -> getCoorsArray(p.getNodes()) 157 // since first node is not duplicated as last node 158 .add(getCoorArray(null, p.getNodes().get(0).getCoor()))) 156 .map(p -> { 157 JsonArrayBuilder array = getCoorsArray(p.getNodes()); 158 LatLon ll = p.getNodes().get(0).getCoor(); 159 // since first node is not duplicated as last node 160 return ll != null ? array.add(getCoorArray(null, ll)) : array; 161 }) 159 162 .forEach(polygon::add); 160 163 geomObj.add("type", "MultiPolygon");
Note:
See TracChangeset
for help on using the changeset viewer.