[postgis-devel] ST_Contains / ST_Within

Enrico Rampazzo iarendis at gmail.com
Mon Sep 29 01:19:51 PDT 2014


I am sorry, I am kind of a newbie here, but what does the ~ operator do?

Thanks

Enrico

2014-09-27 1:15 GMT+02:00 Paragon Corporation <lr at pcorp.us>:

>  Fine by me.  I at first thought in my imagination that it was possible
> for a box to not contain another box and for the geometries that have those
> boxes to contain each other.  But after thinking some more I convinced
> myself it's not possible in this world or any we would consider.
>
> Regina
>
>  ------------------------------
> *From:* postgis-devel-bounces at lists.osgeo.org [mailto:
> postgis-devel-bounces at lists.osgeo.org] *On Behalf Of *Paul Ramsey
> *Sent:* Friday, September 26, 2014 5:51 PM
> *To:* PostGIS Development Discussion
> *Subject:* [postgis-devel] ST_Contains / ST_Within
>
>  I was just working through strategy numbers and thinking about how we
> only ever use RTOverlapStrategyNumber when I realized that we should be
> using other strategies for at least a few of our functions, and yet we have
>
>  CREATE OR REPLACE FUNCTION ST_Contains(geom1 geometry, geom2 geometry)
>         RETURNS boolean
>         AS 'SELECT $1 && $2 AND _ST_Contains($1,$2)'
>         LANGUAGE 'sql' IMMUTABLE;
>
> When really it should be
>
>  CREATE OR REPLACE FUNCTION ST_Contains(geom1 geometry, geom2 geometry)
>         RETURNS boolean
>         AS 'SELECT $1 ~ $2 AND _ST_Contains($1,$2)'
>         LANGUAGE 'sql' IMMUTABLE;
>
> Probably a small efficiency savings to be had in reducing the number of
> geometries to be exact tested. Anyone see a reason we shouldn’t do this?
>
> P.
>
> --
> Paul Ramsey
> http://cleverelephant.ca
> http://postgis.net
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20140929/47937377/attachment.html>


More information about the postgis-devel mailing list