Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2010 closed enhancement (fixed)

GPX attribute support

Reported by: tomkralidis Owned by: Even Rouault
Priority: low Milestone: 1.5.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: gpx
Cc:

Description

For GPX write support (implemented as part of #1515), each of the datatypes (wpt, trk, etc.) allow for an optional extension element, which is an xs:any type, which could result in something like:

<wpt lat="0" lon="1">
  <ele>2</ele> 
  <name>waypoint name</name>
  <cmt>waypoint comment</cmt>
  <desc>waypoint description</desc>
  <src>waypoint source</src>
  <extensions>
	<foo>bar</foo>
        <col2>b</col2>
  </extensions>
</wpt>

It would be useful to optionally allow for, upon conversion, including a feature's attributes via this mechanism (default would be off).

Change History (4)

comment:1 by Even Rouault, 16 years ago

Owner: changed from warmerdam to Even Rouault
Status: newassigned

comment:2 by tomkralidis, 16 years ago

I just did some further testing. For this to fully validate, we will need to namespace prefix any elements within the extension element. This, of course, requires that the namespace be declared in the root element of the GPX document.

So the GPX root element would need to be updated with:

xmlns:ogr="http://ogr.maptools.org/"

..and a feature would then look like:

<wpt lat="0" lon="1">
  <ele>2</ele> 
  <name>waypoint name</name>
  <cmt>waypoint comment</cmt>
  <desc>waypoint description</desc>
  <src>waypoint source</src>
  <extensions>
	<ogr:foo>bar</ogr:foo>
        <ogr:col2>b</ogr:col2>
  </extensions>
</wpt>

comment:3 by Even Rouault, 16 years ago

Resolution: fixed
Status: assignedclosed

Write support commited in r12924 and autotest updated in r12925. Working is similar to what you specified. See documentation which has been updated.

Read support of extensions could be interesting too. I might give it a try.

comment:4 by Even Rouault, 16 years ago

Read support of extensions has been commited in r12941 and autotest updated in r12942.

Note: See TracTickets for help on using tickets.