Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a large set of LAT/LON coordinates. Up until now, when I needed to select out those that fell within a certain region, I'd just create a bounding box using some MINx, MAXx, MINy, MAXy values and try to get it as close as possible to the area I was interested in.

I'd like to get more precise by using more than 4 points as the extent of my search area, in this specific case, 14 points.

I'll probably be using Python or SQL for this, so the specific syntax on any solution isn't that important, I'm just interested in the formula for figuring this one out.

share|improve this question
You might find discussions about concave and convex hulls to be relevant:… – whuber Jul 1 '11 at 17:13
up vote 4 down vote accepted

You could use Shapely to perform the operation (e.g. within). You could load both geometries via one Shapely's methods for interoperation.

share|improve this answer
Shapely and within did the trick, thank you! – solr Jul 2 '11 at 12:18

PostGIS has a collection of relational operators that should do what you want.

share|improve this answer
SELECT * FROM pointstable, polygonstable WHERE st_intersects(pointstable.geom, polygonstable.geom)=TRUE – Pablo Jul 1 '11 at 22:01
specifically: ST_Contains or ST_Within (possibly ST_DWithin if you want to overcompensate for rounding errors) – Mike T Jul 1 '11 at 23:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.