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

G. Allegri giohappy at gmail.com
Tue Oct 10 05:03:06 PDT 2017


Thanks Even.

2017-10-10 13:08 GMT+02:00 Even Rouault <even.rouault at spatialys.com>:

> On mardi 10 octobre 2017 12:58:36 CEST G. Allegri wrote:
>
> > Well, you almost convinced me, but for what I can see from the ogr2ogr
>
> > docs, if -preserve-fid is not set the output driver is expected to create
>
> > the FIDs [1]. This means that if a a FID is not set (and not preserved)
> the
>
> > GeoJSON output driver should write it.
>
>
>
> Ah the doc of -preserve_fid is not completely accurate. In the specific
> case of GeoJSON, it doesn't need to create a FID if none is provided to it,
> so it doesn't create one. But for drivers like shapefile, PG, etc... the
> output driver needs to assign a FID to the new feature.
>
>
>
> I've just changed the doc to:
>
> "Use the FID of the source features instead ofletting the output driver to
> automatically assign a new one (when it needs to assign a FID. Some
> formats, like GeoJSON, have optional FID)"
>
>
>
> --
>
> 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/7dc3648b/attachment.html>


More information about the QGIS-Developer mailing list