Changeset 34331 in osm for applications/editors/josm/plugins/opendata/src
- Timestamp:
- 2018-06-20T19:25:48+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java
r34089 r34331 30 30 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; 31 31 import org.openstreetmap.josm.plugins.opendata.core.io.ProjectionPatterns; 32 import org.openstreetmap.josm.tools.Logging; 32 33 import org.openstreetmap.josm.tools.date.DateUtils; 33 34 … … 50 51 public static final String KML_EXT_TRACK = "Track"; 51 52 public static final String KML_EXT_COORD = "coord"; 53 public static final String KML_EXT_LANG = "lang"; 52 54 // CHECKSTYLE.ON: SingleSpaceSeparator 53 55 … … 104 106 Relation relation = null; 105 107 String role = ""; 108 String previousName = null; 106 109 Map<String, String> tags = new HashMap<>(); 107 110 while (parser.hasNext()) { … … 115 118 } 116 119 } else if (parser.getLocalName().equals(KML_NAME)) { 117 tags.put(KML_NAME, parser.getElementText()); 120 try { 121 tags.put(KML_NAME, parser.getElementText()); 122 } catch (XMLStreamException e) { 123 Logging.trace(e); 124 } 118 125 } else if (parser.getLocalName().equals(KML_SIMPLE_DATA)) { 119 126 String key = parser.getAttributeValue(null, "name"); … … 151 158 } else if (parser.getLocalName().equals(KML_WHEN)) { 152 159 when = DateUtils.tsFromString(parser.getElementText().trim()); 153 } 160 } else if (parser.getLocalName().equals(KML_EXT_LANG)) { 161 if (KML_NAME.equals(previousName)) { 162 tags.put(KML_NAME, parser.getElementText()); 163 } 164 } 165 previousName = parser.getLocalName(); 154 166 } else if (event == XMLStreamConstants.END_ELEMENT) { 155 167 if (parser.getLocalName().equals(KML_PLACEMARK)) { … … 158 170 list.add(node); 159 171 } else if (parser.getLocalName().equals(KML_LINE_STRING) 160 || parser.getLocalName().equals(KML_EXT_TRACK) 172 || parser.getLocalName().equals(KML_EXT_TRACK) 161 173 || parser.getLocalName().equals(KML_LINEAR_RING)) { 162 174 if (way != null && wayNodes != null)
Note:
See TracChangeset
for help on using the changeset viewer.