Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory data provider should not be saved #12547

Closed
qgib opened this issue Mar 3, 2010 · 9 comments
Closed

Memory data provider should not be saved #12547

qgib opened this issue Mar 3, 2010 · 9 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Project

Comments

@qgib
Copy link
Contributor

qgib commented Mar 3, 2010

Author Name: Chris Crook (@ccrook)
Original Redmine Issue: 2487
Affected QGIS version: master
Redmine category:project_loading/saving


Layers built with the memory data provider should not be saved to the project file, as when the file is reloaded, the data for the layers is no longer available. This means that reloading the project does not restore it to its saved state.

I think that when Quantum saves a project then it should check for in memory layers, and provide the option of saving them to a persistent provider, or removing them from the project.

Also it would good when an in memory layer is saved to a shapefile (or other persistent provider) from the legend right click menu if the layer was replaced with the saved layer. This make it much easier to make in memory layers persistent in the project. At the moment I think you need to save the layer, then load the saved version, and then remove the in memory layer.

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2011

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was changed from Version 1.7.0 to Version 1.7.4

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.7.4 to Version 1.8.0
  • version was configured as master
  • crashes_corrupts_data was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2014

Author Name: Radim Blazek (@blazek)


There are cases when saving memory layers (without data) in project is useful, for example if layer symbology has to be customized by user but layer data are always refreshed by plugin.

There are three possibilities to handle memory layers and all make sense in some situations:

  • write memory layer to project without data
  • write memory layer to project including data
  • don't write memory layer to project

It could be specified by new URI parameter but I am worried that it could be confusing for users.


  • pull_request_patch_supplied was configured as 0
  • fixed_version_id was changed from Version 2.0.0 to Future Release - Nice to have
  • assigned_to_id removed nobody

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2014

Author Name: Chris Crook (@ccrook)


Interesting point .. I'm not convinced about the last case (don't write layer to project). My feeling is that the if a user closes and reopens a project then nothing should change, certainly not without a warning. It is hard to think of a case when the user would want the layer preserved (unless they are abandoning the changes and not saving the project) - after all if they don't want the layer then they will delete it in QGIS, not expect it to magically disappear when they save the project and reopen it.

At the moment this is implemented in the (non core) Memory Layer Saver plugin, which does include the option of not saving the layer (a plugin can set a layer property to tell the memory layer saver not to save the data).

The current implementation saves the data in a portable binary stream format provided by the Qt framework in a file that sits next to the project file.

I've found the plugin actually works very well as an approach - I no longer have to think about memory layers going away. If I was going to do anything with it now my inclination would be to put it into core, and perhaps port to C++ to remove the python dependency...

@qgib
Copy link
Contributor Author

qgib commented Jan 8, 2014

Author Name: Regis Haubourg (@haubourg)


+1 with Chris, Memory Layer Saver plugin is installed in default config here and IMHO should be ported to core.
It is easy to delete layers not needed, so I vote to keep persistent memory layers. But if on project loading, memory layer appears to be empty (no data coming), we should propose to suppress them in "handle bad layers" dialog.

Anyway, having a separate file for data is confusing for users here. Other possibilities have been explored in an old thread on the list:

  • change qgs file to a zip container and hide ressources (QGS xml, + data + fonts, + svg symbols in it) > quite a big change!
  • embed some data inside qgs > easy evolution, but weakens QGS fiel stability (if datastream Output fails, QGS is lost)
  • use sqlite container instead of a zip container > discarded because of sqlite dependencies

régis

@qgib
Copy link
Contributor Author

qgib commented Jan 8, 2014

Author Name: Radim Blazek (@blazek)


regis Haubourg wrote:

It is easy to delete layers not needed, so I vote to keep persistent memory layers. But if on project loading, memory layer appears to be empty (no data coming), we should propose to suppress them in "handle bad layers" dialog.

Please keep also the possibility to don't save layer data if needed (specified by URI param?).

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0
  • regression was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2019

Author Name: Giovanni Manghi (@gioman)


End of life notice: QGIS 2.18 LTR
*
Source:*
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/


  • status_id was changed from Open to Closed
  • resolution was changed from to end of life

@qgib qgib closed this as completed Mar 9, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Project labels May 24, 2019
@qgib qgib added this to the Future Release - Nice to have milestone May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Project
Projects
None yet
Development

No branches or pull requests

1 participant