GIScience/ohsome-api

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

rtroilo opened this issue · 3 comments

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:

  • area=Anderson Country:Kansas:USA or area=Q377234 or area=1070344

  • also multiple areas should be allowed
    area=Heidelberg or Mannheim or area=Heidelberg, Mannheim

  • and querieable should also be a mix of name/localname/wikidata,iso3166_2 code, and id
    area=münchen or essex:can or gb-lce or q1044 or 62691

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.

related to #30

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).

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.