Feature id is ignored for GeoJSON output format #5207

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
3 participants
@tbonfort
Member

tbonfort commented Feb 26, 2016

I configured a GeoJSON output format using the OGR GeoJSON driver. When I specify the feature id field using "wfs_featureid" "id", the id property is not set in the output.

According to the GeoJSON specification the id should be set on the feature object:

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

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Feb 26, 2016

Member

@rouault any comments on this change ?

Member

tbonfort commented Feb 26, 2016

@rouault any comments on this change ?

@rouault

This comment has been minimized.

Show comment
Hide comment
@rouault

rouault Feb 26, 2016

Contributor

Hum, calling OGR_F_CreateFeature() with a non-default FID might not work in some circumstances. I see for example that the MapInfo driver starting with GDAL 2.0 can handle user-defined FID, but only if the FID is in the range [1, max_fid]. That is to say it can fill holes, but not extend the file. Previous versions ignored completely the FID, so that would work.
There's not a way to know if a driver will ignore completely FID (which is OK), accept any of them and use them as intended, or some others might have restrictions like explained above.

Contributor

rouault commented Feb 26, 2016

Hum, calling OGR_F_CreateFeature() with a non-default FID might not work in some circumstances. I see for example that the MapInfo driver starting with GDAL 2.0 can handle user-defined FID, but only if the FID is in the range [1, max_fid]. That is to say it can fill holes, but not extend the file. Previous versions ignored completely the FID, so that would work.
There's not a way to know if a driver will ignore completely FID (which is OK), accept any of them and use them as intended, or some others might have restrictions like explained above.

tbonfort added some commits Feb 26, 2016

tbonfort added a commit that referenced this pull request Feb 26, 2016

OGR-output: output fid if requested (#5207)
* outputformat must contain option "USE_FEATUREID=true"
* layer must have a ows_featureid metadata set

@tbonfort tbonfort added this to the 7.0.2 Release milestone Feb 26, 2016

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Feb 26, 2016

Member

rebased into branch-7-0 in 4af7028

Member

tbonfort commented Feb 26, 2016

rebased into branch-7-0 in 4af7028

@tbonfort tbonfort closed this Feb 26, 2016

tbonfort added a commit to mapserver/docs that referenced this pull request Feb 26, 2016

@tsauerwein

This comment has been minimized.

Show comment
Hide comment
@tsauerwein

tsauerwein Feb 26, 2016

Thanks! 👍

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment