Changeset 19681 in osm for applications/editors/josm/plugins/dataimport/src/org
- Timestamp:
- 2010-01-30T20:10:15+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/TangoGPS.java
r19503 r19681 13 13 import java.io.InputStreamReader; 14 14 import java.util.ArrayList; 15 import java.util.Collections; 16 import java.util.List; 15 17 16 18 import javax.swing.JOptionPane; … … 20 22 import org.openstreetmap.josm.data.coor.LatLon; 21 23 import org.openstreetmap.josm.data.gpx.GpxData; 22 import org.openstreetmap.josm.data.gpx.GpxTrack; 24 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrackSegment; 25 import org.openstreetmap.josm.data.gpx.SingleSegmentGpxTrack; 23 26 import org.openstreetmap.josm.data.gpx.WayPoint; 24 27 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 46 49 public void importData(File file, ProgressMonitor progressMonitor) throws IOException { 47 50 // create the data tree 48 GpxData data = new GpxData(); 49 GpxTrack currentTrack = new GpxTrack(); 50 data.tracks.add(currentTrack); 51 ArrayList<WayPoint> currentTrackSeg = new ArrayList<WayPoint>(); 51 List<WayPoint> currentTrackSeg = new ArrayList<WayPoint>(); 52 52 53 53 int imported = 0; … … 79 79 failure = failure - imported; 80 80 if(imported > 0) { 81 currentTrack.trackSegs.add(currentTrackSeg); 81 GpxData data = new GpxData(); 82 data.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(currentTrackSeg), Collections.<String, Object>emptyMap())); 82 83 data.recalculateBounds(); 83 84 data.storageFile = file; -
applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/Tcx.java
r19503 r19681 8 8 import java.util.ArrayList; 9 9 import java.util.Collection; 10 import java.util.Collections; 10 11 11 12 import javax.xml.bind.JAXBContext; … … 19 20 import org.openstreetmap.josm.data.coor.LatLon; 20 21 import org.openstreetmap.josm.data.gpx.GpxData; 21 import org.openstreetmap.josm.data.gpx.GpxTrack; 22 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack; 22 23 import org.openstreetmap.josm.data.gpx.WayPoint; 23 24 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 159 160 XMLGregorianCalendar startTime = activityLap 160 161 .getStartTime(); 161 GpxTrack currentTrack = new GpxTrack(); 162 gpxData.tracks.add(currentTrack); 162 Collection<Collection<WayPoint>> currentTrack = new ArrayList<Collection<WayPoint>>(); 163 163 for (TrackT track : activityLap.getTrack()) { 164 164 if (track.getTrackpoint() != null) { 165 165 Collection<WayPoint> currentTrackSeg = new ArrayList<WayPoint>(); 166 currentTrack. trackSegs.add(currentTrackSeg);166 currentTrack.add(currentTrackSeg); 167 167 for (TrackpointT tp : 168 168 track.getTrackpoint()) { … … 182 182 } 183 183 } 184 gpxData.tracks.add(new ImmutableGpxTrack(currentTrack, Collections.<String, Object>emptyMap())); 184 185 } 185 186 } … … 197 198 for (CourseT course : tcd.getCourses().getCourse()) { 198 199 if (course.getTrack() != null) { 199 GpxTrack currentTrack = new GpxTrack(); 200 gpxData.tracks.add(currentTrack); 200 Collection<Collection<WayPoint>> currentTrack = new ArrayList<Collection<WayPoint>>(); 201 201 for (TrackT track : course.getTrack()) { 202 202 if (track.getTrackpoint() != null) { 203 203 Collection<WayPoint> currentTrackSeg = new ArrayList<WayPoint>(); 204 currentTrack. trackSegs.add(currentTrackSeg);204 currentTrack.add(currentTrackSeg); 205 205 for (TrackpointT tp : track.getTrackpoint()) { 206 206 WayPoint waypt = convertPoint(tp); … … 212 212 } 213 213 } 214 gpxData.tracks.add(new ImmutableGpxTrack(currentTrack, Collections.<String, Object>emptyMap())); 214 215 } 215 216 }
Note:
See TracChangeset
for help on using the changeset viewer.