[Qgis-developer] Memory data provider persistence

Chris Crook ccrook at linz.govt.nz
Mon Dec 6 14:12:18 EST 2010


Hi Barry et al

Good point about a plugin implementation .. I hadn't thought of that obvious option - definitely one to follow up on.  It might still need a few tweaks in terms of Qgis.  The QgisInterface has a projectRead() signal that could be used to trigger reloading the data, but I don't see a projectSaved() signal to trigger writing.  Easy to add that though, and probably generally useful.

Do you know of an alternative signal I could use to trigger writing? 

Given that there is a signal to hook in to this is, as you say, a piece of cake.  I'm kicking myself for not having thought of this months ago!!

In terms of file location my preference would be something directly related to the project file .. That is obviously easy.  And shapefile is not my choice, just because of the messy bunch of files it creates and having so many of them and because the DBF format is limiting and pretty scungy!  But that is personal preference I guess.

Brilliant .. 

Cheers
Chris



-----Original Message-----
From: b.rowlingson at googlemail.com [mailto:b.rowlingson at googlemail.com] On Behalf Of Barry Rowlingson
Sent: Tuesday, 7 December 2010 7:40 a.m.
To: Chris Crook
Cc: Martin Dobias; qgis-developer at lists.osgeo.org
Subject: Re: [Qgis-developer] Memory data provider persistence

On Mon, Dec 6, 2010 at 6:05 PM, Chris Crook <ccrook at linz.govt.nz> wrote:
> Hi All
>
> Fair comment I guess.  In fact Barry's suggestion is pretty much back at my original ticket on this issue.  This had two components, one was the warning about memory provider layers, and the other was making it easier to save them (or more accurately, to replace the memory layer with the saved layer in the project).  Ideally the legend would also have some sort of visual clue as to which layers were not yet saved.
>
> Nonetheless I do think there is value in having the memory provided data saved more or less transparently to the user.  For example the contour plugin builds its contours in a memory layer.  I don't want them to disappear when I save and reopen the project.  Yet sometimes  I want to save the project quickly without having to decide where and in what format I want bits of it saved.  For example when I have to exit the train on the way to work!!  I just want to be able to save the project and then start up later and carry on working.

 So as long as the saving of memory layers is quick, you're happy? So what about if it happened transparently that memory layers were saved to /tmp/something in Shapefile format, and the location and format were configurable from a settings dialog and saved (either per-project or in user settings), and that .qgs files added the converted layers into the project? Sounds like a piece of cake, meets the 'train suddenly arriving at station' criterion (although in this country you get an extra twenty minutes past the expected arrival time with trains), and could possibly be implemented as a plugin. You may never lose memory data provider data again...

 I'm not sure serializing the object to binary is a good idea, you will one day want to load it into another GIS... Standards are a good thing, that's why there are so many of them.


Barry
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject to legal privilege. 
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________


More information about the Qgis-developer mailing list