Point-in-polygon: one PostGIS query for geofencing, zones, and spatial lookups (opens in new tab)
You've got a coordinate. You've got a pile of regions on a map. You need to know: which region does this point fall in, or is it inside one at all? That single question hides inside a lot of features: Geofencing: is this device or user inside the zone? Service / delivery areas: does this address fall in our coverage? Spatial lookups: which territory, district, or catchment owns this point? They all reduce to one primitive: point in polygon. Learn it once and a whole class of "is this place in...
Read the original article