[GRASSLIST:4579] Re: Querying a vector map in another mapset

SWlab swlab at cornell.edu
Tue Oct 19 19:08:53 EDT 2004


[Tuesday 19 October 2004 04:33] From Radim Blazek
> On Tuesday 19 October 2004 03:15, SWlab wrote:
> > Hello,
> > Silly question I know, but I can't seem to find the answer in manuals:
> > In Grass570, how do I query a vector map in another mapset, without
> > switching to this mapset ?
...
> You must specify a table and database. @MAPSET cannot be used
> for db tables.

So, something like
...
map=MAP
mapset=OTHERMAPSET
request="select BLAH from ${map} where CONDITION"
eval $(g.gisenv)
db.select -c dr=dbf dat="$GISDBASE/$LOCATION_NAME/${mapset}/dbf/" table=${map} 
sql="${req}"
...
appears to give satisfactory results.

Thanks a lot !

-- 
Soil & Water Laboratory
Dept. of Biological & Environmental Engineering
Cornell University
ITHACA, NY 14853
Tel: (607)255.2463




More information about the grass-user mailing list