[GRASS-dev] db commands on vectors stored in another mapset

Dylan Beaudette dylan.beaudette at gmail.com
Wed Apr 16 13:59:26 EDT 2008


On Wednesday 16 April 2008, Maciej Sieczka wrote:
> Dylan Beaudette pisze:
> > Is this the normal behavior? i.e. I can "use" raster and vector files
> > across mapsets, but why not vector attributes?
>
> Because you are using DBF driver and your database is in:
>
> $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
>
> (check with db.connect -p). This results in a different path from mapset
> to mapset. I guess this is a feature.
>
> In order to use db.select cross-mapset with DBF driver you need to set
> database= explicitely.
>
> Maciek

Thanks Maciek.

I see that the following works as expected:

# not logged into the 'PERMANENT' mapset
db.select bugsites database=/home/dylan/grass/spearfish60/PERMANENT/dbf/


I suppose that altering the behavior of the db.* commands would be dangerous, 
and really should respect the current mapset's database connection. 

How hard would it be to parse the @mapset, remove it in the actual SQL, but 
pass it into the 'database' selection? Or more importantly, is there any way 
to make typing 'database=/home/dylan/grass/spearfish60/PERMANENT/dbf/' any 
less painfull?

Cheers,

Dylan


-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341


More information about the grass-dev mailing list