[postgis-users] st_equals strangeness

Chris Hermansen chris.hermansen at timberline.ca
Fri Jan 8 09:36:44 PST 2010


Is it really possible to have the following expression evaluate to true?

    st_asbinary(n1.geom) = st_asbinary(n2.geom) and !(n1.geom = n2.geom)

That seems completely impossible to me.  Rounding errors arise from arithmetic operations, and there should be no arithmetic operations, only assignment, in the computation of bounding box.


Sufficool, Stanley wrote:
> n1.geom = n2.geom is not binary equal, it is bounding box equal which may include rounding errors?
>
> st_asbinary(n1.geom) = st_asbinary(n2.geom) is binary equal
>
>
>
>   
>> -----Original Message-----
>> From: postgis-users-bounces at postgis.refractions.net
>> [mailto:postgis-users-bounces at postgis.refractions.net] On
>> Behalf Of William Temperley
>> Sent: Friday, January 08, 2010 7:28 AM
>> To: postgis-users at postgis.refractions.net
>> Subject: [postgis-users] st_equals strangeness
>>
>>
>> Dear all,
>>
>> Given two points with exactly the same coordinates that are
>> binary equal (geom = geom), I don't understand how st_equals
>> can return false.
>>
>> The following statement:
>>
>> select
>> st_astext(n1.geom),
>> st_astext(n2.geom)
>> from nodes n1, nodes n2
>> where (n1.node_id = n2.node_id)
>> and (not st_equals(n1.geom, n2.geom)) and n1.geom = n2.geom;
>>
>>
>> yields:
>>                 st_astext                 |                st_astext
>> ------------------------------------------+-------------------
>> ----------
>> ------------------------------------------+-------------
>>  POINT(28.291805 37.0481949999918)        | POINT(28.291805
>> 37.0481949999918)
>>  POINT(28.291805 37.0481949999918)        | POINT(28.291805
>> 37.0481949999918)
>>  POINT(28.2538598984633 37.006806)        |
>> POINT(28.2538598984633 37.006806)
>>  POINT(28.0726373735563 37.022361)        |
>> POINT(28.0726373735563 37.022361)
>>
>> Could anyone shed any light on this please?
>>
>> POSTGIS="1.4.1" GEOS="3.1.1-CAPI-1.6.0"  btw.
>>
>>
>> Thanks
>>
>> Will
>> _______________________________________________
>> postgis-users mailing list postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>     
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   


-- 
Regards,  (please note new mobile number below)

Chris Hermansen         mailto:chris.hermansen at timberline.ca
tel+1.604.714.2878 · fax+1.604.733.0631 · mob+1.778.840.4625
Timberline Natural Resource Group · http://www.timberline.ca
401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5




More information about the postgis-users mailing list