gpx-builder icon indicating copy to clipboard operation
gpx-builder copied to clipboard

Support for additional namespaces

Open jaybo opened this issue 1 year ago • 0 comments

It's not clear to me whether the GPX metadata namespaces used by this library are extensible.

Can I:

  1. Add namespaces to the GPX header?
  2. Add properties which are not part of gpxx?

For example, can I create something like:

<?xml version="1.0"?>
<gpx version="1.1" creator="OpenCPN" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://www.topografix.com/GPX/1/1" 
  xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" 
  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://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd" 
  xmlns:opencpn="http://www.opencpn.org">
  <rte>
    <name>Around Orcas</name>
    <extensions>
       <gpxx:DisplayColor>Transparent</gpxx:DisplayColor>
       <opencpn:planned_speed>6.00</opencpn:planned_speed>
        ...

Note that a major gpx parser, togeojson, is just adding support for reading files with arbitrary namespaces and it would be awesome if gpx-builder had symmetrical support. Here's the relevant pull request: https://github.com/placemark/togeojson/pull/129

jaybo avatar Nov 23 '24 01:11 jaybo