[GRASS-user] sql and postgis

Gustavo Martinez gumartin at mecon.gov.ar
Tue Oct 30 13:28:37 EDT 2007


El Monday 29 October 2007 12:53:20 escribió:
> >
> > Moritz,
> >
> > the result of  v.db.connect monitoreo -p is:
> >
> > Vector map <monitoreo> is connected by:
> > layer <1> table <monitoreo> in database <PG:host=localhost
> > dbname=pesca-new user=postgres> through driver <ogr> with key <>
>
> There's the problem: 'with key <>'. GRASS does not know how to link the
> geographical data (the map) to the attribute data. This is where the
> SELECT FROM comes from, i.e., nothing to select.
>
> As I said, I'm not sure that a map linked into GRASS with v.external can
> be used for database queries. Also don't know what the ogr driver supports.
>
> You could try to relink the map directly to the postgresql table with
> something like
>
> v.db.connect -o map=monitoreo driver=pg database="host=localhost
> dbname=pesca-new" table=monitoreo key=XXX
>
> where XXX is the column that contains the identifiers of the
> geographical objects in your map.
>
> Moritz

I've tried the following command:

v.db.connect -o map=monitoreo driver=pg database=pesca-new table=monitoreo 
key=idmonitoreo layer=1

 and it gave me the following:

pg driver: column 'fecha', type 1184  is not supported
pg driver: column 'fch_local', type 1184  is not supported
pg driver: PostGIS column 'geom', type 'geometry'  will not be converted
pg driver: column 'fecha', type 1184  is not supported
pg driver: column 'fch_local', type 1184  is not supported
pg driver: PostGIS column 'geom', type 'geometry'  will not be converted

The table <monitoreo> is now part of vector map <monitoreo> and may be deleted 
or overwritten by GRASS modules

However, if I tgry again 
v.db.connect monitoreo -p the key field is still empty.

Gustavo

-- 
Lic. Gustavo Martínez
Gestión de Pesquerías
Sub Secretaría de Pesca de la Nación
Paseo Colón 982, Anexo Jardín Pesca
Tel: (54) 11 43492165
Buenos Aires, República Argentina

“Que la tierra se vaya haciendo camino ante tus pasos,
que el viento sople siempre a tus espaldas,
que el sol brille cálido sobre tu cara,
que la lluvia caiga suavemente sobre tus campos y,
hasta tanto volvamos a encontrarnos,
que Dios te lleve en la palma de su mano.”




More information about the grass-user mailing list