Bug report #16811

Since 2.18.10 "save as GPX" not recognising GPX_USE_EXTENSIONS setting

Added by Sandy Pyke over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
Affected QGIS version:2.18.11 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24710

Description

I've been exporting my vector layers to GPX format succesfully until 2.18.10, now I get the following error when trying to do so:

Export to vector file failed.
Error: creation of field fid failed (OGR error: Field of name 'fid' is not supported in GPX schema. Use GPX_USE_EXTENSIONS creation option to allow use of the <extensions> element.)

I've got a few non-GPX columns in my attributes tables (fid, fstatus, etc) that are not natively supported by the GPX format, so I make sure to set the GPX_USE_EXTENSIONS field in the Save As gui to YES. This was working fine in versions 2.18.9 and below with the non-GPX fields get saved to an <extensions> section with an <ogr:...> prefix. But with 2.18.10 this operation fails.

Steps to reproduce:

- Add a new vector layer from a GPX flie containing extension data (see attached)
- Right click on the newly added layer and select "Save As"
- Select GPX as the output format and assign a file name to the output
- Assure the GPX_USE_EXTENSIONS field is set to YES
- Click OK to save the file

Expected behavior : the layer data is save to a GPX file
Observed behavior : An error dialog appears and the created GPX file contains no geometry

sample.gpx - GPX file with extension data (27.4 KB) Sandy Pyke, 2017-07-07 04:06 PM

Associated revisions

Revision fc7ac832
Added by Jürgen Fischer over 7 years ago

vector file writer: reapply integer options (accidentally removed in 9a6235db; fixes #16811, #16819)

Revision cb088a2a
Added by Jürgen Fischer over 7 years ago

vector layer save as: adjust our to OGR's defaults
  • GPX_USE_EXTENSIONS default is false not true (fixes #16811)
  • CSV GEOMETRY is none not AS_XY (fixes #16819)

(followup 9a6235db)

Revision 601e3735
Added by Jürgen Fischer over 7 years ago

vector layer save as: adjust our to OGR's defaults
  • GPX_USE_EXTENSIONS default is false not true (fixes #16811)
  • CSV GEOMETRY is none not AS_XY (fixes #16819)

(backported from commit cb088a2a0cb6224600504574f749348cc4df8bf2)

History

#1 Updated by Sandy Pyke over 7 years ago

Save as GPX, not GPS...

#2 Updated by Giovanni Manghi over 7 years ago

  • Operating System deleted (Windows 10)
  • Priority changed from Normal to High
  • Assignee deleted (Victor Olaya)
  • Category changed from Processing/GUI to Vectors
  • Subject changed from Save as GPS not recognising GPX_USE_EXTENSIONS setting to Since 2.18.10 "save as GPX" not recognising GPX_USE_EXTENSIONS setting

#3 Updated by Jürgen Fischer over 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#4 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Closed to Open

The above fix is for master, but 2.18.10/11 are still affected.

#5 Updated by Giovanni Manghi over 7 years ago

  • Affected QGIS version changed from 2.18.10 to 2.18.11

#6 Updated by Jürgen Fischer over 7 years ago

  • Status changed from Open to Closed

#7 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF