From 8a2cafd2ee81046ad514024d072c4aab5b3d2281 Mon Sep 17 00:00:00 2001 From: Ducky Date: Sun, 1 Oct 2023 04:04:21 +0100 Subject: [PATCH] osm-garmin: various --- osm-garmin/app/build-gmap.sh | 53 ++++++++++++++++-------------------- osm-garmin/app/daemon.sh | 9 +----- 2 files changed, 24 insertions(+), 38 deletions(-) diff --git a/osm-garmin/app/build-gmap.sh b/osm-garmin/app/build-gmap.sh index e541b14..6f068d2 100755 --- a/osm-garmin/app/build-gmap.sh +++ b/osm-garmin/app/build-gmap.sh @@ -49,26 +49,13 @@ function build_gmap() { if [[ $build == "true" ]]; then cd "$build_dir" - family_name="osm-garmin" - - [[ -n $OSMGARMIN_MAP_FAMILY_NAME ]] && family_name="$OSMGARMIN_MAP_FAMILY_NAME" - - description="$(echo "${region##*/}" | sed -e "s/-/ /g" | sed -e "s/\b\(.\)/\u\1/g" | sed -e "s/ /-/g")" - product_id="$region_id" - product_version="$version_id" - exec_mkgmap \ + --description="$(echo "${region##*/}" | sed -e "s/-/ /g" | sed -e "s/\b\(.\)/\u\1/g" | sed -e "s/ /-/g")" \ --add-pois-to-areas \ - --area-name="$region" \ --bounds="$bounds_dir" \ - --description="$description" \ - --family-name="$family_name" \ - --product-id="$product_id" \ - --product-version="$product_version" \ - --series-name="$family_name" \ - --gmapsupp \ --index \ --route \ + --gmapsupp \ $tiles_dir/$region_shortname/6324*.osm.pbf \ "$styles_dir/$style.TYP" @@ -150,27 +137,33 @@ is_updates="false" [[ $OSMGARMIN_FORCE_BUILD == "true" ]] && is_updates="true" -for region in $regions_array; do - if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then - if [[ "$(check_osm_update "$region")" == "true" ]]; then - echo "🌍 Updating OSM map: $region" - update_osm_map "$region" +if [[ $OSMGARMIN_SKIP_UPDATE_MAPS != "true" ]]; then + for region in $regions_array; do + if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then + if [[ "$(check_osm_update "$region")" == "true" ]]; then + echo "🌍 Updating OSM map: $region" + update_osm_map "$region" - echo "✂️ Building tiles: $region" - update_tiles "$region" + echo "✂️ Building tiles: $region" + update_tiles "$region" - [[ $is_updates == "false" ]] && is_updates="true" + [[ $is_updates == "false" ]] && is_updates="true" + else + echo "⚠️ No updates to \"$region\"" + fi else - echo "⚠️ No updates to \"$region\"" + echo "⚠️ Region \"$region\" does not exist" fi - else - echo "⚠️ Region \"$region\" does not exist" - fi -done + done +else + is_updates="true" +fi if [[ $is_updates == "true" ]]; then - echo "📒 Updating bounds..." - update_bounds + if [[ $OSMGARMIN_SKIP_UPDATE_BOUNDS != "true" ]]; then + echo "📒 Updating bounds..." + update_bounds + fi region_id=1 diff --git a/osm-garmin/app/daemon.sh b/osm-garmin/app/daemon.sh index 7169249..9934671 100644 --- a/osm-garmin/app/daemon.sh +++ b/osm-garmin/app/daemon.sh @@ -13,14 +13,7 @@ function wait() { while : do - regions="europe/great-britain" - style="" - first_run="true" - - [[ -n "$OSMGARMIN_REGIONS" ]] && regions="$OSMGARMIN_REGIONS" - [[ -n "$OSMGARMIN_STYLE" ]] && style="$OSMGARMIN_STYLE" - - /app/build-gmap.sh "$regions" "$style" + /app/build-gmap.sh "$OSMGARMIN_REGIONS" "$OSMGARMIN_STYLE" if [[ $? == 0 ]]; then wait $sleep_time