[postgis-users] Difference between geometryFromText and geomFromWKB

Antonio Grassi agrassic at gmail.com
Mon Jan 8 05:37:22 PST 2007


Hi. I've a question about geometry constructors.

I've a table with a geometry column for storing points with 14024 rows, and
srid -1. Of those rows, there are 27 in wich

the_geom ~= geometryFromText(asText(the_geom),-1)

returns false.

If I make

select the_geom, geometryFromText(asText(the_geom),-1) in one of those rows,
with geometry POINT(573811.278250325 6137116.18770014), for example, I get

                 the_geom
                |              geometryfromtext
---------------------------------------------------------------------+--------------------------------------------------------------------
 01010000009AD3768EE68221417147030C47695741
01010000009CD3768EE68221417347030C47695741

The only difference, corresponding to the digit in the 12 position, seems to
be part of the 8 byte group storing the X coordinate of the point.

But if I make

select the_geom, geomFromWKB(asBinary(the_geom),-1)

of the same row, I get  01010000009AD3768EE68221417147030C47695741 in both
cases.

Does anyone know the reason of this difference? Is it due to a difference
between the precision obtained in the asText representation and that of the
8 byte double? We need to work with the geometryFromText constructor and
text representations of geometries, so I would be very gratefull If someone
could explain this difference.

Thanks very much,
Antonio Grassi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070108/8463fd8d/attachment.html>


More information about the postgis-users mailing list