<div dir="ltr">Hey Chris,<div><br></div><div style>As we are now in a feature freeze it might be a bit late to bring it in however I would like to see it as a core part of QGIS, not as a plugin, but as something that just happens when the user saves the project. The New Memory Layer plugin should also be moved into core of the program as it's great for creating quick one of layers.</div>
<div style><br></div><div style>- Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 3, 2013 at 9:10 AM, Chris Crook <span dir="ltr"><<a href="mailto:ccrook@linz.govt.nz" target="_blank">ccrook@linz.govt.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-NZ" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi All<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m wondering if there would be any support for moving the memory layer saver plugin to core.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">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).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">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.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The plugin will need some rework for QGIS version 2 I suspect, in terms of iterating through the layer. But this should be minor.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The QDataStream version of the plugin is at <a href="http://plugins.qgis.org/plugins/MemoryLayerSaver/" target="_blank">http://plugins.qgis.org/plugins/MemoryLayerSaver/</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Cheers<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Chris<u></u><u></u></span></p>
</div>
<br>
<hr>
<font face="Verdana" color="Black">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 <a href="mailto:info@linz.govt.nz" target="_blank">info@linz.govt.nz</a>) 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.<br>
</font>
</div>
<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div><br></div>