[GRASS-user] v.external with a postgresql view

Mary

I had some issues with PG in the past, mainly when one of these was given:
-The data can not have more than one geom-column or GRASS will not know what to do (NOTE: this is no issue on QGIS, where you select the geometry manually)
-it might be that you need to define an ID-column that is recognized by GRASS

Hope this helps
PAtrick

On 15.12.2015 12:08, grass-user-request@lists.osgeo.org wrote:

Message: 6
Date: Tue, 15 Dec 2015 12:03:29 +0100
From: Maria Elena Martinotti<mariaelena.martinotti@hotmail.it>
To:"grass-user@lists.osgeo.org" <grass-user@lists.osgeo.org>
Subject: [GRASS-user] v.external with a postgresql view
Message-ID:<DUB127-W65F9836AE26A8ADCA77E0C83EE0@phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"

Dear all,
I have a problem connecting to a PG db with v.external. I created a view on the db (sanfgrass_rain2h) which has a geometry column and grass is able to see it, but when I try to execute v.external it gives me an error about the geometry. See attached lines.
It seems that the layer is correctly detected but no geometry is imported, even if more tha 3000 points are provided by the view. Moreover I have checked that the view is correctly shown in the geometry_columns view.
There is an alert concerning the primary key but, AFAIK, it is not possible to define it in a view .

Thanks for any help,
Mary

db.connect driver=pg database="XXX,dbname=YYY,port=5432";
v.external input="PG:host=XXX user=postgres dbname=YYY" -lt;
PostGIS database <YYY> contains 64 feature tables:
anagrafica,point,0,the_geom
...
sanfgrass_rain2h,geometry,0,the_geom
...v.external input="PG:host=XXX user=postgres dbname=YYY" layer=sanfgrass_rain2h;
ATTENZIONE: No key column detected.
ATTENZIONE: Feature table <sanfgrass_rain2h> has no primary key defined.
             Unable to define DB links.
Si sta ricreando la topologia per il vettore <sanfgrass_rain2h@test_4>...
Numero di nodi: 0
Numero di primitive: 0
Numero di punti: 0
Numero di linee: 0
Numero di confini: 0
Numero di centroidi: 0
Numero di aree: -
Numero di isole: -
v.external completo. Link to vector map <sanfgrass_rain2h> created.