-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api: Get /api/0.6/trackpoints returns gpx version 1.0 #2350
Comments
I see no reason to make it configurable, but equally if we don't use any 1.1 features then I don't see any great reason to change it. Are there are incompatible differences between the two, or does 1.1 essentially just declare that that there are extra elements/attributes we might use? |
Sadly the official site apparently only documents the current version so there is no way to tell what the changes are. I suspect most things never even look at the version to be honest. |
Download both https://www.topografix.com/GPX/1/0/gpx.xsd and https://www.topografix.com/GPX/1/1/gpx.xsd and paste them one at a time into http://xsd2xml.com/ to generate a sample file for each version. Most of the elements are optional anyway, but here's a full blown sample for each version: At a first glance, the most notable difference is probably introducing a dedicated Version 1.0<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.0" creator="str1234">
<name>str1234</name>
<desc>str1234</desc>
<author>str1234</author>
<email>str1234</email>
<url>http://www.xsd2xml.com</url>
<urlname>str1234</urlname>
<time>2012-12-13T12:12:12</time>
<keywords>str1234</keywords>
<bounds minlat="123.45" minlon="123.45" maxlat="123.45" maxlon="123.45" />
<wpt lat="123.45" lon="123.45">
<ele>123.45</ele>
<time>2012-12-13T12:12:12</time>
<magvar>123.45</magvar>
<geoidheight>123.45</geoidheight>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<url>http://www.xsd2xml.com</url>
<urlname>str1234</urlname>
<sym>str1234</sym>
<type>str1234</type>
<fix>none</fix>
<sat>33</sat>
<hdop>123.45</hdop>
<vdop>123.45</vdop>
<pdop>123.45</pdop>
<ageofdgpsdata>123.45</ageofdgpsdata>
<dgpsid>1234</dgpsid>
</wpt>
<rte>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<url>http://www.xsd2xml.com</url>
<urlname>str1234</urlname>
<number>33</number>
<rtept lat="123.45" lon="123.45">
<ele>123.45</ele>
<time>2012-12-13T12:12:12</time>
<magvar>123.45</magvar>
<geoidheight>123.45</geoidheight>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<url>http://www.xsd2xml.com</url>
<urlname>str1234</urlname>
<sym>str1234</sym>
<type>str1234</type>
<fix>none</fix>
<sat>33</sat>
<hdop>123.45</hdop>
<vdop>123.45</vdop>
<pdop>123.45</pdop>
<ageofdgpsdata>123.45</ageofdgpsdata>
<dgpsid>1234</dgpsid>
</rtept>
</rte>
<trk>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<url>http://www.xsd2xml.com</url>
<urlname>str1234</urlname>
<number>33</number>
<trkseg>
<trkpt lat="123.45" lon="123.45">
<ele>123.45</ele>
<time>2012-12-13T12:12:12</time>
<course>123.45</course>
<speed>123.45</speed>
<magvar>123.45</magvar>
<geoidheight>123.45</geoidheight>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<url>http://www.xsd2xml.com</url>
<urlname>str1234</urlname>
<sym>str1234</sym>
<type>str1234</type>
<fix>none</fix>
<sat>33</sat>
<hdop>123.45</hdop>
<vdop>123.45</vdop>
<pdop>123.45</pdop>
<ageofdgpsdata>123.45</ageofdgpsdata>
<dgpsid>1234</dgpsid>
</trkpt>
</trkseg>
</trk>
</gpx> Version 1.1<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.1" creator="str1234">
<metadata>
<name>str1234</name>
<desc>str1234</desc>
<author>
<name>str1234</name>
<email id="str1234" domain="str1234" />
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
</author>
<copyright author="str1234">
<year>1999</year>
<license>http://www.xsd2xml.com</license>
</copyright>
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
<time>2012-12-13T12:12:12</time>
<keywords>str1234</keywords>
<bounds minlat="123.45" minlon="123.45" maxlat="123.45" maxlon="123.45" />
<extensions />
</metadata>
<wpt lat="123.45" lon="123.45">
<ele>123.45</ele>
<time>2012-12-13T12:12:12</time>
<magvar>123.45</magvar>
<geoidheight>123.45</geoidheight>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
<sym>str1234</sym>
<type>str1234</type>
<fix>none</fix>
<sat>33</sat>
<hdop>123.45</hdop>
<vdop>123.45</vdop>
<pdop>123.45</pdop>
<ageofdgpsdata>123.45</ageofdgpsdata>
<dgpsid>1234</dgpsid>
<extensions />
</wpt>
<rte>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
<number>33</number>
<type>str1234</type>
<extensions />
<rtept lat="123.45" lon="123.45">
<ele>123.45</ele>
<time>2012-12-13T12:12:12</time>
<magvar>123.45</magvar>
<geoidheight>123.45</geoidheight>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
<sym>str1234</sym>
<type>str1234</type>
<fix>none</fix>
<sat>33</sat>
<hdop>123.45</hdop>
<vdop>123.45</vdop>
<pdop>123.45</pdop>
<ageofdgpsdata>123.45</ageofdgpsdata>
<dgpsid>1234</dgpsid>
<extensions />
</rtept>
</rte>
<trk>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
<number>33</number>
<type>str1234</type>
<extensions />
<trkseg>
<trkpt lat="123.45" lon="123.45">
<ele>123.45</ele>
<time>2012-12-13T12:12:12</time>
<magvar>123.45</magvar>
<geoidheight>123.45</geoidheight>
<name>str1234</name>
<cmt>str1234</cmt>
<desc>str1234</desc>
<src>str1234</src>
<link href="http://www.xsd2xml.com">
<text>str1234</text>
<type>str1234</type>
</link>
<sym>str1234</sym>
<type>str1234</type>
<fix>none</fix>
<sat>33</sat>
<hdop>123.45</hdop>
<vdop>123.45</vdop>
<pdop>123.45</pdop>
<ageofdgpsdata>123.45</ageofdgpsdata>
<dgpsid>1234</dgpsid>
<extensions />
</trkpt>
<extensions />
</trkseg>
</trk>
<extensions />
</gpx> |
So there are a few metadata elements which have changed to be structured containers but I don't think we use any of those so 1.0 would appear to offer the greatest compatibiilty? |
Right, we don't use the header fields in https://api.openstreetmap.org/api/0.6/trackpoints?bbox=0,51.5,0.25,51.75&page=0 I see a small change between both versions on the
<trk>
<name>2019_06_22.gpx.gz</name>
<desc>Bike ride</desc>
<url>https://api.openstreetmap.org/user/TomH/traces/3026889</url>
<trkseg>
<trkpt lat="51.7443750" lon="0.0000117">
<time>2019-06-22T14:56:39Z</time>
</trkpt>
<trkpt lat="51.7443833" lon="0.0000500"> |
The compatibility problem I hit was a gpx parsing tool which checks that xlms is the 1/1 version and refuses to parse it otherwise. For reference: NetTopologySuite/NetTopologySuite.IO.GPX#38 |
I still think using an outdated format is less than ideal, even if the new format doesn't provide any new capabilities that fact that OSM API returns and outdated GPX version causes other tools that relay on OSM to keep supporting this old format and keeping old code which is useless otherwise... |
When calling
Get /api/0.6/trackpoints?bbox=left,bottom,right,top&page=pageNumber
The result
<?xml version="1.0" encoding="UTF-8"?> <gpx version="1.0" creator="OpenStreetMap.org" xmlns="http://www.topografix.com/GPX/1/0"> <trk>...
Is gpx version 1.0 which is "old" as of 2004. See https://www.topografix.com/gpx.asp
Could the call take another optional parameter specifying the gpx version to return? (either 1.0 or 1.1 which is current)
For backward compatibility, default to current behavior (1.0) if the value is ommited.
The text was updated successfully, but these errors were encountered: