Opened 12 years ago

Closed 11 years ago

#206 closed defect (fixed)

Saving GPX file doesn't include all data

Reported by: andrew.cunningham@… Owned by: josm@…
Priority: trivial Milestone:
Component: Core Version: tested
Keywords: saving, gpx Cc:


I have done some work adding ways to raw GPS data gathered this morning. At present the OSM database is read-only so I cannot upload my work. I would like to save this back to a GPX file so I can close the application and get on with other stuff.

When I save the file, not all the data is there. I can see specific nodes I have added, but the way data is missing. The GPX file contains <trk> elements, each with a <trkseg> element containing a number of <trkpt> elements. But none of the additional tags for these ways (e.g. highway=secondary, name=Tiviot Way) is saved.

Sure enough if I open up the file, I can see nodes along the paths of roads, with pubs and churches alongside, but no actual road details.

Attachments (1)

Stockport3.gpx (9.9 KB) - added by andrew.cunningham@… 12 years ago.
Saved GPX file with missing way data

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by andrew.cunningham@…

Attachment: Stockport3.gpx added

Saved GPX file with missing way data

comment:1 Changed 12 years ago by andrew.cunningham@…

Priority: minortrivial

Looking through the source code I realised there was capability to save as an OSM file, which I've now used, and this appears to work fine. However the GPX spec does have tags 'name' and 'type' so the name and highway values at least could be saved to a GPX file by calling the following code after: out.println(" <trk>");

for( Entry<String, String> e : w.keys.entrySet() )

if( e.getKey().equals( "name" ) )

out.println( " <name>" + XmlWriter.encode( e.getValue() ) + "</name>" );

if( e.getKey().equals( "highway" ) )

out.println( " <type>" + XmlWriter.encode( e.getValue() ) + "</type>" );


I didn't get as far as looking at the GPX reader code before seeing the OsmWriter code though :)

comment:2 Changed 11 years ago by Gabriel Ebner <ge@…>

Resolution: fixed
Status: newclosed

Fixed in r508.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain josm@….
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.