Opened 18 years ago
Closed 17 years ago
#206 closed defect (fixed)
Saving GPX file doesn't include all data
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | Core | Version: | tested |
Keywords: | saving, gpx | Cc: |
Description
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)
Change History (3)
by , 18 years ago
Attachment: | Stockport3.gpx added |
---|
comment:1 by , 18 years ago
Priority: | minor → trivial |
---|
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 :)
Saved GPX file with missing way data