[postgis-users] PostGIS support of Geography data type in java jdbc driver?

Jay Moss jaymoss3 at gmail.com
Thu Feb 2 14:58:38 PST 2012


Is there any support for the Geography data type in the PostGIS JDBC driver?

I received a classCastException if I try to cast a Geography colum to a
PGgeometry:

my table:

CREATE TABLE k16View (
  id character varying(255) NOT NULL,
  locGeog geography
  CONSTRAINT k16View_pkey PRIMARY KEY (id));

my code:
...
ResultSet r = s.executeQuery("select id locGeog from k16View");
String trackNumber = r.getString(1);
PGgeometry geog = (PGgeometry) r.getObject(2);   // throws
ClassCastException
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120202/1a4ac5d4/attachment.html>


More information about the postgis-users mailing list