[postgis-users] st_equals strangeness

William Temperley willtemperley at gmail.com
Fri Jan 8 09:03:46 PST 2010


Fred,

It's not that. I was only using WKT for illustration - it's not being
used for comparison.

The key line is:
"""
(not st_equals(n1.geom, n2.geom)) and n1.geom = n2.geom;
"""
i.e. binary equal points are not being seen as equal by st_equal

Cheers

Will

2010/1/8 Fred Lehodey <lehodey at gmail.com>:
> Hi,
> looks like truncation problem: WKT format does not maintain precision.... ->
> ST_AsText()
>
> http://postgis.refractions.net/docs/ST_AsText.html
>
> Fred.
>
>
>
>
>
> On Fri, Jan 8, 2010 at 3:28 PM, William Temperley <willtemperley at gmail.com>
> wrote:
>>
>> 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
>
>



More information about the postgis-users mailing list