Fixing routing errors from alternativaslibres faster

alternativaslibres.org provides several .zip files with routing errors from OpenStreetMap database. This .zip files contains several .txt files with this format:

2017/01/05 03:32:50 (RouteNode): 55114001.o5m: Roundabout (http://www.openstreetmap.org/browse/way/30983372) is connected to more than one road at http://www.openstreetmap.org/?mlat=39.475536&mlon=-6.399011&zoom=17 2017/01/05 03:32:50 (RouteNode): 55114001.o5m: Roundabout (http://www.openstreetmap.org/browse/way/311363264) is connected to more than one road at http://www.openstreetmap.org/?mlat=39.475971&mlon=-6.395029&zoom=17 2017/01/05 03:33:57 (RouteNode): 55114006.o5m: Roundabout (http://www.openstreetmap.org/browse/way/174438373) is connected to more than one road at http://www.openstreetmap.org/?mlat=38.885061&mlon=-4.352789&zoom=17 2017/01/05 03:35:07 (StyledConverter): 55114015.o5m: Roundabout 463667389 direction is wrong – reversing it (see http://www.openstreetmap.org/?mlat=40.487723&mlon=-3.181809&zoom=17) 2017/01/05 03:35:07 (StyledConverter): 55114015.o5m: Roundabout 463453323 direction is wrong – reversing it (see http://www.openstreetmap.org/?mlat=40.534629&mlon=-3.299410&zoom=17)

To fix one fo this errors, you should:

  1. Copy the way ID «30983372».
  2. Paste it in JOSM under «File->Download Object».
  3. Fix the error.
  4. Upload the changeset.
  5. Repeat from step 1.

This workflow is slow, so I tried to improve it with a little Bash «piping» under Linux:

start_line=1; file="Roundabouts_ESP.txt"; ids=$(cat $file | \
sed -n 's/.*way\/\([0-9]\+\).*/w\1/p' | sort -n | uniq | \ 
tail -n +$start_line | head -n 20 | tr '\n' ','); \
curl "http://localhost:8111/load_object?new_layer=false&objects=${ids}"

To use this new and faster workflow you need to open JOSM and enable remote control, then:

  1. Set «file» variable with the one you want to fix.
  2. Run the command. JOSM will load the ways to fix.
  3. Fix one error.
  4. Upload the changeset.
  5. Repeat from step 3 until all errors are corrected.
  6. Repeat from step 2, changing variable «start_line=X» from X to X+20.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *