-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
Feature Request: Support directional filters (north/south/east/west) similar to around
Description
Currently, Overpass QL supports around for radius-based spatial queries and bbox/area for rectangular or administrative area filtering. However, there is no native support for directional filtering, such as selecting objects north, south, east, or west of a reference object. This is a common use case, for example: "all residential areas south of a school."
Use case / motivation
- Find all neighborhoods south of a school or all residential areas east of a road
- Analyze spatial relationships between OSM objects without exporting to GIS or Python
- Simplify queries that currently require
aroundplus external coordinate filtering
Proposed feature
- Introduce new spatial filters, e.g.,
north_of,south_of,east_of,west_of - Or extend
aroundwith a directional parameter:
way(around.school:500, direction=south);- Functionality should be similar to
around:- Use object center points
- Apply both distance and directional constraints
- Return objects satisfying both radius and direction conditions
Benefits
- Eliminates the need for post-processing in GIS or Python for directional filtering
- Makes Overpass QL more expressive and closer to a spatial query language
- Supports common real-world mapping and urban analysis scenarios
Additional context
- Internally, this could be implemented by calculating the dx/dy between candidate object centers and the reference object, similar to how
aroundcomputes distances - Directional filtering could optionally be combined with distance, e.g., "objects within 500m south of a school"
References / Related
aroundimplementation: calculates object centers and approximate planar distances- Current workaround: export object centers and filter by coordinates externally
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels