diff --git a/inputs/bbox/bbox4osmosis.sh b/inputs/bbox/bbox4osmosis.sh new file mode 100755 index 0000000..eaad9ee --- /dev/null +++ b/inputs/bbox/bbox4osmosis.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +bbox=$1 + +if [ -z "${bbox}" ]; then + echo "Usage: $0 [BBOX_FILE|BBOX_NAME]" > /dev/stderr + exit 1 +fi + +if [ ! -e "${bbox}" ]; then + bbox=inputs/bbox/${bbox}.bbox +fi + +if [ ! -e "${bbox}" ] || [ ! -r "${bbox}" ]; then + echo "File ${bbox} does not exist or is not readable." > /dev/stderr +fi + +cat ${bbox} | tr "," " " | xargs printf "bottom=%f left=%f top=%f right=%f"