View difference between Paste ID: QvaYSHE7 and YuLK54WK
SHOW: | | - or go back to the newest paste.
1
Since the OSM blogs are not able to display xml code with their Markdown stuff I post that entry here.  
2
3
(This is mostly a note to myself.)  
4
Download http://toolserver.org/~master/wiwosmlog/broken.php  
5
6
I will work on a subset of that data:  
7
grep mississippi broken.php> mississippi  
8
9
10
Filter for the ways:  
11
grep '"t":"w","l":""' mississippi > ways_mississippi  
12
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  
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  
16
17
Scroll through the opened tabs and watch carefully for glitches.  
18
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  
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  
21
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".  
23
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>.  
27
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:  
32
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"/>  
38
  
39
	</osm>  
40
41
42
To replace underscores by blanks, I do the following:  
43-
	for i in $(grep ",_" 100.osm &#124; grep wiki &#124; grep _&#124; cut -d '"' -f 4); do rpl "$i" "$(echo "$i"&#124; sed s/"_"/" "/g)" 100.osm ; done  
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  
44
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.)  
49
50
To not make one awful big changeset I do the following:  
51
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.  
56
57-
For better visualisation I've created a filter for "(child user:malenki) &#124; 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.
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.
58
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>