[R-sig-Geo] Problem with gdalOGR: GPX format

Agustin Lobo alobolistas at gmail.com
Mon Jul 6 09:48:19 CEST 2009


I'm trying to write an SpatialPointsDataFrame object as
GPX. I do:
> 
writeOGR(wpcast1SPDF,dsn="/media/Transcend/MONTSENY2008/MONTSENY_UAV2/GPX",layer="wpcast1lonlat",driver="GPX")
Error in writeOGR(wpcast1SPDF, dsn =
"/media/Transcend/MONTSENY2008/MONTSENY_UAV2/GPX",  :

	GDAL Error 6: Field of name 'coords.x1' is not supported in GPX schema.
Use GPX_USE_EXTENSIONS creation option to allow use of the <extensions>
element.

Which would be valid Field of name 'coords.x1'? I've tried reading
http://www.topografix.com/GPX/1/1/
but it's really hard to understand.

I've also tried to add layer_options="GPX_USE_EXTENSIONS=YES" according to
http://www.gdal.org/ogr/drv_gpx.html
"GPX_USE_EXTENSIONS: By default, the GPX driver will discard attribute
fields that do not match the GPX XML definition (name, cmt, etc...).
If GPX_USE_EXTENSIONS=YES is specified, extra fields will be written
inside the<extensions> tag."

but still get the same error (and, ultimately, I'm not sure this would
actually solve the problem, the best would be using the "valid Field of
name coords.x1"):

writeOGR(wpcast1SPDF,dsn="/media/Transcend/MONTSENY2008/MONTSENY_UAV2/wpscastlonlat.gpx",layer="wpcast1lonlat",driver="GPX",layer_options="GPX_USE_EXTENSIONS=YES")
Error in writeOGR(wpcast1SPDF, dsn =
"/media/Transcend/MONTSENY2008/MONTSENY_UAV2/wpscastlonlat.gpx",  :

	GDAL Error 6: Field of name 'coords.x1' is not supported in GPX schema.
Use GPX_USE_EXTENSIONS creation option to allow use of the <extensions>
element.
>

Any help appreciated,
Agus



More information about the R-sig-Geo mailing list