2
0
Fork 0

osm-garmin: various

main
Ducky 2023-10-01 02:10:17 +01:00
parent 38e497d0ac
commit 534fc63d32
1 changed files with 18 additions and 3 deletions

View File

@ -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