Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature id is ignored for GeoJSON output format #5207

Closed
wants to merge 7 commits into from
Closed

Feature id is ignored for GeoJSON output format #5207

wants to merge 7 commits into from

Conversation

tbonfort
Copy link
Member

@tbonfort 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
Copy link
Member

tbonfort commented Feb 26, 2016

@rouault any comments on this change ?

@rouault
Copy link
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 a commit that referenced this pull request Feb 26, 2016
* 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
Copy link
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/MapServer-documentation that referenced this pull request Feb 26, 2016
@tsauerwein
Copy link
Author

tsauerwein commented Feb 26, 2016

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants