GIScience / ohsome-api

API for analysing OpenStreetMap history data
https://api.ohsome.org
GNU Affero General Public License v3.0
45 stars 7 forks source link

Add support for administrative boundary name/code/osm-id for queries #219

Open rtroilo opened 3 years ago

rtroilo commented 3 years ago

Overpass allows to query with a country name or osm-id, area[name="London"]; or area(3600065606)

Our dashboard also allows to choose countries (by name). And as we already have the administrative boundaries in our database we could provide a new filter-parameter for the ohsome-api which allows the user to specify the name/code/wikidata/iso/id for one or more features.

here some example filters how this could look like:

This new parameter would us also allow to generate a query (curl/https) link from a dashboard query.

As we already have access to the adminboundary data, I guess a first version could be done quite quickly.

bonaparten commented 3 years ago

related to #30

joker234 commented 3 years ago

Generally very good idea.

The first question that comes is this: How would you do the name matching? There are some boundaries that use the same name (like 29 times “Washington County”). I think overpass turbo (and their wizard) use an external service (the first result of nominatim) to map the name to the OSM ID which the overpass API understands. Do you propose a system where we use an external service as well (e.g. nominatim) to map the name to the correct ID, or do you think we should do our own name/pattern matching?

As we already have access to the adminboundary data, I guess a first version could be done quite quickly. I think a first version could be implemented without using the names but the OSM IDs (e.g. 285864 for Heidelberg).

tyrasd commented 3 years ago

I think overpass turbo (and their wizard) use an external service […] nominatim

Correct. Btw, Nominatim itself also uses an external service (wikipedia page views AFAIK) in their heuristics to sort the search results.