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

Hamish hamish_b at yahoo.com
Thu Apr 17 00:16:36 EDT 2008


> > Dylan Beaudette pisze:
> > > Is this the normal behavior? i.e. I can "use" raster and vector
> > > files across mapsets, but why not vector attributes?
Maciek:
> > 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.

Dylan:
> 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?


you could try to use v.db.connect on the original vector and hard code
the database= there instead of using the variables. That would mean you
couldn't easily move/backup the map then and it would be tied to that
dir. Also I'm not sure it would work, but it might.


Hamish



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



More information about the grass-dev mailing list