grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] Add get current mapset path and get map's mapset path functions to grass.grassdb

Open wenzeslaus opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe.

When manipulating maps on the lower "management" level (r.pack, g.compare.md5, r.checksum r.internal), paths rather than just names are needed. Now, each module author needs to come up with a custom set of helper functions.

Describe the solution you'd like

A set of these functions needs to be identified, but let's start with path to the mapset, i.e., getters for the current mapset and the mapset of a raster or vector map. These can go to the new grass.grassdb which is meant exactly for this: manipulating and interacting with the spatial database.

Describe alternatives you've considered

Obviously, lower level functions and module calls can be combined to achieve the same.

Additional context

Good example are the helper functions in code by @NikosAlexandris:

https://github.com/NikosAlexandris/r.internal/blob/master/helpers.py https://github.com/NikosAlexandris/r.internal/blob/master/grassgis.py

Yes, this module is low-level and special, but the helpers defined there seem pretty basic or core functionality. There should be an easier way of doing that.

wenzeslaus avatar Sep 11 '20 20:09 wenzeslaus