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

Even Rouault even.rouault at spatialys.com
Tue Oct 10 03:08:19 PDT 2017


On mardi 10 octobre 2017 12:02:00 CEST G. Allegri wrote:
> Hi Even,
> I thought file writing path went through the OGR provider, while it simply
> uses QgsFileWriter.
> Is there any reason not having OGR_F_SetFID be used? If there isn't any
> side effect could we use it by default?

Apparently
https://github.com/qgis/QGIS/commit/891e66523fdf21283ca15533684a57dd8c27f955
was done to avoid issues with DXF output (AFAIR, some ids are reserved by the DXF template 
used, and if you use them for features you write, readers will be confused).

But besides this bug, for drivers that support assigning a FID on creation, this will change 
their output. And I can imagine there are situations where you want a "clean" sequence of 
ids, and others where you really need to preserve the source fids. So it would make sense to 
have an option to control whether you set or not the FID before creation.

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/61bf0f2a/attachment.html>


More information about the QGIS-Developer mailing list