#!/bin/bash set -e OSM2PGSQL=osm2pgsql DATABASE=gis DATABASE_BORDERS=borders OSM2PGSQL_KEYS='--cache 2000 --number-processes 6' OSM2PGSQL_STYLE= if [[ "`uname`" == 'Darwin' ]]; then WHICH='which -s' MKTEMP='mktemp -t ' else WHICH=which MKTEMP='mktemp --suff=' fi if ! $WHICH $OSM2PGSQL; then echo "No osm2pgsql found." exit 1 fi # Load filtered data into an osm2pgsql database echo Loading data into the database # Creating a style file if we weren't provided with one if [ -z "$OSM2PGSQL_STYLE" ]; then OSM2PGSQL_STYLE=$(${MKTEMP}osm2pgsql_style) OSM2PGSQL_STYLE_TMP=1 cat > $OSM2PGSQL_STYLE <