> I don't know if it would be possible for OGR - in case of a repack() -
> to create an internal map of new ids to original ids (or if it would be
> possible for people to stop using shp :P). But I really don't know the
> internals of ogr (or people) good enough to comment on the feasibility
> of such a mechanism.

One could imagine to create such a map inside the shapefile driver itself 
(could be RAM 
costly though) But I guess that after a repack people expect OGR to return 
features and 
feature ids as they would appear after a fresh new open ? And I anticipate that 
this game 
with remapping feature ids could cause issues. For example the feature iterator 
operates on 
a OGR dataset handle which is not the one of the QgsOGRProvider object, so you 
would get 
different ids for the same feature depending on which handle is used. That 
would be a 
mess...

Another solution would be to defere the compaction only at layer closing 
(that's actually the 
new behaviour of the OGR Shapefile driver in recent GDAL versions to force a 
repack at 
closing). I'm not sure why QGIS currently repacks it every time ?

Even

-- 
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

Reply via email to