[postgis-users] How to instanziate the Geometry class from the geometry string?

martinelli at pi.ingv.it martinelli at pi.ingv.it
Tue Sep 19 11:48:34 PDT 2006


Hi,
I am writing a Java application,
and I am trying to read a geometry field (a POINT) from a PostgreSql
database via OJB (ObjectBroker), using JDBC.

OJB requires the table fields to be defined as one of the types defined in
java.sql.Types in its configuration file, therefore POINT is not allowed.
Using VARCHAR I receive the geometry data string.

However, to convert the geometry value received from the table I need to
write the "serializer" to create the geometry instance (of class Point in
my case).
[Later on I will also need also a deserializer...]

What method(s) I need to call to instanziate the proper class?
Please consider I have only the geometry string returned by the database,
and it is not in WKB or WKT format.

Anyone had the same issue with OJB?

Thank you,
Francesco.





More information about the postgis-users mailing list