Changeset 4046 in josm


Ignore:
Timestamp:
2011-04-20T15:35:10+02:00 (10 years ago)
Author:
stoecker
Message:

fix #6031 - save named nodes as waypoints when exporting OSM to GPX - patch by glebius

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r3965 r4046  
    523523        }
    524524
    525         // what is this loop meant to do? it creates waypoints but never
    526         // records them?
    527525        for (Node n : data.getNodes()) {
    528526            if (n.isIncomplete() || n.isDeleted() || doneNodes.contains(n)) {
    529527                continue;
    530528            }
     529            String name = n.get("name");
     530            if (name == null)
     531                continue;
    531532            WayPoint wpt = new WayPoint(n.getCoor());
     533            wpt.attr.put("name", name);
    532534            if (!n.isTimestampEmpty()) {
    533535                wpt.attr.put("time", DateUtils.fromDate(n.getTimestamp()));
    534536                wpt.setTime();
    535537            }
    536             String name = n.get("name");
    537             if (name != null) {
    538                 wpt.attr.put("name", name);
    539             }
     538            String desc = n.get("description");
     539            if (desc != null) {
     540               wpt.attr.put("desc", desc);
     541            }
     542
     543            gpxData.waypoints.add(wpt);
    540544        }
    541545        return gpxData;
Note: See TracChangeset for help on using the changeset viewer.