[GIS] Using a bounding polygon, instead of a bounding box

pythonsql

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.

Best Answer

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