[postgis-users] difference between contains and within

Chander Ganesan chander at otg-nc.com
Tue Nov 6 11:57:36 PST 2007


Dave Potts wrote:
> I trying to work out the number of points that spaitially inside a 
> polygon, looking at the manual there are two functions that seem to do 
> the right thing, contains and within.
>
> Q. Whats the difference between the two functions?
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   
I believe they are the same, just with the arguments swapped. 

st_within(A, B) would return 1 if A is completely within B.
st_contains(A,B) would return 1 if B was completely within A

thanks

-- 
Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC  27560
919-463-0999/877-258-8987
http://www.otg-nc.com




More information about the postgis-users mailing list