diff options
author | typebrook <typebrook@gmail.com> | 2019-11-14 02:23:39 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2019-11-14 02:23:39 +0800 |
commit | 96384f23883b0f5447f7eac355bdfdda1ccc8863 (patch) | |
tree | c05df83f19235a7384d9e0be7ea6d23950697e05 /utils/osm | |
parent | 0d6adfe752875aa1e4a985dbd92509af7f1fbdf8 (diff) |
update
Diffstat (limited to 'utils/osm')
-rw-r--r-- | utils/osm | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -171,6 +171,24 @@ osm.update() { | |||
171 | sed '' | 171 | sed '' |
172 | fi | 172 | fi |
173 | } | 173 | } |
174 | # $1 as osm file, $2 as diff file | ||
175 | osm.update2() { | ||
176 | while read -r line | ||
177 | do | ||
178 | array=( $(echo $line) ) | ||
179 | |||
180 | cat $1 |\ | ||
181 | sed -nr "/<$array[1] id=$array[2]/,/<\/$array[1]/ { | ||
182 | /<$array[1] id=$array[2]/ a \ \ \ \ <tag k=$array[3] v=$array[4]\/> | ||
183 | /<tag k=$array[3]/ !p | ||
184 | /<\/$array[1]/ q | ||
185 | }" |\ | ||
186 | awk -F"\"" ' | ||
187 | BEGIN{OFS="\""} | ||
188 | {if(NR==1) print $1,$2,$3,$4+1,">"; else print $0} | ||
189 | ' > $1.updated | ||
190 | done | ||
191 | } | ||
174 | # $1 as .osm file $2 as list of change content | 192 | # $1 as .osm file $2 as list of change content |
175 | # use Diff upload: POST /api/0.6/changeset/#id/upload maybe? | 193 | # use Diff upload: POST /api/0.6/changeset/#id/upload maybe? |
176 | osm.osc.create() { | 194 | osm.osc.create() { |