[GRASS-user] tables connection in database

Falko Engel falko_e at gmx.net
Tue Jun 23 11:42:13 EDT 2009


Dear List,

I have some problems with tables stored in PostgreSQL database.
I'm using openSUSE 11.1 (and 10.3), PostgreSQL 8.2.13 and GRASS GIS 6.4.0RC4
My default db connection for my mapsets is set to postgresql.
I am using schemas within the database corresponding to the mapsets. So
my mapset "forest" has a corresponding schema "forest" in the database
where all the forest-tables should be stored.

Problem 1:
After dissolving with v.extract -d using the new= parameter I tried to
use v.db.addtable to create a table for my dissolved map. This has to be
done, as far as I understood, since the new= parameter of v.extract
results in maps without tables.
Now v.db.addtable creates the table, but doesn't put it in the right
database schema. It is created in the schema "public2 and not in the
schema 2forest", where it should be. Although db.connect -p verifys that
all connection parameters are correctly set.
I guess using v.extract without dissolving and doing that later using
v.dissolve will solve the problem. I was just wondering if anyone
experienced the same issues with the schemas and if there is a solution
to this.

Problem 2:
This is really confusing me. I tried to use the capability of linking
more than one attribute table to a map. Overall I succeded doing so.
Grass reports (in german):

...................................................................................
v.db.connect -o map=trees_geo_init key=cat_id layer=3
table=forest.trees_buche

Die Tabelle <forest.trees_buche> ist jetzt Teil der Vektorkarte
<trees_geo_init> und kann mit GRASS Modulen gelöscht und überschrieben
werden.
Select-Privilegien wurden für die Tabelle gewährt.
....................................................................................
Something like: "The table forest.trees_buche is now connected to the
map trees_geo_init and can be used..."

The connection seems to be established.
I didn't succeed, however, in exporting the map to a shapefile using the
information of layer 3 (as created above):
v.out.ogr input=trees_geo_init_buche layer=3 dsn=/home/fengel/tmp

Also v.extract can't use the new layer:
v.extract input=trees_geo_init output=trees_geo_init_buche layer=3
This results in empty maps.

Also I cannot get QGIS to use the information from this layer, although
QGIS explicitly offers the option to choose the layer when opening a
grass-mapset vector layer.


I would be thankful if anyone could help.

Cheers, Falko


More information about the grass-user mailing list