aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/osm/osm.api.referenced.way8
-rwxr-xr-xscripts/osm/osm.goto4
-rwxr-xr-xscripts/osm/osm.list.tag18
-rwxr-xr-xscripts/osm/osm.list.tags24
-rwxr-xr-xscripts/osm/osm.osm.remove16
-rwxr-xr-xscripts/osm/osm.query4
6 files changed, 43 insertions, 31 deletions
diff --git a/scripts/osm/osm.api.referenced.way b/scripts/osm/osm.api.referenced.way
index b62ac58..1d84238 100755
--- a/scripts/osm/osm.api.referenced.way
+++ b/scripts/osm/osm.api.referenced.way
@@ -1,3 +1,5 @@
1 curl -X GET $OSM_API/node/$1/ways |\ 1#!/bin/bash
2 tee /tmp/osm &&\ 2
3 echo ways contain node $1 are copied into /tmp/osm > /dev/tty 3curl -X GET $OSM_API/node/$1/ways |\
4tee /tmp/osm &&\
5echo ways contain node $1 are copied into /tmp/osm > /dev/tty
diff --git a/scripts/osm/osm.goto b/scripts/osm/osm.goto
index 7da3394..25bceaa 100755
--- a/scripts/osm/osm.goto
+++ b/scripts/osm/osm.goto
@@ -1 +1,3 @@
1 xdg-open https://www.openstreetmap.org/$1/$2 1#!/bin/sh
2
3xdg-open https://www.openstreetmap.org/$1/$2
diff --git a/scripts/osm/osm.list.tag b/scripts/osm/osm.list.tag
index 3d5157d..76649a0 100755
--- a/scripts/osm/osm.list.tag
+++ b/scripts/osm/osm.list.tag
@@ -1,8 +1,10 @@
1 ele_pattern="(node|way|relation)" 1#!/bin/bash
2 sed -nr "/<$ele_pattern/,/<\/$ele_pattern/ { 2
3 /<tag k=\"$1\"/ { 3ele_pattern="(node|way|relation)"
4 s/.*v=\"([^\"]+)\".*/\1/ 4sed -nr "/<$ele_pattern/,/<\/$ele_pattern/ {
5 h 5 /<tag k=\"$1\"/ {
6 } 6 s/.*v=\"([^\"]+)\".*/\1/
7 /<\/$ele_pattern/ {x;p;s/.*//;x} 7 h
8 }" 8 }
9 /<\/$ele_pattern/ {x;p;s/.*//;x}
10}"
diff --git a/scripts/osm/osm.list.tags b/scripts/osm/osm.list.tags
index 6fe4da4..767d32a 100755
--- a/scripts/osm/osm.list.tags
+++ b/scripts/osm/osm.list.tags
@@ -1,13 +1,15 @@
1 content=$(cat) 1#!/bin/bash
2 echo $content | osm.list.ids | tr ' ' ',' > /tmp/osm
3 2
4 for tag in $@ 3content=$(cat)
5 do 4echo $content | osm.list.ids | tr ' ' ',' > /tmp/osm
6 echo $content |\
7 osm.list.tag $tag |\
8 paste -d',' /tmp/osm - > /tmp/osm.new &&\
9 mv /tmp/osm.new /tmp/osm
10 done
11 5
12 cat /tmp/osm 6for tag in $@
13 echo "\ntag list is also copied into /tmp/osm" > /dev/tty 7do
8 echo $content |\
9 osm.list.tag $tag |\
10 paste -d',' /tmp/osm - > /tmp/osm.new &&\
11 mv /tmp/osm.new /tmp/osm
12done
13
14cat /tmp/osm
15echo "\ntag list is also copied into /tmp/osm" > /dev/tty
diff --git a/scripts/osm/osm.osm.remove b/scripts/osm/osm.osm.remove
index fbbaf0c..83d6ea8 100755
--- a/scripts/osm/osm.osm.remove
+++ b/scripts/osm/osm.osm.remove
@@ -1,7 +1,9 @@
1 while read -r line 1#!/bin/bash
2 do 2
3 # put element type and element ID into array 3while read -r line
4 array=( $(echo $line) ) 4do
5 cat $1 |\ 5 # put element type and element ID into array
6 sed -i "/<$array[1] id=\"$array[2]\"/,/<\/$array[1]>/ d" 6 array=( $(echo $line) )
7 done 7 cat $1 |\
8 sed -i "/<$array[1] id=\"$array[2]\"/,/<\/$array[1]>/ d"
9done
diff --git a/scripts/osm/osm.query b/scripts/osm/osm.query
index fd48fd2..8d0b9f7 100755
--- a/scripts/osm/osm.query
+++ b/scripts/osm/osm.query
@@ -1 +1,3 @@
1 osmium tags-filter - $@ --input-format=osm --output-format=osm --omit-referenced 1#!/bin/bash
2
3osmium tags-filter - $@ --input-format=osm --output-format=osm --omit-referenced