[postgis-users] WKT differs in PostGIS and Geos
Maxime van Noppen
maxime at altribe.org
Mon Jul 13 02:07:52 PDT 2009
On 07/11/09 18:57, Paragon Corporation wrote:
> 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.
Hi,
Thanks for the answer.
I've indeed tested the validity of the geometry loaded from the WKB in
Geos and it says it isn't valid whereas ST_IsValid says it is valid.
I've attached the test program I use. geom_1 is the WKB and geom_2 is
the WKT given by AsText. For geos both are invalid whereas for PostGIS
they're both valid.
Here is my output (i've squeezed the WKT output) :
g1->isValid : 0
g2->isValid : 0
[...]
ST_IsValid(geom1) : t
g1 is the geos::geom::Geometry corresponding to geom1.
I use the pqxx the library to perform PostGIS operations.
--
yabo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.cc
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090713/0e914c28/attachment.ksh>
More information about the postgis-users
mailing list