GIScience / oshdb

OpenStreetMap History Data Analysis Framework
https://ohsome.org
GNU Lesser General Public License v3.0
110 stars 18 forks source link

[oshdb-filter] Support BoundingBox as textual filter #466

Closed mmerdes closed 2 years ago

mmerdes commented 2 years ago

Problem Description

Currently, bounding boxes (or other geometry-based restrictions) can be expressed in the ohsome API via areaOfInterest(geometry). There is, however, no such possibility available within the textual filter language.

Expected Solution

Add the following filter to the filter language using the coordinates of the lower left and the upper right corner of the bounding box:

boundingBox:(lon_min, lat_min, lon_max, lat_max)

In theory, this could be extended to arbitrary JTS/WKT geometries. However, this issue is deliberately kept minimal and would still cover most use cases.

joker234 commented 2 years ago

slightly related to https://github.com/GIScience/oshdb/issues/460#issuecomment-1210902178 and #106

mcauer commented 2 years ago

Does this mean, one could specify multiple bounding boxes in one filter? e.g. combined through ANDs and ORs. This would go into the direction of spatial relations. One could ask: Give me all schools within an overlapping bbox from Mannheim and Heidelberg. I think the OSHDB Api only allows for one area of interest at the moment.

mmerdes commented 2 years ago

My initial idea was to give a possibility for top level bounding box restrictions. Such restrictions are filters in nature and would fit well in a filter language. Allowing arbitrary combinations with AND and OR might open a can of worms for which the API itself is not ready yet.

Hagellach37 commented 2 years ago

We would consider this out of scope for OSHDB.