osm-garmin: various
parent
aa80a9ddaf
commit
bd59fa38d8
|
@ -23,10 +23,6 @@ function build_gmap() {
|
|||
build="true"
|
||||
build_failed="false"
|
||||
|
||||
if [[ -n "$style" ]]; then
|
||||
style="$styles_dir/$style.TYP"
|
||||
fi
|
||||
|
||||
mkdir -p "$generated_map_dir"
|
||||
|
||||
if [[ -f "$version_path" ]]; then
|
||||
|
@ -44,7 +40,8 @@ function build_gmap() {
|
|||
--gmapsupp \
|
||||
--index \
|
||||
--route \
|
||||
$tiles_dir/$region_shortname/6324*.osm.pbf $style
|
||||
$tiles_dir/$region_shortname/6324*.osm.pbf \
|
||||
"$styles_dir/$style.TYP"
|
||||
|
||||
[[ $? != 0 ]] && build_failed="true"
|
||||
cd "$cwd"
|
||||
|
@ -118,6 +115,9 @@ mkdir -p "$out_dir"
|
|||
mkdir -p "$tiles_dir"
|
||||
|
||||
regions_array="$(echo $regions | tr ";" "\n")"
|
||||
is_updates="false"
|
||||
|
||||
[[ $OSMGARMIN_FORCE_BUILD == "true" ]] && is_updates="true"
|
||||
|
||||
for region in $regions_array; do
|
||||
if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
|
||||
|
@ -127,22 +127,29 @@ for region in $regions_array; do
|
|||
|
||||
echo "✂️ Building tiles: $region"
|
||||
update_tiles "$region"
|
||||
|
||||
[[ $is_updates == "false" ]] && is_updates="true"
|
||||
else
|
||||
echo "⚠️ No updates to \"$region\""
|
||||
fi
|
||||
else
|
||||
echo "⚠️ Region \"$region\" does not exist"
|
||||
fi
|
||||
done
|
||||
|
||||
# TODO: Don't update this if there wasn't any updates
|
||||
echo "📒 Updating bounds..."
|
||||
update_bounds
|
||||
if [[ $is_updates == "true" ]]; then
|
||||
echo "📒 Updating bounds..."
|
||||
update_bounds
|
||||
|
||||
for region in $regions_array; do
|
||||
if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
|
||||
echo "🔨 Building Garmin map: $region"
|
||||
build_gmap "$region" "$style"
|
||||
fi
|
||||
done
|
||||
for region in $regions_array; do
|
||||
if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
|
||||
echo "🔨 Building Garmin map: $region"
|
||||
build_gmap "$region" "$style"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "⚠️ No new maps. Not building (set $$OSMGARMIN_FORCE_BUILD=true to override)"
|
||||
fi
|
||||
|
||||
echo "🧹 Cleaning up..."
|
||||
cleanup
|
|
@ -15,6 +15,7 @@ while :
|
|||
do
|
||||
regions="europe/great-britain"
|
||||
style=""
|
||||
first_run="true"
|
||||
|
||||
[[ -n "$OSMGARMIN_REGIONS" ]] && regions="$OSMGARMIN_REGIONS"
|
||||
[[ -n "$OSMGARMIN_STYLE" ]] && style="$OSMGARMIN_STYLE"
|
||||
|
|
Loading…
Reference in New Issue