Ticket #348 (closed defect: worksforme)
must be owner of location/mapset to access GRASS raster
|Reported by:||mdoggett@…||Owned by:||mloskot|
Description (last modified by mloskot) (diff)
The problem is in file ownership and GRASS location/mapset settings (For the case when a .grassrc5 doesn't exist) GDAL will only access a GRASS dataset when the user OWNS the dataset (or at least the mapset that contains it).
Group or other read permissions don't count, you MUST own the dataset to be able to access it.
e.g. User A owns PERMANENT can access the raster 'dem' with:
User B tries it:
ERROR 4: `/home/mistral/forages/data/grass/us/PERMANENT/cellhd/dem' not recognised as a supported file format. GDALOpen failed - 4 `/home/mistral/forages/data/grass/prc/PERMANENT/cellhd/dem' not recognised as a supported file format.
You can get around this limitation by providing a .grassrc5 file in the user's home directory that points to the location and mapset of the datasets you want to access. So now if user B has a .grassrc5 file with us/PERMANENT as the LOCATION/MAPSET, user B then will be able to access the raster 'dem' using GDAL.
In my way of thinking, since GDAL is read-only for GRASS datasets, why impose the limitation that the user must OWN the data to simply read it?
Also, you shouldn't have to REQUIRE a .grassrc5 file be present in the HOME directory if you want to specify the complete path to the GRASS raster file (makes it more troublesome for a dynamic web app).