daily pastebin goal


a guest Feb 17th, 2013 18 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Since the OSM blogs are not able to display xml code with their Markdown stuff I post that entry here.  
  3. (This is mostly a note to myself.)  
  4. Download http://toolserver.org/~master/wiwosmlog/broken.php  
  6. I will work on a subset of that data:  
  7. grep mississippi broken.php> mississippi  
  10. Filter for the ways:  
  11. grep '"t":"w","l":""' mississippi > ways_mississippi  
  13. Look if there is an wikipedia entry for each object - assuming all objects in Mississippi are from english WP.  
  14. For not to overload anything I will limit the lookup to 100 objects:  
  15. for i in $(less ways_mississippi | cut -d '"' -f 16|head -n 100|sed s/" "/_/g); do firefox http://en.wikipedia.org/wiki/"$i"; done  
  17. Scroll through the opened tabs and watch carefully for glitches.  
  19. While doing so I download the data using Overpass API into one single file:  
  20. for i in $( less ways_mississippi | cut -d '"' -f 4|head -n 100); do wget - "http://overpass-api.de/api/interpreter?data=rel($i);out meta;" -O >> 100.osm ; done  
  22. Looking at the WP entries there is a "no article" for "D". The next in the row would be Bilox, so I have a look at the data in the file near "Bilox".  
  24.         <tag k="wikipedia" v="D&quot;Iberville,_Mississippi"/>    
  25. caused that hiccup. Since also the names in several values are messed up (great import) and a spammy bot added an useless tag I correct this and go on.    
  26.         <a href="http://www.openstreetmap.org/browse/way/32950385">Have a look at this way</a>.  
  28. Having found no further glitches while looking at the WP entries I can search and replace  
  29.         <tag k="wikipedia" v="  
  30. by  
  31.         <tag k="wikipedia" v="en:  
  33. Remove the following xml headers and footers from the single downloads piped into 100.osm except the first and the last:  
  34.         <?xml version="1.0" encoding="UTF-8"?>  
  35.         <osm version="0.6" generator="Overpass API">  
  36.         <note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>  
  37.         <meta osm_base="2013-02-17T10:24:01Z"/>  
  39.         </osm>  
  42. To replace underscores by blanks, I do the following:  
  43.         for i in $(grep ",_" 100.osm | grep wiki | grep _| cut -d '"' -f 4); do rpl "$i" "$(echo "$i"| sed s/"_"/" "/g)" 100.osm ; done  
  45. Now I open the file with JOSM and make a fake edit to tell JOSM that the objects are changed. I do add something like "foo=bar" and remove it again immediately.  
  46. To see if objects to upload are close to each other I now update the data (ctrl-u) which will fetch all depending stuff.  
  47. With ways that would be the nodes for the ways, with relations all their members.  
  48. Additionally we should get an conflict if any of the objects has been edited by an other user meanwhile. (Never had happened to me so far.)  
  50. To not make one awful big changeset I do the following:  
  52. Zoom to the region where the data is located.    
  53. Select one changed object using middle click (changed, not uploaded objects are shown bold)  
  54. If there are other changed objects in a reasonable distance select them too.  
  55. Upload the selection pressing ctrl-alt-shift-u, space, enter (enter/change the changeset comment), enter.  
  57. For better visualisation I've created a filter for "(child user:malenki) | user:malenki". After uploading some changes I press ctrl-alt-u and the objects selected, changed and uploaded will be hidden. Now I can see better which objects still remain.
  59. <a href="http://malenki.ch/OSM/Bilder/2013-02-17_142055_scr.png"><img src="http://malenki.ch/OSM/Bilder/2013-02-17_142055_scr.png" alt="JOSM with selected and filtered entries" width="500"/></a>
RAW Paste Data