api icon indicating copy to clipboard operation
api copied to clipboard

Feature Request: Support for polygon boundary with configurable buffer (boundary.gid + distance)

Open trafficonese opened this issue 3 months ago • 2 comments

We are evaluating Pelias as a geocoding service to replace Nominatim and Photon in our projects. One of our key use cases is bicycle routing within specific regions. For that reason, we handle most geocoding ourselves and need to restrict results strictly to certain areas.

Currently, boundary.gid allows us to filter results to administrative boundaries (e.g., city, county, state). However, in our use case the required search area does not align exactly with existing administrative boundaries. Instead, we would like to restrict results to:

  • an administrative boundary (via boundary.gid)
  • plus a configurable buffer distance (e.g., 30 km) around that boundary

This would allow us to cover adjacent areas close to the boundary without including unrelated, distant results.

Two possible approaches we see:

  1. Extend the existing boundary.gid parameter with an optional buffer argument, for example: boundary.gid=whosonfirst:locality:101748617&boundary.buffer=30000 (where buffer is defined in meters).

  2. Allow users to upload or configure a custom polygon (not tied to existing WOF administrative boundaries) that acts as a global filter for all queries.

Both options would make Pelias significantly more flexible for mobility and routing services where administrative boundaries alone are too restrictive. Would this be feasible to add to Pelias API, or is there an existing workaround we could already use?

Thanks a lot for your great work on Pelias!

trafficonese avatar Sep 15 '25 15:09 trafficonese