spatial icon indicating copy to clipboard operation
spatial copied to clipboard

Point-in-polygon for point-based geometries

Open missinglink opened this issue 6 years ago • 1 comments

The title is a bit of a misnomer...

The idea is that we can use point-based geometries in the PIP engine so that they are returned in results when they lie within a specified distance from the target point.

This is super useful for geographic areas where polygon data is not available, or for sources like OpenStreetMap where postcodes and suburbs are commonly just given a lat/lon (an OSM node).

Eg. https://www.openstreetmap.org/node/279655026

It's likely that all data sources will have some data which represents an area but is provided as a point.

There are two ways of achieving this:

  • 'Buffer' points into circles on import
  • Perform an additional 'distance from point' check at query-time

The former would probably be more performant but, regardless, it would be more flexible to do the latter since it allows dynamic selection of the buffer radius while the other approach would require a re-index of the database (time-consuming).

Related: https://github.com/pelias/spatial/issues/5 Related: https://github.com/pelias/spatial/issues/4

missinglink avatar Jul 11 '19 10:07 missinglink

Screenshot 2019-07-11 at 12 35 52

Screenshot of what that might look like

missinglink avatar Jul 11 '19 10:07 missinglink