[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis] How can I find which points are contained in a polygon?
From: Dave Blasby <dblasby () refractions ! net>
Date: 2001-10-30 17:28:45
Message-ID: 3BDEE34D.A23FFB0D () refractions ! net
[Download RAW message or body]
gregoryliapis@yahoo.gr wrote:
> PostgreSQL. My problem is that I need a query to find which cities
> (points) are contained in a specific country (polygon).
Right now, the best way to do this is with the distance() function.
SELECT * FROM <table> WHERE distance(<geom column>,<polygon>) = 0;
OR, to also use the index as well;
SELECT * FROM <table> WHERE distance(<geom column>,<polygon>) =0 AND
<geom column> && BOX3D(<polygon>);
distance(point,polygon) will return 0 if the point is inside the
polygon. If its right on the boundary it will either return 0 or a very
small number (due to precision).
dave
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE VeriSign guide to security solutions for your web site: encrypting \
transactions, securing intranets, and more! \
http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
postgis-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic