[STATSGRASS] gmeta6() returns empty string

Roger Bivand Roger.Bivand at nhh.no
Tue Feb 27 15:07:12 EST 2007


On Tue, 27 Feb 2007, Tilmann Steinmetz wrote:

> Hi,
> 
> I am having difficulties getting the region environment settings from grass 
> into R using gmeta6() (see output below).

If your LOCATION is spearfish*, the examples should work. I am not aware 
of any reason why FreeBSD should not work normally. Do you actually need 
gmeta6(), it is pretty deprecated now? Do readVECT6() or readRAST6() work? 
It looks like a PATH/GRASSRC issue of some kind, where debugging at a 
distance is not an option. What does:

Sys.getenv("GISRC")

say?

Can you try to run gmeta6() under debug: debug(gmeta6) first, then step 
though checking values until you can see whether the LOCATION etc values 
are sane?

Roger

> 
> The installed packages are as follows:
> >
> > sessionInfo()
> R version 2.4.0 (2006-10-03)
> i386-portbld-freebsd5.4
> 
> locale:
> C
> 
> attached base packages:
> [1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
> [7] "base"
> 
> other attached packages:
> spgrass6    rgdal maptools  foreign       sp
>  "0.3-6"  "0.5-6"  "0.6-8" "0.8-18"  "0.9-8"
> > 
> 
> 
> When I start R from within the Grass (6.2.1) shell (with spearfish6 
> location) 
> I encounter the following:
> 
> > library(spgrass6)
> Loading required package: sp
> Loading required package: maptools
> Loading required package: foreign
> Loading required package: rgdal
> Geospatial Data Abstraction Library extensions to R successfully loaded
> > g.region -d
> Error: object "g.region" not found
> > gmeta6()
> ERROR: default region is invalid
>        line 11: <top: 1>
> /libexec/ld-elf.so.1: g.proj: Undefined symbol "G_gettext"
> Error in if (is.na(projstr)) uprojargs <- projstr else uprojargs <- 
> paste(unique(unlist(strsplit(projstr,  :
>         argument is of length zero
> > 
>                                   
> The problem seems to arise from an empty default region in GRASS:
> 
> > system("g.region -d")
> ERROR: default region is invalid
>        line 11: <top: 1>
> 
> > traceback()
> 2: getLocationProj()
> 1: gmeta6()
> 
>           
> I can go back to GRASS and say g.region -p which shows me the region 
> settings 
> alright and when I call g.region -d it returns an empty string. This is most 
> peculiar since I double-checked DEFAULT_WIND is there and non-empty. This 
> behaviour is the same for my own location irrespective of projection or 
> whatever. (I just reinstalled Spearfish6 to make sure its not something with 
> access permissions or such). 
> 
> I'd be most grateful for any help with this. I even tried to hardcode my 
> projection into spgrass6 in order to get this to work (unsuccessfully 
> though) 
> But I could live with that for the moment. Any hints? 
> 
> Thanks,
> Tilmann
> 
> _______________________________________________
> statsgrass mailing list
> statsgrass at grass.itc.it
> http://grass.itc.it/mailman/listinfo/statsgrass
> 

-- 
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: Roger.Bivand at nhh.no





More information about the grass-stats mailing list