2
0
Fork 0

osm-garmin: improve performance

main
Ducky 2023-09-26 04:01:15 +01:00
parent dd11cc0f98
commit 3a68e552ca
2 changed files with 27 additions and 26 deletions

View File

@ -2,7 +2,7 @@
. /app/utils.sh . /app/utils.sh
region="$1" regions="$1"
style="$2" style="$2"
cwd="$(pwd)" cwd="$(pwd)"
@ -87,7 +87,7 @@ function update_bounds() {
} }
download_bounds "bounds" download_bounds "bounds"
#download_bounds "sea" download_bounds "sea"
} }
function update_osm_map() { function update_osm_map() {
@ -121,26 +121,35 @@ if [[ -z $region ]]; then
die "No region specified" die "No region specified"
fi fi
if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then regions_array="$(echo $regions | tr ";" "\n")"
echo "👀 Checking for OSM updates..."
if [[ "$(check_osm_update "$region")" == "true" ]]; then
[[ $? != 0 ]] && die "Region \"$region\" does not exist"
echo "🌍 Updating OSM map: $region" for region in $regions_array; do
update_osm_map "$region" if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
echo "👀 Checking OSM updates: $region"
echo "📒 Updating bounds and sea..." if [[ "$(check_osm_update "$region")" == "true" ]]; then
update_bounds echo "🌍 Updating OSM map: $region"
update_osm_map "$region"
echo "✂️ Building tiles: $region" echo "✂️ Building tiles: $region"
update_tiles "$region" update_tiles "$region"
fi
else
echo "⚠️ Region \"$region\" does not exist"
fi fi
done
echo "🔨 Building Garmin map: $region" echo "📒 Updating bounds..."
build_gmap "$region" "$style" update_bounds
else
[[ $? != 0 ]] && die "Region \"$region\" does not exist" for region in $regions_array; do
fi if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
echo "🔨 Building Garmin map: $region"
build_gmap "$region" "$style"
else
echo "⚠️ Region \"$region\" does not exist"
fi
done
echo "🧹 Cleaning up..." echo "🧹 Cleaning up..."
cleanup cleanup

View File

@ -10,15 +10,7 @@ do
[[ -n "$OSMGARMIN_REGIONS" ]] && regions="$OSMGARMIN_REGIONS" [[ -n "$OSMGARMIN_REGIONS" ]] && regions="$OSMGARMIN_REGIONS"
[[ -n "$OSMGARMIN_STYLE" ]] && style="$OSMGARMIN_STYLE" [[ -n "$OSMGARMIN_STYLE" ]] && style="$OSMGARMIN_STYLE"
regions_array="$(echo $regions | tr ";" "\n")" /app/build-gmap.sh "$regions" "$style"
for region in $regions_array; do
if [[ "$(check_osm_update "$region")" == "true" ]]; then
/app/build-gmap.sh "$region" "$style"
# TODO: Tear this apart so we can update the maps and bounds separately,
# then build all the maps afterwards (less wasteful!)
fi
done
sleep 3600 sleep 3600
done done