[GRASS-user] new user question about mapsets, locations, and coordinate systems

Glynn Clements glynn at gclements.plus.com
Mon Dec 8 00:55:32 EST 2008


Hamish wrote:

> > I don't remember right now what I did some time ago and mixed my
> > database(s) vs. LOCATION(s). Since then I decided to use separate
> > database(s) files (sqlite.db's for example) to avoid mixing original and
> > edited data.
> 
> ok there are two "databases" at work here. The first is the directory
> which holds all your grass locations (aka $GISDBASE). It is just the
> directory which is the "base" dir of all your "data".
> 
> the second is the DBMS used by v.db.* etc. it holds the attributes linked
> from a vector map.
> 
> the default in grass 6 is DBF, and dbf tables are stored in $MAPSET/dbf/.
> the default in grass 7 is SQLite, and (currently) all tables for that
> mapset are stored in $MAPSET/sqlite.db.
> [in both cases "or whatever you changed it to be"]
> 
> typically each MAPSET will have a default DBMS defined in the $MAPSET/VAR
> file (db.connect), but individual maps can change what they use
> (v.db.connect).
> 
> there is no LOCATION-wide DBMS setting, typically it is a per-MAPSET
> decision.

You aren't forced to use a different database for each mapset; that's
just the default for the file-based DBMSes (DBF, SQLite). You could
have a database for each location, or a single global database.

However: when creating vector maps, it's common to create a database
table with the same name as the map (this is why vector map names are
restricted to the syntax of SQL table names).

Map names are unique within a mapset, but not within a location. If
you use a single database for multiple mapsets, you need to take care
to avoid name collisions.

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


More information about the grass-user mailing list