Changeset 23650 in osm for applications/editors


Ignore:
Timestamp:
2010-10-16T19:56:45+02:00 (14 years ago)
Author:
mgarbe
Message:

corrected bug: time anonymization was not working. added code.

Location:
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java

    r23189 r23650  
    137137     */
    138138    private GpxData toGpxData(boolean anonTime) {
    139         return data.createGpxData();
     139        return data.createGpxData(anonTime);
    140140    }
    141141
  • applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java

    r23189 r23650  
    4343    }
    4444
    45     public GpxData createGpxData() {
     45    public GpxData createGpxData(boolean anonTime) {
    4646        GpxData result = new GpxData();
    4747
    4848        for (EditGpxTrack track: tracks) {
    4949            if (!track.isDeleted()) {
    50                 GpxTrack newTrack = track.createGpxTrack();
     50                GpxTrack newTrack = track.createGpxTrack(anonTime);
    5151                if (!newTrack.getSegments().isEmpty()) {
    5252                    result.tracks.add(newTrack);
  • applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java

    r23189 r23650  
    3232    }
    3333
    34     public GpxTrack createGpxTrack() {
     34    public GpxTrack createGpxTrack(boolean anonTime) {
    3535
    3636        Collection<Collection<WayPoint>> wayPoints = new ArrayList<Collection<WayPoint>>();
     
    4040                List<WayPoint> points = segment.getNonDeletedWaypoints();
    4141                if (!points.isEmpty()) {
     42                    if (anonTime) {
     43                        // convert to anonymous time
     44                        for (WayPoint w : points) {
     45                            w.attr.put("time", "1970-00-00T00:00:00.000Z");
     46                            w.setTime();
     47                        }
     48                    }
    4249                    wayPoints.add(points);
    4350                }
Note: See TracChangeset for help on using the changeset viewer.