aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/osm/osm.api.changeset.add
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-02-27 16:32:37 +0800
committertypebrook <typebrook@gmail.com>2020-02-27 16:32:37 +0800
commit00b136155183ae522ca458e540a8cf29bf525e74 (patch)
treec6e9d20d5021c95afc7149456d57eb435d808150 /tools/osm/osm.api.changeset.add
parent3fa79eb14a4c0244fb2dc4a5b805b7cffaa63770 (diff)
update
Diffstat (limited to 'tools/osm/osm.api.changeset.add')
-rwxr-xr-xtools/osm/osm.api.changeset.add10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/osm/osm.api.changeset.add b/tools/osm/osm.api.changeset.add
new file mode 100755
index 0000000..3e4878e
--- /dev/null
+++ b/tools/osm/osm.api.changeset.add
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3element=$(cat)
4header=$(echo $element | grep -E "<(node|way|relation)\s")
5ele_type=$(echo $header | sed -r 's/.*<(node|way|relation).*$/\1/')
6id=$(echo $header | sed -r 's/.* id=\"([^"]+)\".*$/\1/')
7
8echo $element | \
9sed -r "s/^( *<(node|way|relation).*version[^ ]+ )(.*)$/\1changeset=\"$1\">/" | \
10curl -X PUT -u $OSM_USER_PASSWD -i -T - $OSM_API/$ele_type/$id