Importing boundaries (admin_level=8) into existing boundaries (admin_level=7)
Verfasst von Janjko am 18. August 2025 in EnglishI’m importing boundaries in Croatia, and I’m almost done. So I wanted to describe my process so that someone else maybe doesn’t have to rediscover this process. Maybe there is a better one, but I didn’t find it.
Croatia in OpenStreetMap had admin_level=7 borders imported, but the borders were not precise. So my job was to import admin_level=8 into these. I had the data in .osm format, and a license that is compatible. I wanted to keep the history of the old boundaries, so deleting everything and just copying inside wasn’t a choice.
First we need JOSM, and some experience with it. We turn on the Expert Mode in View. We need to install the plugin “utilsplugin2”. Then we go to Map Paint Styles in Preferences, and turn on the “Admin Boundaries” style.
So the process goes like this. In JOSM I open the .osm file with all the admin_level=8 boundaries. Then I download the area where I intend to work, but I use “Download from Overpass API” feature. In it I add the next Overpass query:
[out:xml][timeout:90][bbox:{{bbox}}];
(
relation["boundary"="administrative"];
)-> .adminrelations;
( .adminrelations;
way(r);
) -> .ways;
(
node(w.ways);
)-> .nodes;
way(bn.nodes);
(._;<;); (._;>;);
out meta;
What this query does is it downloads all the boundary relations, and all the ways that are connected to them.
1. Disconnecting
Next step I did was to disconnect all the roads, forests, rivers and anything that is not a boundary from the existing boundaries. I upload that, and later download a cleaner situation.