[GRASS-user] Load PostGIS layer with tow geometry columns

Dear all,

Trying to load a PostGIS layer with tow geometry columns it output’s the following error: ‘ERROR: Layer <layer_name> not available’.

If one of the tow geometry’s is dropped it works fine. Is there a way to define witch geometry I wont to load, something like ‘geom_column=the_geom’?

This is what I’m trying to do:
v.in.ogr dsn=“PG:host=localhost dbname=bd_ceamsig user=postgres” layer=sch_ambiente.escv_incendios_todos where=“anyo=2009” output=temp

Thanks in advance! Regards,

Eloi Ribeiro
GIS Analyst
39,45º -4,40º
http://eloiribeiro.wordpress.com

Hi,

2011/4/5 Eloi Ribeiro <eloi.ribeiro@gmail.com>:

This is what I'm trying to do:
v.in.ogr dsn="PG:host=localhost dbname=bd_ceamsig user=postgres"
layer=sch_ambiente.escv_incendios_todos where="anyo=2009" output=temp

missing `format=PostgreSQL` ?

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

On Tue, Apr 5, 2011 at 13:17, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2011/4/5 Eloi Ribeiro <eloi.ribeiro@gmail.com>:

This is what I’m trying to do:
v.in.ogr dsn=“PG:host=localhost dbname=bd_ceamsig user=postgres”
layer=sch_ambiente.escv_incendios_todos where=“anyo=2009” output=temp

missing format=PostgreSQL ?

Martin

Thanks for your quick reply Martin,

Actually it’s not a format parameter that I miss but a parameter that would define which geometry I want to use in case there is more than one geometry per layer/postgis table.

Example. In my table 'escv_incendios_todos’ I have tow filds/columns with geometry, one is called geom_23030 (coord. syst. epsg 23030) and the other geom_4258 (coord. syst. epsg 4258) and a trigger maintaining this tow geometry’s synchronized. In the geometry_columns table there are tow entry’s for the 'escv_incendios_todos’ table:

3970433;“‘’”;“sch_ambiente”;“escv_incendios_todos”;“geom_23030”;2;23030;“MULTIPOLYGON”
3970434;“‘’”;“sch_ambiente”;“escv_incendios_todos”;“geom_4258”;2;4258;“MULTIPOLYGON”

So when I try to load 'escv_incendios_todos’ in GRASS there is no way to define which geometry I want to use. And the error ‘ERROR: Layer <layer_name> not available’ jumps out.

By now I worked around by deleting the entry with the geometry I’m not interested on the geometry_columns table and then insert it again.

Thanks. Regards,