Maxime,

ST_AsText does not produce the fidelity of the geometry.  It truncates
floating points and I think where they truncate between GEOS and PostGIS is
different.   GEOS and PostGIS do not share the same WKT writers.

My question is -- have you tried validating the WKB in GEOS.  The WKB should
maintain fidelity so you should get the same IsValid answer in both those
cases. 

Leo

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maxime
van Noppen
Sent: Saturday, July 11, 2009 8:35 AM
To: PostGIS Users Discussion
Subject: [postgis-users] WKT differs in PostGIS and Geos

Hello,

I've got a strange issue. When I print a polygon from PostGIS (v1.3.6)
thanks to the AsText() function I get a different result than if I read the
WKB into a geos (v3.1.0 and v3.1.1) geometry object and than write it with
geos::io::WKTWriter.

When asking PostGIS to check the geometry's validity (via ST_IsValid) it
says it is valid whereas Geos says it isn't (via the
geos::geom::Geometry::isValid function).

I've attached a text file containing the WKB geometry as it appears in the
database, the WKT given by AsText and the WKT given by geos.

Thank you for your help !

--
Maxime


_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to