I have a table, Regions:
| id | name |
|----|----------|
| 1 | Jersey |
| 2 | Scotland |
...
and a table of RegionPoints (which define the bounding box for each region):
| id | regionid | lat | lng |
|----|----------|-------|-------|
| 1 | 1 | 49.27 | -2.27 |
| 2 | 1 | 49.27 | -1.99 |
| 3 | 1 | 49.15 | -2.27 |
| 4 | 1 | 49.15 | -1.99 |
...
Given a latitude and longitude, I want to find the regions which contain the given point.
From my understanding, I need to aggregate by regionid, then
use ST_ConcaveHull, followed by ST_Contains using the latitude and longitude to query for, however my concern is that with a large number of regions, computing a concave hull for each will be very inefficient.
This is my first time using PostGIS, so a bit stuck.