From 534fc63d32b14aa1bb65ec4a0bae5661d7f78e10 Mon Sep 17 00:00:00 2001 From: Ducky Date: Sun, 1 Oct 2023 02:10:17 +0100 Subject: [PATCH] osm-garmin: various --- osm-garmin/app/build-gmap.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/osm-garmin/app/build-gmap.sh b/osm-garmin/app/build-gmap.sh index c90604c..fb5c65d 100755 --- a/osm-garmin/app/build-gmap.sh +++ b/osm-garmin/app/build-gmap.sh @@ -14,14 +14,15 @@ function build_gmap() { # Change ID (currently is 63240000) region="$1" - style="$2" + region_id="$2" + style="$3" region_shortname="$(get_region_shortname "$region")" generated_map_dir="$out_dir/$region_shortname/" bounds_dir_md5="$(get_md5_dir "$bounds_dir")" map_md5="$(get_md5 "$maps_dir/$region_shortname.osm.pbf")" - style_md5="$(get_md5 "$style_dir/$style.TYP")" + style_md5="$(get_md5 "$styles_dir/$style.TYP")" version="$(echo "$bounds_dir_md5|$map_md5|$style_md5" | md5sum | cut -d' ' -f1)" version_path="$generated_map_dir/version.txt" @@ -40,12 +41,23 @@ function build_gmap() { if [[ $build == "true" ]]; then cd "$build_dir" + family_name="" + product_id="$region_id" + product_version="$(date --utc +%y%j%H%M)" + + [[ -n $OSMGARMIN_MAP_FAMILY_NAME ]] && family_name="$OSMGARMIN_MAP_FAMILY_NAME" + exec_mkgmap \ --add-pois-to-areas \ + --area-name="$region" \ --bounds="$bounds_dir" \ + --family-name="$family_name" \ --gmapsupp \ --index \ + --product-id="$product_id" \ + --product-version="$product_version" \ --route \ + --series-name="$family_name" \ $tiles_dir/$region_shortname/6324*.osm.pbf \ "$styles_dir/$style.TYP" @@ -149,10 +161,13 @@ if [[ $is_updates == "true" ]]; then echo "📒 Updating bounds..." update_bounds + region_id=1 + for region in $regions_array; do if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then echo "🔨 Building Garmin map: $region" - build_gmap "$region" "$style" + build_gmap "$region" "$region_id" "$style" + ((region_id++)) fi done else