Ticket #1555: Add reverse function.patch
| File Add reverse function.patch, 1.8 KB (added by , 17 years ago) |
|---|
-
src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
38 38 if (rawData == null) 39 39 return; 40 40 rawData.recalculateBounds(); 41 if(Main.pref.getBoolean("download.gps.fixDirection", false)) 42 rawData.reverse(); 41 43 String name = tr("Downloaded GPX Data"); 42 44 GpxLayer layer = new GpxLayer(rawData, name); 43 45 Layer x = findMergeLayer(); -
src/org/openstreetmap/josm/data/gpx/GpxData.java
4 4 5 5 import java.io.File; 6 6 import java.util.Collection; 7 import java.util.Collections; 7 8 import java.util.LinkedList; 9 import java.util.List; 8 10 import java.util.Map; 9 11 10 12 import org.openstreetmap.josm.data.Bounds; … … 26 28 public Collection<WayPoint> waypoints = new LinkedList<WayPoint>(); 27 29 28 30 public Bounds bounds; 31 32 public void reverse() { 33 for(GpxTrack x : tracks) { 34 for(Collection<WayPoint> y : x.trackSegs) 35 Collections.reverse((List<WayPoint>) y); 36 } 37 38 for(GpxRoute x : routes) { 39 Collections.reverse((List<WayPoint>) x.routePoints); 40 } 41 42 Collections.reverse((List<WayPoint>) waypoints); 43 } 29 44 30 45 public void mergeFrom(GpxData other) { 31 46 if (storageFile == null && other.storageFile != null) {
