[postgis-users] Postgis Java JDBC

Markus Schaber schabi at logix-tt.com
Wed Apr 13 01:54:18 PDT 2005


Hi, Erwan,

No need to send me the emails as separate copies, as I am subsribed on
the PostGis list :-)

BOCHER schrieb:
> For example my request is :
> Select Buffer(the_geom, 3000) As the_geom from parcels INTO results
> Or :
> select intersection (p1.the_geom, p2.the_geom) into tabintersection
> from parcels1 p1, parcels1 p2 where p1.the_geom && p2.the_geom and
> p1.gid <> p2.gid;

This problem is not jdbc specific, it will have the same effect with
other frontends.

Those queries do not follow the OpenGIS spec on how to create geometry
tables. The OpenGIS spec wants the user to manually add the geometry
columns using the addGeometryColumn() SQL function.

This is the reason why your newly created tables do not appear in the
geometry_columns table. There was some discussion about possible
alternatives that circumvent this limitation, but they had their other
drawbacks and so none of them was implemented yet.

PostGIS itsself will happily work on this table without any major
problems, but applications using the OpenGIS access methods will fail to
recognize tables.

I see two alternative workarounds (but maybe others know a better way
how to do it).

- Manually insert the proper data into geometry_columns after executing
your statement (possibly using fix_geometry_columns() afterwards).

- Create the Table with "CREATE TABLE" omitting the geometry columns,
then add them with addGeometryColumn(), and then fill in the data with
"INSERT INTO results SELECT Buffer(the_geom, 3000) As the_geom from parcels"


BTW, reading the PostGIS documentation should really give you more
insight into this issues.

HTH,
Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050413/3c7bf0ff/attachment.pgp>


More information about the postgis-users mailing list