openmaptiles/qa/layer_numvar_analyze.sh

41 wiersze
810 B
Bash
Czysty Zwykły widok Historia

#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
layerid=$1
var=$2
echo "# NUMVAR-ANALYZE - $layerid - $var "
for z in {0..15}
do
echo " "
echo "## $layerid z$z - $var "
2016-12-15 11:59:59 +00:00
SQL=$(docker run --rm -v $(pwd):/tileset openmaptiles/openmaptiles-tools generate-sqlquery layers/${layerid}/${layerid}.yaml $z )
2016-12-04 18:07:03 +00:00
SQLCODE=$(cat <<-END
SELECT
count($var) as count
,min($var) as min
,max($var) as max
,avg($var) as avg
,stddev($var) as stddev
,variance($var) as variance
FROM
2016-12-15 11:59:59 +00:00
( $SQL ) as t
2016-12-04 18:07:03 +00:00
;
END
)
#echo "\`\`\`sql"
2016-12-03 01:11:50 +00:00
#echo "$SQLCODE"
#echo "\`\`\`"
docker-compose run --rm import-osm /usr/src/app/psql.sh -q -P pager=off -P border=2 -P footer=off -P null='(null)' -c "$SQLCODE" \
| sed '1d;$d' | sed '$d' | sed 's/+--/|--/g' | sed 's/--+/--|/g'
done