From 96384f23883b0f5447f7eac355bdfdda1ccc8863 Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 14 Nov 2019 02:23:39 +0800 Subject: update --- utils/osm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'utils') diff --git a/utils/osm b/utils/osm index 532d133..43fd9f6 100644 --- a/utils/osm +++ b/utils/osm @@ -171,6 +171,24 @@ osm.update() { sed '' fi } +# $1 as osm file, $2 as diff file +osm.update2() { + while read -r line + do + array=( $(echo $line) ) + + cat $1 |\ + sed -nr "/<$array[1] id=$array[2]/,/<\/$array[1]/ { + /<$array[1] id=$array[2]/ a \ \ \ \ + /"; else print $0} + ' > $1.updated + done +} # $1 as .osm file $2 as list of change content # use Diff upload: POST /api/0.6/changeset/#id/upload maybe? osm.osc.create() { -- cgit v1.2.3-70-g09d2