OpenStreetMap

Fixing Jakarta's boundaries (Part I)

Posted by capiscuas on 16 November 2015 in English.

After having announced in the Indonesia and Imports mailing list about my intentions of fixing the current administrative boundaries in Jakarta, capital of Indonesia.

So the first I did was to download the boundary:administrative ways in Jakarta area, by using the following Overpass API rule while downloading in JOSM.

(way["boundary"="administrative"];node(w); way(bn);); out meta;

Total boundary:administrative ways: 7809 of admin_level = 9 ways = 5082 of admin_level = 8 ways = 2717

I analyze the data and soon realize that there is a lot of overlapping ways, unjoined nodes with similar coordinates, and some areas that contain ways of admin_level=9 doesn’t have the father way of admin_level=8

I have prepared an script to take the highest admin_level ways, split their ways into segments and create as many boundary relations hierarchically as possible, for example, in this case, I can create the boundary relation of admin_level=8 by using the external borders of those relations with admin_level=9, and so on for the admin_level=7, etc… I will explain this algorithm in the next post when I release the script to the public.

My first task was to prepare the data(offline) before creating those relations. Therefore I had to deal with those duplicated nodes with exact same coordinates.

By using the following python script join_duplicated_nodes.py I eliminated the duplicity and joined all the duplicated nodes at once. (this task is equivalent to selecting one by one each of the nodes and clicking the ‘Merge nodes’ tool of JOSM), but you don’t want to waste that much time with 77657 nodes.

After executing the script, the total of nodes become 74936, so it joined almost 2700 nodes and we reduced the size of the OSM file a bit.

The second task was to get rid of those ways of admin_level=8 that overlap over those ways of admin_level=9 inside. In order to find out these duplicates, I made another python script(see detect_redundant_ways.py) but this time customized for the Indonesian boundary tags(you can change them to fit for your country or area context, you just need to understand the script).

Here is the result(the blue areas are those redundant level-8 ways that can be deleted in our local OSM to be ignored later on when creating the final boundary relations).

Keep tuned for the next post with the final conversion to boundary relations. Feedback wanted!

Location: RW 04, Gambir, Central Jakarta, Special Region of Jakarta, Java, 10110, Indonesia

Discussion

Comment from Adityo on 25 November 2015 at 10:01

Halo Ivan!

That’s amazing work you did! Thank you for fixing the Jakarta boundary match with new format. Looking forward to read your next post about fixing boundary. :)

Comment from ff5722 on 21 November 2016 at 15:43

According to this Wiki page, in Indonesia, boundary level 8 is for villages, and 9 for communities. Which one is right?

And you haven’t mentioned the exact source of this data. Did you use this as a source? https://www.petajakarta.org/banjir/en/data/v2/ In that case I should point out that Creative Commons Attribution 4.0 is not suitable for OSM use. (because OSM data cannot comply with showing the attribution to end users)

Comment from Kapis on 21 November 2016 at 15:46

Hi ff5722, the source was already the OSM data that HOT Indonesia had uploaded in opensstreetmap with permission from the local authorities of Jakarta for a local project concerning yearly floodings. That is: I didn’t find the data online. In case of any doubts concerning the license, you should contact them.

Comment from ff5722 on 21 November 2016 at 15:54

Oh that’s fine then! I’m still wondering if the admin_level is right. Of course how it looks on the standard layer is not that important, but having a 50m by 100m area tagged at the same level as a village seems flawed. Anyway, if I’m wrong here, it would be good if you or another mapper in Indonesia could update the wiki pages on this.

Comment from Kapis on 21 November 2016 at 16:02

Each village=DESA in indonesia contains Community Group (Rukun Warga=RW) which contains smaller Neighborhood Unit (Rukun Tetangga= RT), the RTs sometimes are just a couple of streets-length.

Log in to leave a comment