From d1189207af450b300415109b46f9d0bc234c8059 Mon Sep 17 00:00:00 2001 From: arnesetzer <25772747+arnesetzer@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:38:27 +0200 Subject: [PATCH 1/5] feat(docker): Allow the docker version to run only specific interpolation types. --- docker_build.sh | 2 +- script/build.sh | 45 +++++++++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 13 deletions(-) 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..502b79c 100755 --- a/script/build.sh +++ b/script/build.sh @@ -48,22 +48,43 @@ 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 - +joined="$*" +#If we have arguments only conflate the ones specified +if [[ $# -gt 0 ]]; then + if [[ "$joined" =~ "oa" ]]; then + # run openaddresses conflation + echo "- conflating only openaddresses" + $DIR/conflate_oa.sh; + fi + if [[ "$joined" =~ "osm" ]]; then + # run openstreetmap conflation + echo "- conflating only openstreetmap" + $DIR/conflate_osm.sh; + fi + if [[ "$joined" =~ "tiger" ]]; then + # run tiger conflation + echo "- conflating only tiger" + $DIR/conflate_tiger.sh; + fi +#If no arguments are given, run all conflations (backwards compatible) +else # run openaddresses conflation -echo "- conflating openaddresses" -$DIR/conflate_oa.sh; + echo "- conflating openaddresses" + $DIR/conflate_oa.sh; + + # run openstreetmap conflation + echo "- conflating openstreetmap" + $DIR/conflate_osm.sh; -# run openstreetmap conflation -echo "- conflating openstreetmap" -$DIR/conflate_osm.sh; + # run tiger conflation + echo "- conflating tiger" + $DIR/conflate_tiger.sh; -# run tiger conflation -echo "- conflating tiger" -$DIR/conflate_tiger.sh; + # run vertex interpolation + echo "- interpolating vertices" + $DIR/vertices.sh; +fi -# run vertex interpolation -echo "- interpolating vertices" -$DIR/vertices.sh; # archive address database (using parallel gzip when available) echo "- archiving address database" From 938242332f5f949281eaf426bdb05ded04df36a7 Mon Sep 17 00:00:00 2001 From: arnesetzer <25772747+arnesetzer@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:50:06 +0200 Subject: [PATCH 2/5] fix(docker): vertex interpolation should always run --- script/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/build.sh b/script/build.sh index 502b79c..01a3f58 100755 --- a/script/build.sh +++ b/script/build.sh @@ -80,11 +80,11 @@ else echo "- conflating tiger" $DIR/conflate_tiger.sh; - # run vertex interpolation - echo "- interpolating vertices" - $DIR/vertices.sh; fi +# run vertex interpolation + echo "- interpolating vertices" + $DIR/vertices.sh; # archive address database (using parallel gzip when available) echo "- archiving address database" From 67d13b17911c41d6e44737f3e4ef9fa2eaed8a70 Mon Sep 17 00:00:00 2001 From: arnesetzer <25772747+arnesetzer@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:22:35 +0200 Subject: [PATCH 3/5] fix(docker): Show error message if no valid data source for conflation was --- script/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/build.sh b/script/build.sh index 01a3f58..1629e6a 100755 --- a/script/build.sh +++ b/script/build.sh @@ -66,6 +66,10 @@ if [[ $# -gt 0 ]]; then echo "- conflating only tiger" $DIR/conflate_tiger.sh; fi + #If we don't hit any of the above, we don't run any conflation + if [[ ! "$joined" =~ "tiger" ]] && [[ ! "$joined" =~ "osm" ]] && [[ ! "$joined" =~ "oa" ]]; then + echo "No valid conflation source specified, running no conflations"; exit 22; + fi #If no arguments are given, run all conflations (backwards compatible) else # run openaddresses conflation From 80bcdd57c9f46e71bb67f17d6fde34c6675eb786 Mon Sep 17 00:00:00 2001 From: arnesetzer <25772747+arnesetzer@users.noreply.github.com> Date: Fri, 8 Aug 2025 08:45:11 +0200 Subject: [PATCH 4/5] style: minimze code due to feedback --- script/build.sh | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/script/build.sh b/script/build.sh index 1629e6a..44c2d03 100755 --- a/script/build.sh +++ b/script/build.sh @@ -49,41 +49,24 @@ if type pigz >/dev/null else gzip -c --best "$BUILDDIR/street.db" > "$BUILDDIR/street.db.gz"; fi joined="$*" -#If we have arguments only conflate the ones specified -if [[ $# -gt 0 ]]; then - if [[ "$joined" =~ "oa" ]]; then - # run openaddresses conflation - echo "- conflating only openaddresses" - $DIR/conflate_oa.sh; - fi - if [[ "$joined" =~ "osm" ]]; then - # run openstreetmap conflation - echo "- conflating only openstreetmap" - $DIR/conflate_osm.sh; - fi - if [[ "$joined" =~ "tiger" ]]; then - # run tiger conflation - echo "- conflating only tiger" - $DIR/conflate_tiger.sh; - fi - #If we don't hit any of the above, we don't run any conflation - if [[ ! "$joined" =~ "tiger" ]] && [[ ! "$joined" =~ "osm" ]] && [[ ! "$joined" =~ "oa" ]]; then - echo "No valid conflation source specified, running no conflations"; exit 22; - fi -#If no arguments are given, run all conflations (backwards compatible) -else -# run openaddresses conflation - echo "- conflating openaddresses" +if [[ "$joined" =~ "oa" || $# -eq 0 ]]; then + # run openaddresses conflation + echo "- conflating only openaddresses" $DIR/conflate_oa.sh; - +fi +if [[ "$joined" =~ "osm" || $# -eq 0 ]]; then # run openstreetmap conflation - echo "- conflating openstreetmap" + echo "- conflating only openstreetmap" $DIR/conflate_osm.sh; - +fi +if [[ "$joined" =~ "tiger" || $# -eq 0 ]]; then # run tiger conflation - echo "- conflating tiger" + echo "- conflating only tiger" $DIR/conflate_tiger.sh; - +fi +#If we don't hit any of the above, we don't run any conflation +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 From 6cf2dca769d9a65c9ea3c947e1a3e711a6a3c4ed Mon Sep 17 00:00:00 2001 From: arnesetzer <25772747+arnesetzer@users.noreply.github.com> Date: Fri, 8 Aug 2025 08:52:09 +0200 Subject: [PATCH 5/5] style: formatting --- script/build.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/script/build.sh b/script/build.sh index 44c2d03..003dc0d 100755 --- a/script/build.sh +++ b/script/build.sh @@ -48,30 +48,31 @@ 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 +#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 only openaddresses" + echo "- conflating openaddresses" $DIR/conflate_oa.sh; fi if [[ "$joined" =~ "osm" || $# -eq 0 ]]; then # run openstreetmap conflation - echo "- conflating only openstreetmap" + echo "- conflating openstreetmap" $DIR/conflate_osm.sh; fi if [[ "$joined" =~ "tiger" || $# -eq 0 ]]; then # run tiger conflation - echo "- conflating only tiger" + echo "- conflating tiger" $DIR/conflate_tiger.sh; fi -#If we don't hit any of the above, we don't run any conflation +#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" - $DIR/vertices.sh; +echo "- interpolating vertices" +$DIR/vertices.sh; # archive address database (using parallel gzip when available) echo "- archiving address database"