[Qgis-developer] Memory data provider persistence

Even Rouault even.rouault at mines-paris.org
Thu Jul 26 13:58:23 PDT 2012


Le jeudi 26 juillet 2012 22:52:47, Chris Crook a écrit :
> Hi Even
> 
> Sorry .. lost wasn't quite correct.  The point is that my code for saving
> some users data and then reloading needs to take account of whether they
> have a field called fid or not if I want the list of fields unchanged
> after saving and reloading the data.
> 
> Either I have to record somewhere that the fid field is real (ie was in the
> original data set), and set the GML_EXPOSE_FID accordingly so that it
> appears in the reloaded data, or alternatively rename the users fields an
> a reversible way before I save the data so that none of the saved fields
> can be called fid (eg prefix all fields with "u_" for example), and set
> GML_EXPOSE_FID to NO.
> 
> At least that is my understanding of the way the driver works now?

Well, you could do it, but I think you're infliciting yourself too much pain, 
but it's up to you as you're the coder ;-) Personnaly, I'd just prevent the 
user from creating a field called "fid", saying it is a reserved name. But your 
solutions would certainly work.


More information about the Qgis-developer mailing list