[Imports] Slovenia - Countrywide administrative borders update

Branko Kokanovic branko at kokanovic.org
Wed Feb 26 10:13:01 UTC 2020


Hi,
I already replied to Stefan on Telegram, but for completeness sake, I want to drop a word here too.

I asked around same question in January on this mailing list[1] and got no reply. So, I decided to write something on my own[2]. So far, I got something unpolished, but it already conflated 10.000 ways. Plan is to create English doc and create proper library out of this, but point is, if you need to **idempotently conflate OSM ways (admin level boundary) based on some other/external truth, while preserving OSM history**, this can definitely help. It got support to:
* given a shapely LineString object, find OSM boundary candidates using overpass
* based on heuristic, determine if OSM way is matching given shapely object (watching how close endpoints are, angle between endpoints, buffer needed to increase one way to be inside other way...)
* ask user for confirmation (automatic/semi-automatic threshold configuration, using matplotlib to present how way will be conflated)
* bailout in case way cannot be conflated:
** boundary is national border,
** boundary share part of way with some other relation, like national park,
** boundary contains node that is part of some other relation,
** boundary contains node that has some other tags, like traffic light
* ability to modify/add/remove nodes as needed to conflate way perfectly
* baked idempotency (it can detect if way is already conflated and thus script can be re-run in continuous fashion)
* keeping state internally, so it is resilient to restarts/crashes + embedded retry logic to deal with network failures etc
* additional tools to take all OSM relations from one admin_level and compare them with relations from external truth and show percentage of matching areas (to track overall progress per relation)
* HTML report generation (what is done, what are remaining errors for each way, ... to track progress per way, example is here[3])

Stefan, take a look and see if you can use this as a starting point. If I ever want to make this generic, I need another use case, so your input is welcomed and I am commited to help you around (but you should also be able to hack stuff around, prepare input data...if needed). Others, if you find this interesting, or plan to use it, let me know, I would be glad to help - currently, this is just scratching my itch.

Thanks, Branko

[1] https://lists.openstreetmap.org/pipermail/imports/2020-January/006149.html
[2] https://gitlab.com/stalker314314/prostorne-jedinice-import
[3] https://kokanovic.org/osm/conflate-report-jan2020.html <https://kokanovic.org/osm/conflate-report-jan2020.html#>

On Sun, Feb 23, 2020, at 08:59, Stefan Baebler wrote:
> Hi!
> 
> At the end of January the Mapping Authority of Slovenia published slightly adjusted municipal and city borders. They are now both aligned with the cadastral parcels, so that a single parcel is in a single city and municipality instead of being possibly split into multiple cities and municipalities.
> 
> Announcement at https://egp.gu.gov.si/egp/?lang=en says:
>  * 

> *31.01.2020*
> *Changes of the Spatial Units Register data*
> 
> On the basis of the article 27 of the Act Amending the Real Estate Records Act - ZEN-A (Official Gazette RS, No. 7/18), the Surveying and Mapping Authority entered in the records of Spatial Units Register data changed boundaries of municipalities.
> 

> This has resulted quite a few changes in the graphical data of the Spatial Units Register data - the changes were made for: 212 municipalities, 3,143 settlements and 5,030 spatial districts. As a result the data of other spatial units bound to one of the changed units, have also changed.

> 
> 
> To see what this means in practice I have prepared the comparison for one of the municipalities on github at:
> https://gist.github.com/stefanb/7cac361a10daee5baf2e52bc4426ac86
> image.png
> Green=new official data (after 2020-01-31)
> Red=old official data (before 2020-01-31)
> Blue=OpenStreetMap data (on 2020-02-12 https://www.openstreetmap.org/relation/1675857 <https://www.openstreetmap.org/relation/1675857#map=19/46.11460/14.42120> )
> 
> As expected, borders in OpenStreetMap align well with the old official data, but new official borders are significantly different in some places.
> 
> Has anyone ever performed such an update in a non-painful manner? I am sure that some border ways are (wrongfully) shared with paths and natural features, so we cannot just delete all the old data, but it has to be done selectively. Also some tags from OSM (wikidata, wikipedia...) will need to be preserved. 
> 
> Any suggestions how to approach such an update?
> 
> We might also consider adding next administrative level city borders while we're at it.
> 
> thanks,
> Stefan
> 
> 
> 
> _______________________________________________
> Imports mailing list
> Imports at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/imports
> 
> 
> *Attachments:*
>  * image.png
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/imports/attachments/20200226/6d45ddb6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 103731 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/imports/attachments/20200226/6d45ddb6/attachment-0001.png>


More information about the Imports mailing list