Changeset 33049 in osm for applications/editors/josm/plugins/opendata
- Timestamp:
- 2016-11-03T21:49:11+01:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/opendata
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java
r32898 r33049 35 35 36 36 private static final String COOR = "(\\-?\\d+(?:[\\.,]\\d+)?)"; 37 private static final Pattern LATLON_PATTERN = Pattern.compile("^"+COOR+"[,;]?\\s*"+COOR+"$"); 37 // Lat/lon pattern with optional altitude and precision 38 private static final Pattern LATLON_PATTERN = Pattern.compile( 39 "^"+COOR+"[,;\\s]\\s*"+COOR+"(?:[,;\\s]\\s*"+COOR+"(?:[,;\\s]\\s*"+COOR+")?)?$"); 38 40 39 41 protected final SpreadSheetHandler handler; … … 220 222 if (!coordinate) { 221 223 if (!fields[i].isEmpty()) { 222 nodes.values().iterator().next().put(header[i], fields[i]); 224 for (Node n : nodes.values()) { 225 n.put(header[i], fields[i]); 226 } 223 227 } 224 228 } … … 232 236 EastNorth en = ens.get(c); 233 237 if (en.isValid()) { 234 n.setCoor(c.proj != null && !handlerOK ? c.proj.eastNorth2latlon(en) : handler .getCoor(en, fields));238 n.setCoor(c.proj != null && !handlerOK ? c.proj.eastNorth2latlon(en) : handler != null ? handler.getCoor(en, fields) : null); 235 239 } else { 236 240 Main.warn("Skipping line "+lineNumber+" because no valid coordinates have been found at columns "+c);
Note:
See TracChangeset
for help on using the changeset viewer.