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
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
