[QGIS-Developer] set and export FID with OGR provider

Even Rouault even.rouault at spatialys.com
Tue Oct 10 03:26:37 PDT 2017


On mardi 10 octobre 2017 12:20:48 CEST G. Allegri wrote:
> On second thought maybe this flag could be a creation option os the OGR
> GeoJSON driver. The driver writes the "id" property only if a FID is set.
> Maybe a SET_ID flag (or something more miningful) could force the driver
> creating the "id" with a sequential integer even if a FID is not set for
> the features.
> What's your opinion? In case I will open a ticket for OGR.

I don't think this control should be done at the driver level. I'd say that if the GeoJSON 
CreateFeature() API is called with a feature with a FID set, it should write it.
The logic to decide whether you create a new sequence, re-use source FID or don't set a 
FID at all belongs to the upper layers (in that case, QGIS. or ogr2ogr which has -
preserve_fid or -unsetFid flags).

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171010/91752178/attachment.html>


More information about the QGIS-Developer mailing list