Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#7194 closed defect (fixed)

ogr2ogr does not preserve fid in geojson when specify RFC7946=YES

Reported by: jingsam Owned by: warmerdam
Priority: normal Milestone: 2.2.4
Component: default Version: 2.2.3
Severity: normal Keywords:
Cc:

Description

I tried to covert a shapefile to geojson:

ogr2ogr -f GeoJSON a.geojson a.shp -preserve_fid -lco RFC7946=YES

In converted geojson, "id" is missing.

But I use following command, everthing works as expected.

ogr2ogr -f GeoJSON a.geojson a.shp -preserve_fid

RFC7946 says:

If a Feature has a commonly used identifier, that identifier
      SHOULD be included as a member of the Feature object with the name
      "id", and the value of this member is either a JSON string or
      number.

Change History (4)

comment:1 Changed 6 months ago by Jukka Rahkonen

This issue has some connection with #6538

comment:2 Changed 6 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 41191:

GeoJSON: fix writing of id with RFC7946=YES (fixes #7194)

comment:3 Changed 6 months ago by Even Rouault

In 41192:

GeoJSON: fix writing of id with RFC7946=YES (fixes #7194)

comment:4 Changed 6 months ago by Even Rouault

Milestone: 2.2.4
Note: See TracTickets for help on using tickets.