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

Ahmadou Dicko dicko.ahmadou at gmail.com
Thu Jun 18 11:08:38 PDT 2015


Thanks Rainer, everything works as expected.

Cheers,

On Thu, Jun 18, 2015 at 4:33 PM, Rainer M Krug <Rainer at krugs.de> wrote:
> 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



-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated
Land Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.dicko at ucad.edu.sn
twitter : @dickoah
github : github/dickoa
tel : +221 33 827 55 16
portable: +221 77 123 81 69


More information about the grass-stats mailing list