Time series API filter operators - noi-techpark/opendatahub-docs GitHub Wiki
dlt
Operator
The dlt
(distance less than) operator in the Time series API allows users to filter results based on proximity to a specific point, within a defined radius. This feature makes it easy to search within a circular area around a location, offering a simpler alternative to bounding box filters (bbc
, bbi
).
Operator Syntax
- Operator:
dlt
- Purpose: Filters items within a certain distance from a point.
- Parameters:
- distance (required): The radius in meters within which to search.
- x (required): Longitude of the central point.
- y (required): Latitude of the central point.
- SRID (optional): Spatial Reference System Identifier (defaults to
4326
).
Example Usage
- Basic Usage:
coordinate.dlt.(distance, x, y, SRID)
To retrieve parking stations within a 3 km radius of Meran’s center:
https://mobility.api.opendatahub.com/v2/flat,node/ParkingStation?where=scoordinate.dlt.(3000,11.158682,46.668853)
To retrieve all stations within 5 km from coordinates (11.2, 46.7):
https://mobility.api.opendatahub.com/v2/flat,node/ParkingStation?where=scoordinate.dlt.(5000,11.2,46.7)
Common Pitfalls
- Coordinate Order: Ensure coordinates are in
longitude, latitude
order. Note that Google Maps typically useslatitude, longitude
, so be cautious when copying coordinates. - SRID: If omitted, the SRID defaults to
4326
. Use a specific SRID if required by your application.
Related Operators
bbc
(Bounding Box Contain): Returns items completely within a specified bounding box.bbi
(Bounding Box Intersect): Returns items partially within a bounding box.