Opened 13 years ago

Closed 13 years ago

#3374 closed bug (fixed)

Lose "id" field when saving vector in GeoJSON

Reported by: alexbruy Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Data Provider Version:
Keywords: vector, geojson Cc: dr, gislab, alexbruy
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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)
  1. save this layer with "Save as..." from context menu in GeojSON format
  1. 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"."

Attachments (1)

test.geojson (1.1 KB ) - added by alexbruy 13 years ago.
Sample layer

Download all attachments as: .zip

Change History (6)

by alexbruy, 13 years ago

Attachment: test.geojson added

Sample layer

comment:1 by dr, 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.

comment:2 by jef, 13 years ago

Resolution: upstream
Status: newclosed

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

comment:3 by rouault, 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

comment:4 by dr, 13 years ago

Resolution: upstream
Status: closedreopened

Problem still present in QGIS built with GDAL/OGR 1.8.0, r15107

comment:5 by jef, 13 years ago

Resolution: fixed
Status: reopenedclosed

fixed in r15108.

Note: See TracTickets for help on using tickets.