[Qgis-developer] Memory data provider persistence

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


Le jeudi 26 juillet 2012 21:41:57, Chris Crook a écrit :
> Hi Even
> 
> Thanks for the suggestion and code examples - very helpful. I haven't
> followed up on this yet partly because this has prompted me to look at
> other storage formats for the data (something I'd been putting off).
> 
> If I understand the GML driver documentation properly then I would have to
> manage the possibility of the user having a field called FID, as after
> I've saved the data, then reloaded with GMS_EXPOSE_FID set to NO, that
> field will be lost?

If a user creates a 'fid' field, then that one will be used to set the fid 
attribute of the element. It will not be "lost" strictly speaking, but indeed 
if GML_EXPOSE_FID is set to NO, then it will not be visible.

> As you suggest, renaming the fields before saving and
> then after reloading would fix handle this.

Not sure to understand you here : are you speaking about the mechanism for 
saving the old value of GML_EXPOSE_FID, setting GML_EXPOSE_FID=OLD, calling 
OGROpen() and restoring the original value of GML_EXPOSE_FID ? If so, this 
will not change anything about the behaviour with a user field called 'fid'.

The intention here was not to interfere with other parts of QGIS that might 
manipulate GML files. For example, if a user opens a GML file through "Add 
Vector Layer", he might want to see the fid reported.



More information about the Qgis-developer mailing list