Add small script to generate bounding-box argument from bbox files.

This commit is contained in:
Mikaël Capelle 2018-02-25 01:16:00 +01:00
parent 086952022a
commit 42b48699d1

18
inputs/bbox/bbox4osmosis.sh Executable file
View File

@ -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"