From 51d0426388b8fa8ad411942139a626bbc83ef711 Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 14 Nov 2019 17:06:36 +0800 Subject: update --- utils/osm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'utils/osm') diff --git a/utils/osm b/utils/osm index 7f08a98..5fd5798 100644 --- a/utils/osm +++ b/utils/osm @@ -29,10 +29,10 @@ COMMANDS: osm.list.tags osm.get.id + osm.query osm.member.relation osm.pbf.update - osm.query - osm.update + osm.osm.update ' } util.osm.edit() { @@ -160,7 +160,7 @@ osm.file.get.full() { osmium getid $file $@ --output-format=osm --add-referenced } # $1 as osm file, $2 as diff file -osm.update() { +osm.osm.update() { while read -r line do array=( $(echo $line) ) @@ -171,20 +171,12 @@ osm.update() { /"; 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() { - echo "" - awk '{print "<" $1 " id=\"" $2 "\" version=\"NONE\""}' $1 - echo "" -} # create a new changeset osm.api.changeset.create() { @@ -219,6 +211,11 @@ osm.api.changeset.add() { sed -r "s/^( *<(node|way|relation).*version[^ ]+ )(.*)$/\1changeset=\"$1\">/" | \ curl -X PUT -u $OSM_USER_PASSWD -i -T - $OSM_API/$ele_type/$id } +osm.api.changeset.upload() { + cat $2 |\ + sed -r "/<(node|way|relation)/ s/>/ changeset=\"$1\">/" + #curl -X POST -u $OSM_USER_PASSWD -T - $OSM_API/changeset/$id/upload +} # update changeset with a new comment osm.api.changeset.update() { echo -n 'type comment: ' -- cgit v1.2.3-70-g09d2