[postgis-users] different results from PGobject.getValue()

Markus Schaber schabi at logix-tt.com
Tue Feb 13 05:55:55 PST 2007


Hi, Claude,

"Claude Eisenhut" <ce at eisenhutinformatik.ch> wrote:

> Is it expected behaviour that PGobject.getValue() returns different results,
> depending if postgis.jar is on the classpath?
> 
> without postgis.jar PGobject.getValue() returns
> 01010000201555000052B81E85A50E2341B81E85EB3B330F41
> 
> with postgis.jar PGobject.getValue() returns
> SRID=21781;POINT(624466.76 255591.49)

Yes, it is expected.

If you don't have PostGIS installed, then PGObject just memorizes the
data String sent by the server.

When you have PostGIS in your classpath, org.postgis.PGgeometry is
automagically registered, and used for Geometry objects. By default,
getValue() returns the EWKT format which is compatible with PostGIS 0.8
and up. You can manually register org.postgis.PGgeometryLW as handler
class, which returns the hex-Binary form you see above, but only works
with PostGIS 1.X and above.


Regards,
Markus

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

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



More information about the postgis-users mailing list