diff options
Diffstat (limited to 'scripts/osm/osm.osc.create')
-rw-r--r-- | scripts/osm/osm.osc.create | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/osm/osm.osc.create b/scripts/osm/osm.osc.create new file mode 100644 index 0000000..61a4dfb --- /dev/null +++ b/scripts/osm/osm.osc.create | |||
@@ -0,0 +1,17 @@ | |||
1 | while read -r line | ||
2 | do | ||
3 | array=( $(echo $line) ) | ||
4 | |||
5 | cat $1 |\ | ||
6 | sed -nr " | ||
7 | /<$array[1] id=$array[2]/,/<\/$array[1]/ { | ||
8 | /<$array[1] id=$array[2]/ a \ \ \ \ <tag k=\"$array[3]\" v=$array[4]\/> | ||
9 | /<tag k=$array[3]/ !p | ||
10 | /<\/$array[1]/ q | ||
11 | }" >> $1.osc | ||
12 | done | ||
13 | |||
14 | sed -ir '1 i <osmChange version="0.6" generator="bash script"> | ||
15 | 1 i <modify> | ||
16 | $ a </modify> | ||
17 | $ a </osmChange>' $1.osc | ||