[GRASS-user] Best way to reconnect tables in grass' databse

Glynn Clements glynn at gclements.plus.com
Wed Nov 26 15:14:14 EST 2008


Nikos Alexandris wrote:

> I think I have questioned something similar but not quite the same
> several months ago.
> 
> I moved the "grassdb" foldes (with all of its locations of course) in
> another directory and thus, the absolute database path has been changed.
> 
> I need to re-connect all database tables. I think I am doing the right
> thing by trying to use the v.db.reconnect.all module. However, I am a
> bit confused about the appropriate format to be used for the
> "old_database", "new_database" parameters.
> 
> Isn't it the absolute paths that are required?

For old_database=, it needs to be the exact string which appears as
the fourth field of "v.db.connect -g", including the trailing "/"
character if it is present.

For new_database=, the value is passed directly to v.db.connect's
database= option, so it can be in any form which the driver accepts,
including variable substitutions for the DBF driver.

The default database for the DBF driver is literally:

	$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

By "literally", I mean that's how it appears in the "dbln" file; the
driver expands the variables whenever you access the data.

Any such maps don't need to be explicitly reconnected if you move the
database.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list