[GRASS-dev] How to get data from a location where the user does not own any mapset?
Glynn Clements
glynn at gclements.plus.com
Thu Oct 1 03:07:22 PDT 2015
Radim Blazek wrote:
> >> Perfect, that is what I need. Why GRASS_SKIP_MAPSET_OWNER_CHECK should
> >> not be set by programs for read only access?
> >
> > If you only need to read a mapset, you shouldn't need to make it the
> > current mapset, nor should you try.
>
> The mapset I need to read from does not have to be current, but one
> mapset must be current and G_gisinit() checks if user is owner of
> current mapset. If the user is not owner of any mapset in the
> location, what can be set as current mapset?
Use a mapset which the user does own, or create one, and use
G_switch_env() to select a different location and mapset temporarily.
Be sure to switch it back before performing any operation which may
write to the "current" mapset (modifying WIND/VAR, creating maps, or
creating temporary files).
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list