From 6fae25b305d714b3ab7608fa003f1af9bf024545 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 14 Feb 2023 13:33:23 +0800 Subject: Rename tools into bin --- bin/osm/osm.api.changeset.add | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bin/osm/osm.api.changeset.add (limited to 'bin/osm/osm.api.changeset.add') diff --git a/bin/osm/osm.api.changeset.add b/bin/osm/osm.api.changeset.add new file mode 100755 index 0000000..3e4878e --- /dev/null +++ b/bin/osm/osm.api.changeset.add @@ -0,0 +1,10 @@ +#!/bin/sh + +element=$(cat) +header=$(echo $element | grep -E "<(node|way|relation)\s") +ele_type=$(echo $header | sed -r 's/.*<(node|way|relation).*$/\1/') +id=$(echo $header | sed -r 's/.* id=\"([^"]+)\".*$/\1/') + +echo $element | \ +sed -r "s/^( *<(node|way|relation).*version[^ ]+ )(.*)$/\1changeset=\"$1\">/" | \ +curl -X PUT -u $OSM_USER_PASSWD -i -T - $OSM_API/$ele_type/$id -- cgit v1.2.3-70-g09d2