[Qgis-developer] Memory layer saver plugin to core?

Chris Crook ccrook at linz.govt.nz
Tue Apr 2 16:10:50 PDT 2013


Hi All

I'm wondering if there would be any support for moving the memory layer saver plugin to core.

At the moment many plugins create scratch memory layers, and the current default behaviour of QGis is to silently drop the data when the project is saved - when the user reloads the project the layers are still there, but the data is not (for example if they have created contours).  This seems a really bad user experience.

The memory layer saver plugin when installed simply saves the layers with the project, and automatically reloads them (at least for users with python installed, who are most likely to create memory layers).

I think that it is a fundamental user expectation that when they see the same thing as when they saved it that this should at the very least be part of the core distribution, and possibly enabled by default.

I have recently updated this to use a Qt binary stream (QDataStream) for all memory layers as a single file, rather than using GML format.  This may not appeal to some users, but it avoids problems that happened with passing the data through the OGR mapping, which was creating problems in restoring the attributes correctly (due to handling of the fid).  The Qt stream is a simple and efficient mechanism to avoid these issues.  An alternative would be to create an SQLite database, but that requires much more work, and will still end up with something which is not necessarily useful outside QGIS.

The plugin will need some rework for QGIS version 2 I suspect, in terms of iterating through the layer. But this should be minor.

The QDataStream version of the plugin is at  http://plugins.qgis.org/plugins/MemoryLayerSaver/

Cheers
Chris

________________________________
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130403/be5c4265/attachment-0001.html>


More information about the Qgis-developer mailing list