[GRASS-stats] wrong values imported to R

10 messages Options
Embed this post
Permalink
Jarosław Jasiewicz

[GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
Hi:

data from Grass: (integer)

 Range of data:    min = 30  max = 31589370  

(there are more or less 14000 categories ranges as above)

imported to R:

summary(r@data$sca_mroga)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
-32770.0     60.0    150.0    532.1    330.0  32760.0

I think the problems lies in 16bit proxy .bin file during export, and we
have overflow

regards
Jarek

_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Markus Neteler

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
On Thu, Oct 16, 2008 at 9:02 PM, Jarek Jasiewicz <[hidden email]> wrote:

> Hi:
>
> data from Grass: (integer)
>
> Range of data:    min = 30  max = 31589370
> (there are more or less 14000 categories ranges as above)
>
> imported to R:
>
> summary(r@data$sca_mroga)
>   Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
> -32770.0     60.0    150.0    532.1    330.0  32760.0
>
> I think the problems lies in 16bit proxy .bin file during export, and we
> have overflow

Jarek,

if your GRASS-R interface isn't too old, please try
to add plugin=TRUE as parameter.
It should enable the new method of reading in data.

Please report if it (not) works.

Best,
Markus
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Jarosław Jasiewicz

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jarosław Jasiewicz
oh, by the way
there is simple solution: export data as float and convert them to
integer in R, I just only point out incosistency....

Jarek Jasiewicz pisze:

> Hi:
>
> data from Grass: (integer)
>
> Range of data:    min = 30  max = 31589370
> (there are more or less 14000 categories ranges as above)
>
> imported to R:
>
> summary(r@data$sca_mroga)
>    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
> -32770.0     60.0    150.0    532.1    330.0  32760.0
>
> I think the problems lies in 16bit proxy .bin file during export, and
> we have overflow
>
> regards
> Jarek
>
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Jarosław Jasiewicz

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
In reply to this post by Markus Neteler
upps...
I've just updated and....

 > r=readRAST6("sca_mroga",plugin=TRUE)

 *** caught segfault ***
address (nil), cause 'unknown'

Traceback:
 1: .Call("RGDAL_OpenDataset", as.character(filename), TRUE, PACKAGE =
"rgdal")
 2: .local(.Object, ...)
 3: initialize(value, ...)
 4: initialize(value, ...)
 5: new("GDALReadOnlyDataset", filename)
 6: GDAL.open(fname)
 7: readGDAL(fname, silent = ignore.stderr)
 8: readRAST6("sca_mroga", plugin = TRUE)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

and I have very big problem....
...
Markus Neteler pisze:

> On Thu, Oct 16, 2008 at 9:02 PM, Jarek Jasiewicz <[hidden email]> wrote:
>  
>> Hi:
>>
>> data from Grass: (integer)
>>
>> Range of data:    min = 30  max = 31589370
>> (there are more or less 14000 categories ranges as above)
>>
>> imported to R:
>>
>> summary(r@data$sca_mroga)
>>   Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
>> -32770.0     60.0    150.0    532.1    330.0  32760.0
>>
>> I think the problems lies in 16bit proxy .bin file during export, and we
>> have overflow
>>    
>
> Jarek,
>
> if your GRASS-R interface isn't too old, please try
> to add plugin=TRUE as parameter.
> It should enable the new method of reading in data.
>
> Please report if it (not) works.
>
> Best,
> Markus
>  
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
On Thu, 16 Oct 2008, Jarek Jasiewicz wrote:

> upps...
> I've just updated and....

to what? Please include sessionInfo() output and exact GRASS version, and
exact GDAL version (what you see when you load rgdal) and whether this is
the old (deprecated) or the new plugin. There are lots of things that
could go wrong, and this looks like a plugin built against a different
version of GRASS.

This problem (r.out.bin always using 16-bit integers for CELL rasters) was
discussed in a thread on R-sig-geo recently:

https://stat.ethz.ch/pipermail/r-sig-geo/2008-September/004184.html

and resolved off-list by implementing the plugin. The CVS rgdal on
sourceforge and spgrass6 on sourceforge also have a useGDAL= argument to
use a GTiff for the intermediate file, so r.out.gdal from GRASS >= 6.3.

See if gdalinfo on your GRASS raster also crashes - that would suggest a
plugin that is not synchronised with your GRASS and/or GDAL.

Hope this helps,

Roger

>
>>  r=readRAST6("sca_mroga",plugin=TRUE)
>
> *** caught segfault ***
> address (nil), cause 'unknown'
>
> Traceback:
> 1: .Call("RGDAL_OpenDataset", as.character(filename), TRUE, PACKAGE =
> "rgdal")
> 2: .local(.Object, ...)
> 3: initialize(value, ...)
> 4: initialize(value, ...)
> 5: new("GDALReadOnlyDataset", filename)
> 6: GDAL.open(fname)
> 7: readGDAL(fname, silent = ignore.stderr)
> 8: readRAST6("sca_mroga", plugin = TRUE)
>
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
>
> and I have very big problem....
> ...
> Markus Neteler pisze:
>>  On Thu, Oct 16, 2008 at 9:02 PM, Jarek Jasiewicz <[hidden email]>
>>  wrote:
>>
>> >  Hi:
>> >
>> >  data from Grass: (integer)
>> >
>> >  Range of data:    min = 30  max = 31589370
>> >  (there are more or less 14000 categories ranges as above)
>> >
>> >  imported to R:
>> >
>> >  summary(r@data$sca_mroga)
>> >    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
>> >  -32770.0     60.0    150.0    532.1    330.0  32760.0
>> >
>> >  I think the problems lies in 16bit proxy .bin file during export, and we
>> >  have overflow
>> >
>>
>>  Jarek,
>>
>>  if your GRASS-R interface isn't too old, please try
>>  to add plugin=TRUE as parameter.
>>  It should enable the new method of reading in data.
>>
>>  Please report if it (not) works.
>>
>>  Best,
>>  Markus
>>
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats
>
>

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [hidden email]

_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand
Economic Geography Section
Department of Economics
Norwegian School of Economics and Business Administration
Helleveien 30
N-5045 Bergen, Norway
Jarosław Jasiewicz

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink


Roger Bivand pisze:
> On Thu, 16 Oct 2008, Jarek Jasiewicz wrote:
>
>> upps...
>> I've just updated and....
>
> to what?

here are needed information:


sessionInfo()

....

other attached packages:
[1] spgrass6_0.5-13 rgdal_0.5-26    sp_0.9-25    
....

R version 2.7.2


> Please include sessionInfo() output and exact GRASS version, and exact
> GDAL version (what you see when you load rgdal) and whether this is
> the old (deprecated)
I use gdal 1.4.4.0 well, I cannot used 1.5.2 due to some dependiences,
If gdal version is too old, the problem is clear
> or the new plugin. There are lots of things that could go wrong, and
> this looks like a plugin built against a different version of GRASS.
>
> This problem (r.out.bin always using 16-bit integers for CELL rasters)
> was discussed in a thread on R-sig-geo recently:
>
> https://stat.ethz.ch/pipermail/r-sig-geo/2008-September/004184.html

mabye I lost it... sorry
>
> and resolved off-list by implementing the plugin. The CVS rgdal on
> sourceforge and spgrass6 on sourceforge also have a useGDAL= argument
> to use a GTiff for the intermediate file, so r.out.gdal from GRASS >=
> 6.3.
>
> See if gdalinfo on your GRASS raster also crashes - that would suggest
> a plugin that is not synchronised with your GRASS and/or GDAL.
well, crashes...
gdalinfo: symbol lookup error: /usr/lib/gdalplugins/gdal_GRASS.so:
undefined symbol: G_no_gisinit

....

well, problem isn't so big I just lost discussion you pointed above


tanks for info
Jarek
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Markus Neteler

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
On Thu, Oct 16, 2008 at 10:14 PM, Jarek Jasiewicz <[hidden email]> wrote:
...
> gdalinfo: symbol lookup error: /usr/lib/gdalplugins/gdal_GRASS.so: undefined
> symbol: G_no_gisinit

I feel that GDAL and the GRASS-GDAL plugin are out of sync on your machine.

best,
Markus
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
giohappy

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
The same happened to me with the last devel branches. I had to compile
gdal end gdal-grass plugin by myself (not so hard...).

Giovanni

2008/10/16 Markus Neteler <[hidden email]>:

> On Thu, Oct 16, 2008 at 10:14 PM, Jarek Jasiewicz <[hidden email]> wrote:
> ...
>> gdalinfo: symbol lookup error: /usr/lib/gdalplugins/gdal_GRASS.so: undefined
>> symbol: G_no_gisinit
>
> I feel that GDAL and the GRASS-GDAL plugin are out of sync on your machine.
>
> best,
> Markus
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats
>
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Markus Neteler

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
On Thu, Oct 16, 2008 at 11:10 PM, G. Allegri <[hidden email]> wrote:
> The same happened to me with the last devel branches. I had to compile
> gdal end gdal-grass plugin by myself (not so hard...).

Documented here:
http://grass.osgeo.org/wiki/Compile_and_install_GRASS_and_QGIS_with_GDAL/OGR_Plugin

Markus
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Markus Neteler

Re: [GRASS-stats] wrong values imported to R

Reply Threaded More More options
Print post
Permalink
On Fri, Oct 17, 2008 at 7:53 PM, Jarek Jasiewicz <[hidden email]> wrote:
> In spite of it, spgrass6 call plugin of grass6.2.2 instead of 6.4

It won't work with GRASS 6.2 since we fixed a couple of problems
in later versions only. Also, the required C version of r.out.gdal doesn't
exist in 6.2.x AFAIR.

Markus
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats