Hi!,
I'm converting from shape to gpx through rgdal (I get an empty file with
gpsbabel and, according to its web, I'm not convinced that the shape format
is actually fully supported by gpsbabel).
This is what I do:
AilantMSY09 <-
readOGR(dsn="/media/TRANSCEND/MONTSENY2008/MONTSENY_GEODATA/FloraExotica2009/AilantMSY09/",layer="AilantMSY09")
OGR data source with driver: ESRI Shapefile
writeOGR(AilantMSY09,
dsn="/media/TRANSCEND/MONTSENY2008/MONTSENY_GEODATA/FloraExotica2009/AilantMSY09GPX",layer="AilantMSY09GPX",driver="GPX")
Error in writeOGR(AilantMSY09, dsn =
"/media/TRANSCEND/MONTSENY2008/MONTSENY_GEODATA/FloraExotica2009/AilantMSY09GPX",
:
GDAL Error 6: Field of name 'Comentario' is not supported in GPX schema.
Use GPX_USE_EXTENSIONS creation option to allow use of the <extensions>
element.
After reading the gdal-ogr doc, I include dataset_options:
writeOGR(AilantMSY09,
dsn="/media/TRANSCEND/MONTSENY2008/MONTSENY_GEODATA/FloraExotica2009/AilantMSY09GPX",layer="AilantMSY09GPX",driver="GPX",dataset_options="GPX_USE_EXTENSIONS=YES")
Error in writeOGR(AilantMSY09, dsn =
"/media/TRANSCEND/MONTSENY2008/MONTSENY_GEODATA/FloraExotica2009/AilantMSY09GPX",
:
GDAL Error 1: Latitude 4627933.603181 is invalid. Valid range is [-90,90].
This warning will not be issued any more
Which indicates that the user must unproject first (it seems that GPX files
only support lon,lat):
AilantMSY09WGS84LL <- spTransform(AilantMSY09, CRS("+proj=longlat
+ellps=WGS84"))
Warning message:
In spTransform(xSP, CRSobj) :
Only x- and y-coordinates are being transformed
writeOGR(AilantMSY09WGS84LL,
dsn="/media/TRANSCEND/MONTSENY2008/MONTSENY_GEODATA/FloraExotica2009/AilantMSY09GPX.gpx",layer="AilantMSY09GPX",driver="GPX",dataset_options="GPX_USE_EXTENSIONS=YES")
Once in QGIS, the points are in the right sites but the attribute table is
all NULLs