cctv-010/scripts/04-call-overpass-api
2025-02-18 12:47:17 +01:00

18 lines
508 B
Bash
Executable File

#!/bin/bash
source $(dirname $0)/00-config
mkdir -p $WORKDATADIR/04
for qfile in $WORKDATADIR/03/*; do
outfile="$WORKDATADIR/04/$(basename $qfile).json"
if [ ! -s "$outfile" ]; then # replace with proper check if the file is formatted well
echo "------ querying $(basename $qfile) ------"
wget -O "$outfile" --post-file="$qfile" "https://maps.mail.ru/osm/tools/overpass/api/interpreter"
if [ "$?" != 0 ]; then
echo "an error occured"
rm "$outfile"
exit 1
fi
fi
done