[gdal-dev] Writing GPX Files with multiple Extensions

Pouliot, Christopher (MNIT) Christopher.Pouliot at state.mn.us
Thu Nov 7 12:15:04 PST 2013


Attached is a sample from downloading one Waypoint and a track using GPSBabel.  I'll look into the GPSBabel driver.  I don't have much time to devote to this so hope to find a relatively quick solution.

Thanks again!

Chris


-----Original Message-----
From: Even Rouault [mailto:even.rouault at mines-paris.org] 
Sent: Thursday, November 07, 2013 1:47 PM
To: Pouliot, Christopher (MNIT)
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Writing GPX Files with multiple Extensions

Le jeudi 07 novembre 2013 20:41:48, Pouliot, Christopher (MNIT) a écrit :
> Even,
> 
> Thanks for the response!  I see that GPSBabel uses GDAL

Really ? OGR has a GPSBabel driver, but I didn't know that the reversed way existed.

> and writes out
> multiple extensions.  I'll check with them to see how they are doing it.

GPSBabel has its own GPX reader/writer. It wouldn't be difficult to extend the OGR GPX driver to implement what I mentionned below. Alternatively you could generate the GPX yourself. It is quite easy.

> 
> Chris
> 
> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at mines-paris.org]
> Sent: Thursday, November 07, 2013 1:22 PM
> To: gdal-dev at lists.osgeo.org
> Cc: Pouliot, Christopher (MNIT)
> Subject: Re: [gdal-dev] Writing GPX Files with multiple Extensions
> 
> Le jeudi 07 novembre 2013 16:51:35, Pouliot, Christopher (MNIT) a écrit :
> > Hello All,
> > 
> > I am currently using GDAL 1.9 and I'm writing out GPX files for 
> > uploading onto Garmin units.  Garmin has many different GPX 
> > extensions (gpxx, gpxtpx, gpxtrx, etc) for defining extra attributes 
> > for their GPS data.  I am wondering how I would specify these 
> > multiple extensions in my code? Currently, I am defining a single extension as shown below:
> > 
> > ds = drv.CreateDataSource(outputFilePath, new string[] { 
> > "GPX_USE_EXTENSIONS=YES","GPX_EXTENSIONS_NS=gpxx","GPX_EXTENSIONS_NS
> > _U RL=h ttp://www.garmin.com/xmlschemas/GpxExtensions/v3"});}
> > 
> > How would I go about setting more namespaces (gpxtpx, gpxtrx, ...)?
> 
> This is not possible currently. Would require an enhancement in the 
> driver, like acception a comma separated list of values for 
> GPX_EXTENSIONS_NS and GPX_EXTENSIONS_NS_URL
> 
> > And
> > then how would I specify that an attribute belongs in a particular 
> > extension?
> 
> It could detect it by the name of attribute. For example, gpxx_foo, 
> gpxtpx_bar, gpxtrx_baz
> 
> > Thanks,
> > 
> > Chris
> > 
> > Chris Pouliot  |  GIS Application Developer MN.IT Services @ 
> > Department of Natural Resources
> > (651) 259-5491 (w)  |  christopher.pouliot at state.mn.us 
> > [cid:image002.jpg at 01CEDB9E.F20C9670]<http://www.mn.gov/oet>  Information
> > Technology for Minnesota Government   |
> > mn.gov/oet<http://www.mn.gov/oet>
> 
> --
> Geospatial professional services
> http://even.rouault.free.fr/services.html

--
Geospatial professional services
http://even.rouault.free.fr/services.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: babel.gpx
Type: application/octet-stream
Size: 2119 bytes
Desc: babel.gpx
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131107/dbf9648b/attachment.obj>


More information about the gdal-dev mailing list