[QGIS-Developer] QGIS/OGR: FeatureIds reassigned on write to data provider?
Matthias Kuhn 🌍
matthias at opengis.ch
Thu Jul 6 02:24:41 PDT 2017
On 07/06/2017 11:00 AM, Sandro Mani wrote:
>>
>> My feeling is that QgsOgrDataProvider is already complicated enough
>> with its existing tricks. I'm not sure this temporary freeze repacking
>> is a right move (how would you decide when you do it ? and I'm pretty
>> sure users will not get it, or will have issues if they start an
>> algorithm with an external tool that requires packed shapefiles)
>>
> It would be something I would call explicitly while the geometry checker
> is active, I think it is safe to assume that users don't expect that
> they can operate on the shapefile while the geometry checker is
> processing it.
If a user is not expected to work with the shapefile while the checker
runs, why is the shapefile saved (and repacked) during this time?
> It would not add much complexity to the provider, just a
> flag that repacking is frozen, and a setter to set that flag. When the
> flag is set to false, the shapefile is repacked.
I don't know if it's just me, but it seems like adding yet another level
of workaround.
I'm afraid that in the end we'll end up with more problems like
interleaved calls when multiple plugins try to set and unset this in
parallel and other unexpected consequences.
I would prefer to either go for a clean solution with stable ids on
provider side (implementation in ogr or ogr provider) or the signal
about id changes (which could also be emitted when a new feature with
negative id becomes a stored feature with a positive id).
Matthias
>
> Sandro
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
More information about the QGIS-Developer
mailing list