Selon Pedro Machado Monteiro <[email protected]>: > Hello: > > > > Iâm trying to export a shapefile to a GPX file, with GDAL 1.9.0 ogr2ogr. > > > > From the shapefile attribute table, I want to export some fields to the > corresponding tags of the GPX file, and the remaining (or all) fields to > the <extensions> tag > > > > That doesânt seem to work: when I use the *âsql* option SELECT AS (ex: to > export the field âLinhaâ from the shape attribute table, to the GPX > <name>), it seems that the *-dsco* option USE_GPX_EXTENSIONS=YES is > disabled, because the result always lacks the <extensions> tag, with the > remaining (or all) fields. > > > But http://gdal.org/drv_gpx.html says that If GPX_USE_EXTENSIONS=YES is > specified, extra fields will be written inside the*<extensions>* tag. > > > > Here is the kind of statement: > > > > *ogr2ogr* *-f* GPX *-dsco* GPX_USE_EXTENSIONS=YES exportfile.gpx > sourcefile.shp > *-sql* *"*SELECT Linha AS name FROM sourcefile*"*
Pedro, The above SQL statement only selects one single field from the shapefile, so it is expected that the resulting GPX will have only the standard <name> attribute. You must explicitely list other fields in the SELECT clause if you want them to go in <extensions>. If you want to be quick and don't mind the Linha field to be in the extensions as well in addition to <name>, you can just do "SELECT Linha AS name, * FROM sourcefile" Best regards, Even -- Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
