Feature request #8387

Warn users when saving projects that contain memory/scratch layers

Added by Sandro Santilli about 7 years ago. Updated about 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Project Loading/Saving
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No Copied to github as #:17160

Description

When creating a layer using QuickWKT plugin, saving the project and reopening it, the layer isn't rendered on the map. You can still see its name in the layer manager, and the style in the icon of the layer manager but the data isn't there (or I can't find it).

May also have to do with not knowing the extent, I don't know for sure.
All I know is that I cannot save & reload a map that contains QuickWKT layers.

Would this be a plugin bug or a core bug ?

History

#1 Updated by Regis Haubourg about 7 years ago

Hi, use MemoryLayerSaver plugin from Chris Crook.
For 2.1, this should really be part of core..

#2 Updated by Sandro Santilli about 7 years ago

Thanks for the hint !
I agree it should be part of the core, but until then even a notice warning the user about that would be nice to have. Something like: "data in layers X and Y only exists in memory and will be lost on restart, use plugin Z to save them as part of the project". Is that possible to have in 2.0 ?

#3 Updated by Regis Haubourg about 7 years ago

some background of previously discussed features here [0]
IMHO, this feature should be enabled by default. But we need to find a way to avoid having a qgs file + a mldata file, because user often will forget or delete the second one. One proposal in the list was to change qgs format. Two options:
1 - having xml store mldata directly (like arcgis / mapinfo), but we'll have heavy project, and maybe less stable.
2 - change qgs to a container zip file, containing ggs xml + generic resources (mldat, or sqlite storing equivalent, logos, symbols... ). This is a major break ..
All this have to be largely discussed.. In my corp, I use QGIS_PLUGINPATH variable to deploy mandatory plugins (including memory layer saver), and manage registry or ini files in user clients profiles thanks to Group Policy Tools of windows. I agree this is not perfect since some user deactivate that plugin.. and loose datas..

[0]: http://osgeo-org.1560.n6.nabble.com/Memory-data-provider-persistence-td4108012.html

#4 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Open to Feedback

so seems anyway that this ticket should be closed, or the subject changed and/or make it a feature request, right?

#5 Updated by Alessandro Pasotti about 7 years ago

@Giovanni: yes, AFAIK memory layers are not persistent, they shouldn't be saved in the project's TOC.

#6 Updated by Nathan Woodrow about 7 years ago

I like having memory layers saved in the TOC. I have some project which have construction layers which I use for drawing control lines, these are done as memory layers so they clear on exit and I get a fresh copy each time.

#7 Updated by Regis Haubourg about 7 years ago

yes, except if memory layer saver plugin is loaded...

#8 Updated by Alessandro Pasotti about 7 years ago

Agreed, if the memory layers are persistent they can be saved in the TOC, if not I don't see any good reason to save them.

#9 Updated by Nathan Woodrow about 7 years ago

@Alessandro you missed my point. I still want those layers there as empty when I open the project next time. I don't want to have to create them each time and style them. They are really just empty cosmetic layers in some of my projects. If I need to persist them I will use the memory layer saver plugin, if not I just leave them to be cleared.

#10 Updated by Alessandro Pasotti about 7 years ago

  • Assignee deleted (Alessandro Pasotti)

@Nathan, don't you think that the "average user" can be confused by seeing that a memory layer is saved even it it doesn't contain any data? The original poster Sandro (who is NOT an average user) was.

Maybe I misunderstood the meaning of memory layer, I tend to consider them "temporary" layers, so I expect to loose all layers informations when I quit the project.

Of course the user should be warned about loosing data when leaves the project. He can still convert the layer into a persistant datasource and then it will be a "normal" layer.

BTW I'm not the right person to work on this "bug/feature request".

#11 Updated by Sandro Santilli about 7 years ago

I see Nathan point about wanting the emptied layers in the project. Personally I never used them as "drawing canvasses" so I missed this use case. In any case I think the user should be warned when closing a project if the data in its memory layers will be lost forever. It's the same kind of warning you get when closing without saving the project, so maybe category should be "GUI".

#12 Updated by Sandro Santilli about 6 years ago

I just got stroke by this once again, using master.
It would have been much better if I was warned at "save" time, rather than realizing the day after that what I saved was not really safe :'(

#13 Updated by Giovanni Manghi over 4 years ago

  • Tracker changed from Bug report to Feature request
  • Subject changed from Layers created by QuickWKT loose data on project save/reload to Warn users when saving projects that contain memory/scratch layers
  • Status changed from Feedback to Open

#14 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No

#15 Updated by Nyall Dawson about 2 years ago

  • Status changed from Open to Closed
  • Description updated (diff)
  • Resolution set to fixed/implemented

Fixed in master and 3.2.2

Also available in: Atom PDF