OpenStreetMap logo OpenStreetMap

cleaning up after a task manager task

Posted by Johnwhelan on 1 January 2022 in English. Last updated on 3 January 2022.

In the ideal world all tasks would be validated to a high standard but unfortunately this doesn’t happen.

I’ve seen HOT projects with nearly two thousand duplicate buildings, I’ve seen some with two or three hundred untagged buildings. Some are well mapped and have no errors.

So this a method to clean up after the event. Basically you load up the area into JOSM and run the duplicate building script and JOSM validator. It won’t catch everything but it’s a lot faster than validating each tile. The todo and Mapathoner plugin are required.

select the errors then add them to the todo list and work your way through them.

The key is aoiBBOX”: [6.473334,5.172193,6.870011,5.730142] which is found here: https://tasking-manager-tm4-production-api.hotosm.org/api/v2/projects/10756 for project 10756. You’ll need to search the text to extract it.

You can either feed these coordinates into JOSM and download the area directly or feed them into an overpass query or extract them from an off line version of the map. https://osm-internal.download.geofabrik.de/ is one source. If you work with the off line version you can locate the errors then just directly redownload the tiny bit to ensure the map is up to date before you correct the error.

An example of a .bat file to extract the area from an offline file is osmconvert64 e:\downloads\nigeria-latest-internal.osm.pbf -b=6.473334,5.172193,6.870011,5.730142 -o=f:\maps\nigeria10756.osm Just load nigeria10756.osm as a local file into JOSM.

Note this is not validation since no feedback is given in task manager to the mapper. It is recommended it is used when there are no active mapping taking place so a month or so after the mapping has petered out is a good time.

Discussion

Comment from gileri on 2 January 2022 at 16:27

Thank you for this write-up and fixes !

Comment from qeef on 3 January 2022 at 13:04

Hi Johnwhelan, just for you information, Mike’s scripts are available in the mapathoner plugin, too. It’s just a simplification of running the scripts.

Comment from Johnwhelan on 3 January 2022 at 14:04

Thank you both for the comments.

Note to qeef Is there a write up somewhere about Mapathoner and how to use it?

Many Thanks

John

Comment from Johnwhelan on 3 January 2022 at 14:18

Note to qeef I’ve amended the original to mention mapathoner plugin rather than use a script from a third party source.

Thanks John

Comment from mariotomo on 3 January 2022 at 21:09

Hi John, thanks for this diary entry,

I interpret your hint as having an extra post-validation quality check, on each HOT project. once the project gets closed, moves from Published to Archived, it would need going through this sort of acceptance step. I have followed projects in Panamá, being closed just like that, and I think that such an acceptance step would be quite useful.

Regarding the polygon of projects, I use this tiny python script to grab the perimeter of HOT tasks in osm format. Once you open it in JOSM, make sure you keep it in a separate layer apart from the OSM data, or you might inadvertently upload it to OSM.

#!/usr/bin/env python3

import sys
import requests

if len(sys.argv) != 2:
    sys.exit(-1)

info = requests.get(f"https://tasking-manager-tm4-production-api.hotosm.org/api/v2/projects/{sys.argv[1]}/queries/aoi/")
print("""\
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='never' generator='JOSM'>""")

i = 0
points = info.json()['coordinates'][0][0]

for point in points:
    i += 1
    print(f"  <node id='-{i}' lat='{point[1]}' lon='{point[0]}' />")

print(f"  <way id='-{len(points)}'>")

for i in range(len(points)):
    print(f"    <nd ref='-{i+1}' />")
print("    <nd ref='-1' />")

print("""\
  </way>
</osm>""")

Comment from qeef on 3 January 2022 at 23:39

Once you open it in JOSM, make sure you keep it in a separate layer apart from the OSM data

I tested it with imported GeoJSON file and it looks like that right click on new layer and Convert to GPX layer does the trick.

Johnwhelan: thanks for the inspiration, I wrote the similar diary for the Divide and map. Now.

Comment from Johnwhelan on 4 January 2022 at 14:47

I interpret your hint as having an extra post-validation quality check, on each HOT project. once the project gets closed, moves from Published to Archived, it would need going through this sort of acceptance step. I have followed projects in Panamá, being closed just like that, and I think that such an acceptance step would be quite useful.

The process can be used on archived projects, or even on live projects. Duplicate buildings and untagged buildings can be corrected even with live mappers mapping. Just quickly download just the error asset once more, correct and upload.

If an NGO wants to use the map then the faster it is corrected the better but I agree having a formal step before archiving would help diminish the errors lying around the map after an inexperienced mapper has been in..

Log in to leave a comment