[GRASS-dev] [GRASS GIS] #3575: Associate database/location/mapset with workspace file

#3575: Associate database/location/mapset with workspace file
-------------------------------------------------+-------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 8.0.0
Component: Startup | Version: unspecified
Keywords: workspace, location, wxGUI, | CPU: Unspecified
  startup, save, load |
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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3575&gt;
GRASS GIS <https://grass.osgeo.org>

#3575: Associate database/location/mapset with workspace file
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: | Status: new
  enhancement |
  Priority: normal | Milestone: 8.0.0
Component: Startup | Version: unspecified
Resolution: | Keywords: workspace, location, wxGUI,
       CPU: | startup, save, load
  Unspecified | Platform: All
-------------------------+-------------------------------------------------
Changes (by wenzeslaus):

* Attachment "glm_in_workspace.diff" added.

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3575&gt;
GRASS GIS <https://grass.osgeo.org>

#3575: Associate database/location/mapset with workspace file
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: | Status: new
  enhancement |
  Priority: normal | Milestone: 8.0.0
Component: Startup | Version: unspecified
Resolution: | Keywords: workspace, location, wxGUI,
       CPU: | startup, save, load
  Unspecified | Platform: All
-------------------------+-------------------------------------------------

Comment (by wenzeslaus):

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):

{{{
<gxw>
     <session>
         <database>/home/vpetras/grassdata</database>
         <location>spearfish</location>
         <mapset>user1</mapset>
     </session>
     <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.''

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3575#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3575: Associate database/location/mapset with workspace file
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: wenzeslaus
      Type: | Status: new
  enhancement |
  Priority: normal | Milestone: 8.0.0
Component: Startup | Version: unspecified
Resolution: | Keywords: workspace, location, wxGUI,
       CPU: | startup, save, load
  Unspecified | Platform: All
-------------------------+-------------------------------------------------
Changes (by wenzeslaus):

* owner: grass-dev@… => wenzeslaus

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3575#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3575: Associate database/location/mapset with workspace file
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: wenzeslaus
      Type: | Status: closed
  enhancement |
  Priority: normal | Milestone: 8.0.0
Component: Startup | Version: unspecified
Resolution: fixed | Keywords: workspace, location, wxGUI,
       CPU: | startup, save, load
  Unspecified | Platform: All
-------------------------+-------------------------------------------------
Changes (by wenzeslaus):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"73348" 73348]:
{{{
#!CommitTicketReference repository="" revision="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 grass.py if moved to library).
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3575#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>