Changeset 36186 in osm for applications/editors
- Timestamp:
- 2023-10-30T14:40:56+01:00 (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java
r36173 r36186 55 55 56 56 public static final Pattern COLOR_PATTERN = Pattern.compile("\\p{XDigit}{8}"); 57 private static final Pattern SPACE_PATTERN = Pattern.compile("\\s", Pattern.UNICODE_CHARACTER_CLASS); 57 58 58 59 private final XMLStreamReader parser; … … 144 145 } 145 146 } else if (parser.getLocalName().equals(KML_LINE_STRING) || parser.getLocalName().equals(KML_EXT_TRACK)) { 146 ds.addPrimitive(way = new Way()); 147 way = new Way(); 148 ds.addPrimitive(way); 147 149 wayNodes = new ArrayList<>(); 148 150 list.add(way); 149 151 } else if (parser.getLocalName().equals(KML_COORDINATES)) { 150 String[] tab = parser.getElementText().trim().split("\\s", Pattern.UNICODE_CHARACTER_CLASS);152 String[] tab = SPACE_PATTERN.split(parser.getElementText().trim()); 151 153 for (String s : tab) { 152 154 node = parseNode(ds, wayNodes, node, s.split(",")); 153 155 } 154 156 } else if (parser.getLocalName().equals(KML_EXT_COORD)) { 155 node = parseNode(ds, wayNodes, node, parser.getElementText().trim().split("\\s", Pattern.UNICODE_CHARACTER_CLASS));157 node = parseNode(ds, wayNodes, node, SPACE_PATTERN.split(parser.getElementText().trim())); 156 158 if (node != null && when > 0) { 157 159 node.setRawTimestamp((int) when); … … 177 179 } 178 180 } 179 for (OsmPrimitive p : list) { 180 p.putAll(tags); 181 } 181 ds.update(() -> { 182 for (OsmPrimitive p : list) { 183 p.putAll(tags); 184 } 185 }); 182 186 } 183 187
Note:
See TracChangeset
for help on using the changeset viewer.