[GRASS-user] PostGIS to GRASS

H.Lekin h.lekin at gmx.net
Fri Aug 18 05:49:22 EDT 2006


Hi all,

I want to access a shapefile loaded into PostgreSQL/PostGIS via
shp2pgsql. v.in.db seems to be a suitable choice:

GRASS 6.0.2 (Germany):~/work > v.in.db table=countryboundaries
x="X(the_geom)" y="Y(the_geom)" key=gid out=countrybnds
DBMI-Postgres driver error:
Cannot select:
select gid, X(the_geom), Y(the_geom) from countryboundaries
ERROR:  Argument to X() must be a point
ERROR: Cannot open select cursor: 'select gid, X(the_geom), Y(the_geom)
       from countryboundaries'

GRASS expects the column to hold point data, but 'the_geom' looks like this:

gistest=> select astext (the_geom) from countryboundaries;
---snip---
MULTIPOLYGON(((3.71071599999999 50.380975,...,3.71071599999999 50.380975)))
# for point data
---snip---
MULTIPOINT(4.36800044829999 50.83700218311)

Do I have to select the individual points and write them into separate
columns? Is there any other way to access such coordinates; a more
appropriate GRASS module?

Thanks in advance,
H.L.




More information about the grass-user mailing list