Opened 6 years ago

Closed 6 years ago

#3575 closed enhancement (fixed)

Associate database/location/mapset with workspace file

Reported by: wenzeslaus Owned by: wenzeslaus
Priority: normal Milestone: 8.0.0
Component: Startup Version: unspecified
Keywords: workspace, location, wxGUI, startup, save, load Cc:
CPU: Unspecified Platform: All


Save the database/location/mapset in a workspace file. When workspace is loaded, it should switch it to the given database/location/mapset as with Settings > GRASS working environment > ...

Before the switch, it should check if the mapset dir exist and if it is a mapset. When that fails (data moved, using different computer, ...), offer user option to not change workspace (a "Cancel" button) or open the workspace without the change of mapset (the current behavior) or let user provide the right database/location/mapset.

Additionally, upon loading, we could check if the layers in Layer Manager exist. (But that might be solved in some other way in GUI - this information is currently not conveniently accesible - only when adding a layer and rendering.

Attachments (1)

glm_in_workspace.diff (5.4 KB ) - added by wenzeslaus 6 years ago.
Database, location, and mapset as part of workspace (saved and loaded)

Download all attachments as: .zip

Change History (4)

by wenzeslaus, 6 years ago

Attachment: glm_in_workspace.diff added

Database, location, and mapset as part of workspace (saved and loaded)

comment:1 by wenzeslaus, 6 years ago

When switch was not successful, the GUI in glm_in_workspace.diff​ asks: "Do you want to proceed with opening the workspace anyway?" with answers Yes or No. No is the same as closing the dialog.

The XML looks like (DTD included too):

    <layer_manager dim="43,52,625,628">

With the current (7.4) behavior, you could open the same workspace in multiple locations and load it successfully as long as the map names (and mapset names) were the same. Now this is only possible when you delete the session element. I used that feature once and I don't think it will be missed that much, but let me know.

Problems (related, but not unique to this, but they just might be of greater importance):

  • #3631
  • History goes to different mapset without a warning (same behavior as Settings > GRASS working environment > ...)

Unrelated: Please create the 7.8 milestone.

comment:2 by wenzeslaus, 6 years ago

Owner: changed from grass-dev@… to wenzeslaus

comment:3 by wenzeslaus, 6 years ago

Resolution: fixed
Status: newclosed

In 73348:

wxGUI: save database, location and mapset to workspace and switch it when opening it (closes #3575)

It is no longer possible to just open workspace in a different mapset
than the one where it was saved. However, when session element is not
present (deleted or older gxw file) no mapset switching is performed.
Older versions of GRASS GIS simply ignore the session element.

An error message is given when mapset does not exist and options to
proceed or not are given with some details (can be improved by
diagnostics from if moved to library).

Note: See TracTickets for help on using tickets.