Retrieve historical area muncipality/regional authority for a place

Hi to all, I just stumpled upon OpenHistoricalMap and think it is a great project! I wonder if it is somehow possible to retrieve the area muncipality for a place during all times or at a given time using the API. I tried it via https://nominatim.openhistoricalmap.org/ but the JSON does not contain related historical enclosing muncipalities. Maybe it is possible using Overpass?
Best
Michael

2 Likes

Hi @MichaelMarkert! Welcome!

It really depends on whether the municipal relations have been mapped already. Which area of the world and which time period are you looking at specifically? That will help us find a solution with you. :+1:t2:

2 Likes

Thanks for the fast response! You are right, it was a little unspecific. Right now I am interested in Germany, where especially around the middle there were several changes in adminstration throughout the 19th and 20th century, see for example: Node: ‪Jena‬ (‪2093449454‬) | OpenHistoricalMap
Best Michael

1 Like

Indeed, Nominatim doesn’t currently understand the temporal relationships between various boundary relations, but that would be an immensely useful enhancement. There are a couple of discussions touching on this idea indirectly:

In the meantime, you can right-click on Jena on the map and choose Query Features. Under the “Enclosing features” section, you’ll see a list of all the boundary relations that enclose this place geographically at any point in time. Many of these relations are named according to their time period, which isn’t technically correct but happens to make it easier for you to pick out the most relevant relations.

Under the hood, this list is powered by an Overpass API query, which I’ve cleaned up for you to read:

[timeout:10][out:json];

// Convert the query point to an area, get all ways that intersect this area, and output their tags and bounding boxes.
is_in(50.92812,11.58791)->.a;
way(pivot.a);
out tags bb;

out ids geom(50.92785,11.58656,50.92855,11.58949);

// Get all relations that intersect this area, and output their tags and bounding boxes.
relation(pivot.a);
out tags bb;

Here’s a modified query that returns only the relations that overlap with the city temporally and returns the full geometries instead of just the tags and bounding boxes:

[timeout:10][out:json];

// Convert the query point to an area.
is_in(50.92812,11.58791)->.a;
// Get all ways that intersect this area, but only if they existed in the same time period as the city of Jena.
// This relies on the fact that ISO 8601 dates sort lexicographically.
way(pivot.a)(if: t["start_date"] >= "1975")[!"end_date"];
// Output their geometries.
out geom;

out ids geom(50.92785,11.58656,50.92855,11.58949);

// Get all relations that intersect this area, but only if they existed in the same time period as the city of Jena.
relation(pivot.a)(if: t["start_date"] >= "1975")[!"end_date"];
// Output their geometries.
out geom;

With some more modifications, this query could take the Jena city node as input and derive the coordinates and temporal comparisons automatically.

1 Like

This is exactly what I was looking for, thank you very much! I will try to wrap my head around the Overpass syntax and see where it leads…
Best Michael

1 Like

FYI: I organized the query in a jupyter notebook and added a search form, list view, and .csv download for the is_in query results, see https://github.com/MichaelMarkert/GND4C/tree/main/historicalPlaces

3 Likes

This is a great idea with a lot of potential use cases. Thanks for sharing!

1 Like