GRASS+R: problem with gmeta() command

11 messages Options
Embed this post
Permalink
Mauricio Zambrano

GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
Hi,

I'm using GRASS 6.2.2cvs and R 2.4.1, and I'm new in the use of R.

I installed the package GRASS within R (and all the Spatial and
Machine Learning & Statistical Learning packages) without any
problems, but when I loaded the package GRASS into R (inside
GRASS-GIS) and I put the command "gmeta()", I obtained the error
message "Bad or no region for current mapset". However I can see the
limits for my region within GRASS-GIS and when I put the command
"g.region -p" within GRASS-GIS, I obtain:

projection: 1 (UTM)
zone:       -19
datum:      psad56
ellipsoid:  international
north:      6456369.99999
south:      6205510
west:       237658
east:       428666.999996
nsres:      25.00099661
ewres:      25.00117801
rows:       10034
cols:       7640
cells:      76659760

any help in how to solve this problem with "gmeta()" command will be
very valuable for me

Thanks in advance

Mauricio Zambrano B.
(University of Trento)

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Martin Wegmann

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
hello Mauricio,

I haven't tested it with GRASS 6.2.2, but isn't it gmeta6() ?

Have a look at the GRASS-R article by Roger Bivand:
http://www.osgeo.org/journal/volume1

regards, Martin

On Wednesday 25 July 2007 13:17:10 Mauricio Zambrano wrote:

> Hi,
>
> I'm using GRASS 6.2.2cvs and R 2.4.1, and I'm new in the use of R.
>
> I installed the package GRASS within R (and all the Spatial and
> Machine Learning & Statistical Learning packages) without any
> problems, but when I loaded the package GRASS into R (inside
> GRASS-GIS) and I put the command "gmeta()", I obtained the error
> message "Bad or no region for current mapset". However I can see the
> limits for my region within GRASS-GIS and when I put the command
> "g.region -p" within GRASS-GIS, I obtain:
>
> projection: 1 (UTM)
> zone:       -19
> datum:      psad56
> ellipsoid:  international
> north:      6456369.99999
> south:      6205510
> west:       237658
> east:       428666.999996
> nsres:      25.00099661
> ewres:      25.00117801
> rows:       10034
> cols:       7640
> cells:      76659760
>
> any help in how to solve this problem with "gmeta()" command will be
> very valuable for me
>
> Thanks in advance
>
> Mauricio Zambrano B.
> (University of Trento)
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass


_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Mauricio Zambrano

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
Thanks Martin,
Unfortunately, there is not gmeta6() command.
I updated Grass last Monday, when I already had done the installation of
R 2.4.1 and the previous GRASS 6.2.1.

Regards
Mauricio

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Carlos Grohmann-2

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
Mauricio, you don't use gmeta() as a command, but you use it to pass
the region information to a variable inside R, like

G <- gmeta6()

so "G" now has the info on limits, rows, cols, etc.

Carlos


On 7/25/07, Mauricio Zambrano <[hidden email]> wrote:

> Thanks Martin,
> Unfortunately, there is not gmeta6() command.
> I updated Grass last Monday, when I already had done the installation of
> R 2.4.1 and the previous GRASS 6.2.1.
>
> Regards
> Mauricio
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass
>


--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Visiting Researcher at Kingston University London - UK
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

Can't stop the signal.

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Martin Wegmann

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mauricio Zambrano
hello Mauricio,

On Wednesday 25 July 2007 13:33:49 Mauricio Zambrano wrote:
> Thanks Martin,
> Unfortunately, there is not gmeta6() command.
> I updated Grass last Monday, when I already had done the installation of
> R 2.4.1 and the previous GRASS 6.2.1.

well, I tested it using GRASS (6.3-cvs and 6.2.1) and R 2.5.1 beta (Debian
unstable repos.) and it works:

Welcome to GRASS 6.3.cvs (2007)
GRASS homepage:                          http://grass.itc.it/
This version running thru:               Bash Shell (/bin/bash)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
If required, restart the graphical user interface with: gis.m
When ready to quit enter:                exit
GRASS 6.3.cvs (spearfish60):~ > R

R version 2.5.1 beta (2007-06-17 r41981)
Copyright (C) 2007 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten.
Tippen Sie 'license()' or 'licence()' für Details dazu.

R ist ein Gemeinschaftsprojekt mit vielen Beitragenden.
Tippen Sie 'contributors()' für mehr Information und 'citation()',
um zu erfahren, wie R oder R packages in Publikationen zitiert werden können.

Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe, oder
'help.start()' für eine HTML Browserschnittstelle zur Hilfe.
Tippen Sie 'q()', um R zu verlassen.

[Vorher gesicherter Workspace wiederhergestellt]

> library(spgrass6)
Lade nötiges Paket: sp
Lade nötiges Paket: maptools
Lade nötiges Paket: foreign
Lade nötiges Paket: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded
> gmeta6()
gisdbase    /data1/grassdb
location    spearfish60
mapset      PERMANENT
rows        140
columns     190
north       4928000
south       4914000
west        590000
east        609000
nsres       100
ewres       100
projection  +proj=utm +zone=13 +a=6378206.4 +rf=294.9786982 +no_defs
+nadgrids=/usr/local/grass-6.3.cvs/etc/nad/conus +to_meter=1.0

unfortunately I cannot test it using your R version but it should work.

regards, Martin

>
> Regards
> Mauricio
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass
--
Martin Wegmann

DLR - German Aerospace Center
German Remote Sensing Data Center
@
Institute of Geography
Dept. of Remote Sensing
Remote Sensing and Biodiversity Unit
Am Hubland
97074 Würzburg
Germany

phone: +49-(0)931 - 888 4797
fax:   +49-(0)931 - 888 4961
http://www.biota-africa.org
http://www.biogis.de

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Mauricio Zambrano

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Carlos Grohmann-2
In fact the problem appears when I try to do a "G <-  gmeta()"
command, and when i tried to solve the problem i arrive to the gmeta()
command.
Mauricio

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Pierluigi De Rosa

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mauricio Zambrano
Hi,
Did you run library(spgrass6)?
If yes, you should have gmeta6()!.
Bye
Pierluigi

Alle 13:17, mercoledì 25 luglio 2007, Mauricio Zambrano ha scritto:

> Hi,
>
> I'm using GRASS 6.2.2cvs and R 2.4.1, and I'm new in the use of R.
>
> I installed the package GRASS within R (and all the Spatial and
> Machine Learning & Statistical Learning packages) without any
> problems, but when I loaded the package GRASS into R (inside
> GRASS-GIS) and I put the command "gmeta()", I obtained the error
> message "Bad or no region for current mapset". However I can see the
> limits for my region within GRASS-GIS and when I put the command
> "g.region -p" within GRASS-GIS, I obtain:
>
> projection: 1 (UTM)
> zone:       -19
> datum:      psad56
> ellipsoid:  international
> north:      6456369.99999
> south:      6205510
> west:       237658
> east:       428666.999996
> nsres:      25.00099661
> ewres:      25.00117801
> rows:       10034
> cols:       7640
> cells:      76659760
>
> any help in how to solve this problem with "gmeta()" command will be
> very valuable for me
>
> Thanks in advance
>
> Mauricio Zambrano B.
> (University of Trento)
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Mauricio Zambrano

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
In reply to this post by Martin Wegmann
Thanks a lot Martin.

The problem was in the library that I had loaded, because I had loaded
the library GRASS with the command "library(GRASS)", as is read
yesterday in the web-page :

http://www.geog.uni-hannover.de/grass/statsgrass/grass_r_interface.html#Using_GRASS_R

but now i realized thath the right instructions are int the web page:

http://www.geog.uni-hannover.de/grass/statsgrass/grass6_r_install.html

In fact, when I put "library(spgrass6)" everything was right:

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
> gmeta6()
gisdbase    /home/hzambran/GrassData/UTM/psad56_h19s
location    chile
mapset      v_region
rows        10034
columns     7640
north       6456370
south       6205510
west        237658
east        428667
nsres       25.00100
ewres       25.00118
projection  +proj=utm +south +zone=19 +a=6378388 +rf=297 +no_defs
+towgs84=-288.000,175.000,-376.000

Thanks a lot !.

Mauricio

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Roger Bivand

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
On Wed, 25 Jul 2007, Mauricio Zambrano wrote:

> Thanks a lot Martin.
>
> The problem was in the library that I had loaded, because I had loaded
> the library GRASS with the command "library(GRASS)", as is read
> yesterday in the web-page :
>
> http://www.geog.uni-hannover.de/grass/statsgrass/grass_r_interface.html#Using_GRASS_R
>
> but now i realized thath the right instructions are int the web page:
>
> http://www.geog.uni-hannover.de/grass/statsgrass/grass6_r_install.html

Exactly. Perhaps we can ask the webmaster to make the latter page the main
link, and move the current page to a less visible location? The OSGeo
Journal note gives the current status.

Roger

>
> In fact, when I put "library(spgrass6)" everything was right:
>
> 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
>>  gmeta6()
> gisdbase    /home/hzambran/GrassData/UTM/psad56_h19s
> location    chile
> mapset      v_region
> rows        10034
> columns     7640
> north       6456370
> south       6205510
> west        237658
> east        428667
> nsres       25.00100
> ewres       25.00118
> projection  +proj=utm +south +zone=19 +a=6378388 +rf=297 +no_defs
> +towgs84=-288.000,175.000,-376.000
>
> Thanks a lot !.
>
> Mauricio
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> 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: [hidden email]

_______________________________________________
statsgrass mailing list
[hidden email]
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
Markus Neteler-3

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
On Wed, Jul 25, 2007 at 02:19:59PM +0200, Roger Bivand wrote:

> On Wed, 25 Jul 2007, Mauricio Zambrano wrote:
>
>> Thanks a lot Martin.
>>
>> The problem was in the library that I had loaded, because I had loaded
>> the library GRASS with the command "library(GRASS)", as is read
>> yesterday in the web-page :
>>
>> http://www.geog.uni-hannover.de/grass/statsgrass/grass_r_interface.html#Using_GRASS_R
>>
>> but now i realized thath the right instructions are int the web page:
>>
>> http://www.geog.uni-hannover.de/grass/statsgrass/grass6_r_install.html
>
> Exactly. Perhaps we can ask the webmaster to make the latter page the main
> link, and move the current page to a less visible location?

It appears that I am this webmaster (the page states
 Written by (c) 2000-2003 Markus Neteler
). But the page
 http://www.geog.uni-hannover.de/grass/statsgrass/grass_r_interface.html#Using_GRASS_R
also clearly mentions "grass5"... And there is a link on top pointing
to the "GRASS 6" installation instructions.

I didn't have time so far to update the page to GRASS 6
(also because the R interface evolves pretty fast).

I can just remove the page if this is helpful.

> The OSGeo Journal note gives the current status.

... which is listed at:
http://www.geog.uni-hannover.de/grass/statsgrass/grass6_r_install.html

Another option is that the entire content is moved to
the GRASS Wiki. Then folks could just update it. I am
maintaining far too much documentation :)

Best,
Markus


> Roger
>
>>
>> In fact, when I put "library(spgrass6)" everything was right:
>>
>> 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
>>>  gmeta6()
>> gisdbase    /home/hzambran/GrassData/UTM/psad56_h19s
>> location    chile
>> mapset      v_region
>> rows        10034
>> columns     7640
>> north       6456370
>> south       6205510
>> west        237658
>> east        428667
>> nsres       25.00100
>> ewres       25.00118
>> projection  +proj=utm +south +zone=19 +a=6378388 +rf=297 +no_defs
>> +towgs84=-288.000,175.000,-376.000
>>
>> Thanks a lot !.
>>
>> Mauricio
>>
>> _______________________________________________
>> statsgrass mailing list
>> [hidden email]
>> 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: [hidden email]

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Markus Neteler-3

Re: GRASS+R: problem with gmeta() command

Reply Threaded More More options
Print post
Permalink
Markus Neteler wrote:
On Wed, Jul 25, 2007 at 02:19:59PM +0200, Roger Bivand wrote:
> On Wed, 25 Jul 2007, Mauricio Zambrano wrote:
>
>> Thanks a lot Martin.
>>
>> The problem was in the library that I had loaded, because I had loaded
>> the library GRASS with the command "library(GRASS)", as is read
>> yesterday in the web-page :
>>
>> http://www.geog.uni-hannover.de/grass/statsgrass/grass_r_interface.html#Using_GRASS_R
OK, the GRASS 5 stuff is moved out now to a new page and this page:

http://grass.itc.it/statsgrass/grass_r_interface.html

contains references only. It will reach the Hannover mirror within 24h.

Markus