[postgis-users] equals and =

Paul Ramsey pramsey at cleverelephant.ca
Wed Apr 23 13:16:21 PDT 2008


I'm going to go out on a limb here, without consulting the source
code, and say that the '=' operator is comparing the representations
of the geomtries, so only geometries that have exactly the same
vertices in exactly the same order starting at exactly the same point
are counted.  The equals() function is allowing for differences in
start point, direction and inconsequential vertices.

YMMV.

P

On Wed, Apr 23, 2008 at 8:22 AM, Rhys Stewart <rhys.stewart at gmail.com> wrote:
> Greetings all,
>
> I have a relation and i am trying to remove duplicate and/or similar
> geometries. I get different results when I use equals(geometry,geometry) and
> geom = geom. While i expect this based on the docs, im getting back more
> results when I use geom = geom than when I use the equals(geom,geom)
> function.
>
> Maybe I am mistaken as to what the differences between equals and = are?
>
> Here are the queries:
>
> select q.objectid,w.objectid, astext(q.the_geom),astext(w.the_geom) from
> ill_second q
> inner join ill_second w on q.the_geom && w.the_geom
>      AND equals(q.the_geom,w.the_geom) --and q.the_geom = w.the_geom
> where q.objectid <> w.objectid
>
> and
>
> select q.objectid,w.objectid, astext(q.the_geom),astext(w.the_geom) from
> ill_second q
> inner join ill_second w on q.the_geom && w.the_geom
>      AND q.the_geom = w.the_geom
> where q.objectid <> w.objectid
>
> Version info:
> "PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2
> (mingw-special)"
> "POSTGIS="1.3.2" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel. 4.5.0, 22 Oct 2006"
> USE_STATS"
>
>
>
>
> Thanks,
> Rhys
>
> _______________________________________________
>  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