On Fri, Oct 28, 2011 at 01:53:53PM -0300, Martin Dobias wrote: > On Fri, Oct 28, 2011 at 1:33 PM, Sandro Santilli <[email protected]> wrote: > > On Fri, Oct 28, 2011 at 12:23:24PM -0300, Martin Dobias wrote: > >> On Fri, Oct 28, 2011 at 4:15 AM, Sandro Santilli <[email protected]> wrote: > >> > Would it make sense to abstract provider-specific IDs so that the > >> > [0, N-1] range holds for everyone ? > >> > >> This is actually done within attribute table - we store feature IDs > >> for the range [0,N-1] so that we can later access the feature data by > >> row number. But that comes at an additional price: the layer has to be > >> scanned first in order to obtain the mapping and it has to be updated > >> whenever some changes to the layer are done. > >> > >> What would be the requirements of such provider-specific IDs? What to > >> do when a feature is deleted? If we recreate the mapping, some IDs > >> stored by users would change, leading to problems if the user stores > >> them as references to features. If we keep the original mapping, then > >> it may contain holes and therefore the convenient [0, N-1] range would > >> not be valid. > > > > What happens if you delete a feature from a shapefile ? > > Apparently OGR only marks the feature as deleted in DBF, other IDs are > not changed.
Note that one advantage of delegating to providers setting up a mapping is we could finally drop the requirement of an integer identifier in postgresql. There are real-world cases in which primary key is a text identifier. --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
