Bug report #3374

Lose "id" field when saving vector in GeoJSON

Added by Alexander Bruy about 13 years ago. Updated about 13 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13434

Description

When saving vector in GeojSON with "id" field this field is removed from output file. To reproduce:

1. open any vector in GeojSON format with "id" field (sample layer attached)

2. save this layer with "Save as..." from context menu in GeojSON format

3. Open created file and find that "id" field is removed

GeojSON specification says that "If a feature has a commonly used identifier, that identifier should be included as a member of the feature object with the name "id"."

test.geojson - Sample layer (1.13 KB) Alexander Bruy, 2010-12-29 10:03 AM

Associated revisions

Revision cf140526
Added by Jürgen Fischer about 13 years ago

fix #3374

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15108 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 0f0a9661
Added by Jürgen Fischer about 13 years ago

fix #3374

git-svn-id: http://svn.osgeo.org/qgis/trunk@15108 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by dr - about 13 years ago

Confirm. I have a lot of GeoJSON files with "id" member and it is too inconvenient to lose this property while editing file.

#2 Updated by Jürgen Fischer about 13 years ago

  • Resolution set to upstream
  • Status changed from Open to Closed

This seems to be a restriction of OGR's GeoJSON driver.

#3 Updated by Even Rouault about 13 years ago

I have just removed the limitation from the OGR GeoJSON driver ( http://trac.osgeo.org/gdal/changeset/21350 ). Will available in GDAL/OGR 1.8.0. Don't hesitate to report bugs/enhancement requests to GDAL/OGR trac when appropriate

#4 Updated by dr - about 13 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (upstream)

Problem still present in QGIS built with GDAL/OGR 1.8.0, 3cc6f3f9 (SVN r15108)

#5 Updated by Jürgen Fischer about 13 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

fixed in 0f0a9661 (SVN r15109).

Also available in: Atom PDF