aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--utils/osm.utils.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/utils/osm.utils.sh b/utils/osm.utils.sh
index a3df88e..7716e41 100644
--- a/utils/osm.utils.sh
+++ b/utils/osm.utils.sh
@@ -25,9 +25,12 @@ osm.get.ids() {
25 sed -nr 's/.*<(node|way|relation) id=\"([^"]+)\".*/\1 \2/p' 25 sed -nr 's/.*<(node|way|relation) id=\"([^"]+)\".*/\1 \2/p'
26} 26}
27osm.upload() { 27osm.upload() {
28 #source <(cat fetch | sed 's/^/osm.extract /g' | sed 's/$/ <new.osm/g') 28 CHANGESET_ID=$(osm.changeset.create)
29 INPUT=$(cat -) 29
30 echo $INPUT | osm.get.ids | sed 's/.*/osm.extract \0 <($INPUT)/g' | xargs tee 30 cat - > /tmp/osm
31 source <(osm.get.ids < /tmp/osm |\
32 sed 's#.*#osm.extract \0 < /tmp/osm#g' |\
33 sed "s/.*/\0 \| osm.changeset.add $CHANGESET_ID/g")
31} 34}
32# query osm-related file with .osm format output 35# query osm-related file with .osm format output
33osm.file.query() { 36osm.file.query() {
@@ -60,8 +63,7 @@ osm.changeset.create() {
60 echo $info |\ 63 echo $info |\
61 curl -u $OSM_USER_PASSWD -i --upload-file - $SERVER/api/0.6/changeset/create |\ 64 curl -u $OSM_USER_PASSWD -i --upload-file - $SERVER/api/0.6/changeset/create |\
62 tee /dev/tty |\ 65 tee /dev/tty |\
63 tail -1 |\ 66 tail -1
64 xsel -ib
65} 67}
66# add a new element into changeset 68# add a new element into changeset
67osm.changeset.add() { 69osm.changeset.add() {