[postgis-users] Problem with ST_WITHIN

Martin Davis mbdavis at refractions.net
Mon Sep 21 09:01:14 PDT 2009


The OGC definition for Contains and Within have always seemed a bit 
non-intuitive to me.  They may be theoretically elegant. but they don't 
really address the most common use case.   (See a blog post on this as:  
http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html).  


That's why JTS, GEOS and PostGIS define the covers() predicate, which 
has simpler, more intuitive and more practical semantics.

http://postgis.refractions.net/documentation/manual-1.4/ST_Covers.html


Luigi Castro Cardeles wrote:
> Hi list and Chris,
>
> this is what i was asking :D
>
> i was thinking that boundary is part of the geometry, so if there is 
> some geometry on the boundary (in this case, a point on the polygon 
> boundary) then the point is within the polygon. But after your message 
> i read the specs 
> (http://portal.opengeospatial.org/files/?artifact_id=18241) about 
> within, i see the relate and now i understand. Thanks for the hint Chris.
>
> []'s
> Luigi Castro Cardeles
>
>
> 2009/9/18 Chris Hermansen <chris.hermansen at timberline.ca 
> <mailto:chris.hermansen at timberline.ca>>
>
>     If it's on the boundary, is it within?
>     Chris Hermansen        chris.hermansen at timberline.ca
>     <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 · www.timberline.ca
>     <http://www.timberline.ca>
>     401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5
>
>
>     -----Original Message-----
>     From: Luigi Castro Cardeles <luigi.cardeles at gmail.com
>     <mailto:luigi.cardeles at gmail.com>>
>
>     Date: Fri, 18 Sep 2009 10:01:32
>     To: PostGIS Users Discussion<postgis-users at postgis.refractions.net
>     <mailto:postgis-users at postgis.refractions.net>>
>     Subject: Re: [postgis-users] Problem with ST_WITHIN
>
>
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at postgis.refractions.net
>     <mailto:postgis-users at postgis.refractions.net>
>     http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at postgis.refractions.net
>     <mailto: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
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022




More information about the postgis-users mailing list