Open Phyks opened 5 years ago
Good catch! Actually, looking at the schema, both course
and speed
are no longer standard in GPX 1.1. However, v2 of Garmin's trackpoint extensions schema allow for both elements to be included as extensions. So, I think the best approach is the following:
course
and speed
from the librarygpx
element (I'll post the desired changes at the end of this comment)The ability to pass trackpoint extensions to the library already exists, so there shouldn't be anything else needed there. When using the library, though, you should update your code to pass course
and speed
as extensions instead.
GPX schemas
The following namespace/schema attributes should be set on the opening <gpx>
tag as follows:
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 http://www.garmin.com/xmlschemas/TrackPointExtensionv2.xsd"
Would you like to open a PR implementing these changes? If not, I'll take care of them when I have a chance.
Actually, since the course
and speed
elements have been released, I'd consider it a breaking change to remove them, even if they aren't valid. Let's leave them for now and log a deprecation message when a user passes the courseKey
or speedKey
. The message should alert them that these elements aren't valid in GPX 1.1, that they should switch to using them as extensions instead, and that they will be removed in a future release.
Hi,
Actually, I've just noticed the current version of the lib output a GPX 1.1 file (which is latest version). This is perfectly fine and works well except for the recently added
course
field. Actually,course
is defined in GPX 1.0 spec: http://www.topografix.com/gpx_manual.asp.However, it seems to have disappeared from the GPX 1.1 spec: https://www.topografix.com/gpx/1/1/.
Not sure what is best to do here, either:
course
element in GPX 1.1 which might not be valid.course
.course
.Best,