Changeset 14075 in josm for trunk/src/org
- Timestamp:
- 2018-08-02T22:48:59+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r14060 r14075 73 73 import org.openstreetmap.josm.data.osm.OsmPrimitiveComparator; 74 74 import org.openstreetmap.josm.data.osm.Relation; 75 import org.openstreetmap.josm.data.osm.Tagged; 75 76 import org.openstreetmap.josm.data.osm.UploadPolicy; 76 77 import org.openstreetmap.josm.data.osm.Way; … … 747 748 trk.add(trkseg); 748 749 } 749 if (!n.isTagged() ) {750 if (!n.isTagged() || containsOnlyGpxTags(n)) { 750 751 doneNodes.add(n); 751 752 } … … 755 756 gpxData.addTrack(new ImmutableGpxTrack(trk, trkAttr)); 756 757 }); 758 } 759 760 private static boolean containsOnlyGpxTags(Tagged t) { 761 for (String key : t.getKeys().keySet()) { 762 if (!GpxConstants.WPT_KEYS.contains(key)) { 763 return false; 764 } 765 } 766 return true; 757 767 } 758 768 -
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r12156 r14075 10 10 import java.nio.charset.StandardCharsets; 11 11 import java.util.Collection; 12 import java.util.Date; 12 13 import java.util.List; 13 14 import java.util.Map; … … 28 29 import org.openstreetmap.josm.data.gpx.WayPoint; 29 30 import org.openstreetmap.josm.tools.JosmRuntimeException; 31 import org.openstreetmap.josm.tools.date.DateUtils; 30 32 31 33 /** … … 81 83 82 84 out.println("<?xml version='1.0' encoding='UTF-8'?>"); 83 out.println("<gpx version=\"1.1\" creator=\"JOSM GPX export\" xmlns=\"http://www.topografix.com/GPX/1/1\" \n" +84 85 " xmlns:xsi=\""+XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI+"\" \n" +86 85 out.println("<gpx version=\"1.1\" creator=\"JOSM GPX export\" xmlns=\"http://www.topografix.com/GPX/1/1\""); 86 out.println((hasExtensions ? String.format(" xmlns:josm=\"%s\"%n", JOSM_EXTENSIONS_NAMESPACE_URI) : "") + 87 " xmlns:xsi=\""+XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI+"\""); 88 out.println(" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\">"); 87 89 indent = " "; 88 90 writeMetaData(); … … 112 114 if (value != null) { 113 115 simpleTag(key, value); 116 } else { 117 Object val = obj.get(key); 118 if (val instanceof Date) { 119 simpleTag(key, DateUtils.getGpxFormat().format(val)); 120 } 114 121 } 115 122 }
Note:
See TracChangeset
for help on using the changeset viewer.