[postgis-users] the_geom = the_geom strange result

Picavet Vincent Vincent.Picavet at mediapost.fr
Wed Oct 15 04:12:15 PDT 2008


Hi,
Considering two similar geometries, but different, an equality test with
the '=' operator returns true, whereas st_equals returns false.
In this case, st_equals behaviour seems right, but I would expect the
equality test with = to return false as well, since the geometries are
actually different.
Does someone have an explanation to this result ? Some kind of float
precision related issue ?

select st_geometryfromtext(
'LINESTRING(94525.0864578169 2403749.07413185,94521.0361656005
2403752.12944388,94519.5539334096
2403754.3019993,94517.5683187493 2403757.1772215,94512.295369653
2403767.3398906)'
) 
= st_geometryfromtext(
'LINESTRING(94512.295369653 2403767.3398906,94520.7920704004
2403760.91556806,94524.3349180666
2403757.32391662,94525.0864578169 2403749.07413185)'
);

select st_equals(st_geometryfromtext('LINESTRING(94525.0864578169
2403749.07413185,94521.0361656005 2403752.12944388,94519.5539334096
2403754.3019993,94517.5683187493 2403757.1772215,94512.295369653
2403767.3398906)') 
,st_geometryfromtext('LINESTRING(94512.295369653
2403767.3398906,94520.7920704004 2403760.91556806,94524.3349180666
2403757.32391662,94525.0864578169 2403749.07413185)'));

tested with : 
"POSTGIS="1.3.3" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.0, 21 Dec 2007"
USE_STATS (procs from 1.3.2 need upgrade)"
"POSTGIS="1.1.6" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.5.0, 22 Oct 2006"
USE_STATS (procs from 1.3.2 need upgrade)"

Thanks for any explanation,
Vincent



More information about the postgis-users mailing list