[postgis-users] JAVA and post GIS

Markus Schaber schabi at logix-tt.com
Wed Feb 1 07:01:00 PST 2006


Hi, Antoine,

Gilbert, Antoine wrote:

> ResultSet rs = s.executeQuery("select (AsBinary(center(geometry)))) as
> mycenter from land");

> You can use AsText too and use new PGgeometry(rs.getString(1)) or
> something like that I think

Both asText and asBinary disable the automatic type exteinsions from
pgjdbc, as the server signals the result to be of type text or bytea.

If you "select center(geometry) as mycenter from table" then you can
issue getObject() on the resultset which returns a PGgeometry. On this,
you can then call getGeometry() to get the actual geometry object.

HTH,
Markus


-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list