diff --git a/docker_build.sh b/docker_build.sh index 1c0a8e1..9f02278 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -37,4 +37,4 @@ export PBF2JSON_FILE="${PBF_FILES[0]}" export POLYLINE_FILE="${POLYLINE_FILES[0]}" # run the build -exec ./script/build.sh +exec ./script/build.sh $@ diff --git a/script/build.sh b/script/build.sh index e822c15..003dc0d 100755 --- a/script/build.sh +++ b/script/build.sh @@ -48,18 +48,27 @@ if type pigz >/dev/null then pigz -k -c --best "$BUILDDIR/street.db" > "$BUILDDIR/street.db.gz"; else gzip -c --best "$BUILDDIR/street.db" > "$BUILDDIR/street.db.gz"; fi - -# run openaddresses conflation -echo "- conflating openaddresses" -$DIR/conflate_oa.sh; - -# run openstreetmap conflation -echo "- conflating openstreetmap" -$DIR/conflate_osm.sh; - -# run tiger conflation -echo "- conflating tiger" -$DIR/conflate_tiger.sh; +#joined catches all additional arguments given to the script into a single string +joined="$*" +if [[ "$joined" =~ "oa" || $# -eq 0 ]]; then + # run openaddresses conflation + echo "- conflating openaddresses" + $DIR/conflate_oa.sh; +fi +if [[ "$joined" =~ "osm" || $# -eq 0 ]]; then + # run openstreetmap conflation + echo "- conflating openstreetmap" + $DIR/conflate_osm.sh; +fi +if [[ "$joined" =~ "tiger" || $# -eq 0 ]]; then + # run tiger conflation + echo "- conflating tiger" + $DIR/conflate_tiger.sh; +fi +#If we don't hit any of the above, but additional arguments were given we don't run any conflation and exit with 22. +if [[ ! "$joined" =~ "tiger" ]] && [[ ! "$joined" =~ "osm" ]] && [[ ! "$joined" =~ "oa" ]] && [[ $# -gt 0 ]]; then + echo "No valid conflation source specified, running no conflations"; exit 22; +fi # run vertex interpolation echo "- interpolating vertices"