[GRASS-stats] readRAST and mapset consistency with gdal plugin

Rainer M Krug Rainer at krugs.de
Thu Jun 18 09:33:48 PDT 2015


Ahmadou Dicko <dicko.ahmadou at gmail.com> writes:

> Dear all,
>
> I'm testing the GRASS GDAL pluging using the rgrass7 package and I
> have some issues with the readRAST function with the mapset argument.
> Inside readRAST we have  a .read_rast_plugin core function to read the
> raster using the plugin that supposed to share the same argument as
> readRAST.
>
> However, inside .read_rast_plugin, the mapset argument is always NULL,
> since we have a mapset argument in readRAST should not the these two
> arguments be the same.


My fault - I forgot the mapset.

I just uploaded a fix - Thanks Ahmadou - exactly as you suggested.

Cheers,

Rainer


>
> To illustrate what I mean
>
> This what we have:
> readRAST <- function(..., mapset = NULL, ...) {
>   ....
>   .read_rast_plugin(..., mapset = NULL, ...)
> }
>
>
> This is what I think we should have:
> readRAST <- function(..., mapset = NULL, ...) {
>   ....
>   .read_rast_plugin(..., mapset = mapset, ...)
> }
>
>
> Here are the steps to reproduce the bug:
> I used the nc_basic_spm_grass7 location and user1 mapset.
>
> In GRASS
> g.copy raster=elevation at PERMANENT,elevation
> g.region raster=elevation
>
> Then we launch R within the GRASS session
>
> library(rgrass7)
> r <- readRAST("elevation", plugin = TRUE, mapset = "user1")
> /home/ahmadou/GIS/GRASS/grassdata/nc_basic_spm_grass7/user1/cellhd/elevation
> has GDAL driver GRASS
> and has 1350 rows and 1500 columns
> Warning message:
> statistics not supported by this driver
>
> ### Still have 'user1' in metadata
> r <- readRAST("elevation", plugin = TRUE, mapset = "PERMANENT")
> /home/ahmadou/GIS/GRASS/grassdata/nc_basic_spm_grass7/user1/cellhd/elevation
> has GDAL driver GRASS
> and has 1350 rows and 1500 columns
> Warning message:
> statistics not supported by this driver
>
> With the corrected version we have:
>
> ### Now we have 'PERMANENT' in the path (metadata)
> r <- readRAST2("elevation", plugin = TRUE, mapset = "PERMANENT")
> /home/ahmadou/GIS/GRASS/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation
> has GDAL driver GRASS
> and has 1350 rows and 1500 columns
> Warning message:
> statistics not supported by this driver
>
> I don't have commit right, should I provide a diff file ?
>
> Best,

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug

PGP: 0x0F52F982
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-stats/attachments/20150618/373fab65/attachment.pgp>


More information about the grass-stats mailing list