Skip to content

Commit

Permalink
Merge pull request #5 from roballey/Mapiilary_Coverage
Browse files Browse the repository at this point in the history
(WIP) Render Mapiilary coverage
  • Loading branch information
roballey authored Feb 3, 2024
2 parents 8a80326 + c8ffbff commit 66b3cd6
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 55 deletions.
6 changes: 6 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Todo:
- Mapillary covergae specific:
- After checking on 955 merge in changes from this brnach back to master (loaded on 955 3-Jan-2024)
- Include script from ../Mapillary_Coverage_Maps_For_Garmin/ to download from Mapillary
- Try again generating seperate map as per ../Mapillary_Coverage_Maps_For_Garmin/ (sepereate map didn't show up on 955)
- Address TODOs in build/map.sh


- Look at modifying scripts to use external `getopt` instead of built-in getopts for parsing (and use long options).
- See:
Expand Down
34 changes: 30 additions & 4 deletions build/map.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
#
# Generate a routeable Garmin gmapsupp.img file from (split) OSM pbf files
#
# TODO: Make downloading and splitting part of this script for osm and mapillary files
##############################################################################

show_help() {
echo "Generate a Garmin image file from OSM pbf files"
echo "Options:"
echo " -c : Include contours in generated image"
echo " -m : Include Mapillary coverage in generated image"
echo " -h : Show this help"
echo " -r <REGION> : Specify the region to be generated, defaults to 'oceania_nz'"
echo " -s <STYLE> : Specify the style to be used to generate, defaults to 'route'"
Expand All @@ -26,16 +28,19 @@ region="oceania_nz"
style="route"
type="route"
contour=0
mapillary=0

# Parse command line options
while getopts hcr:s:t: opt; do
while getopts hcmr:s:t: opt; do
case $opt in
h)
show_help
exit 0
;;
c) contour=1
;;
m) mapillary=1
;;
r) region=$OPTARG
;;
s) style=$OPTARG
Expand All @@ -55,6 +60,7 @@ tmp_dir="work/tmp"
# Setup paths to the input files
input_osm_dir="work/osmsplitmaps/${region}"
input_contour_dir="work/contours/${region}"
input_mapillary_dir="work/mapillary/${region}"

# Setup path to output files
output_dir="maps/${style}/${region}"
Expand All @@ -64,10 +70,18 @@ echo "==========================================================================
echo "Converting OSM to Garmin for region ${region} using style ${style} and type ${type} rendering rules"
if [ $contour = 1 ]
then
echo "Including contours..."
echo " Including contours..."
else
echo "No contours..."
echo " No contours..."
fi

if [ $mapillary = 1 ]
then
echo " Including Mapillary coverage..."
else
echo " No Mapillary coverage..."
fi

echo "=================================================================================================="
echo "=================================================================================================="

Expand Down Expand Up @@ -105,8 +119,20 @@ else
inputs="${input_osm_dir}/*.pbf"
output_img="${output_dir}/gmapsupp.img"
fi
if [ $mapillary = 1 ]
then
echo "=================================================================================================="
echo "Setting Mapillary inputs"

if [ ! -d ${input_mapillary_dir} ]
then
echo "Mapillary files directory '${input_mapillary_dir}' does not exist"
exit 1
fi
inputs="${inputs} ${input_mapillary_dir}/sequences.osm"
fi

# Create directories (including parent directories) if they dont exist
# Create output and temp directories (including parent directories) if they dont exist
echo "=================================================================================================="
echo "Building directories"
mkdir -p ${output_dir}
Expand Down
4 changes: 4 additions & 0 deletions styles/route.style/lines
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# for more information.

# RPA: Modified - Walkways, steps
# Added mapillary sequences

# Mapillary sequences
id=* { echo "Mapillary sequence ${id}" } [0x10a03 resolution 14]

addr:housenumber=* {set mkgmap:execute_finalize_rules=true}

Expand Down
103 changes: 52 additions & 51 deletions type/route.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Type=0x050,4
Type=0x055,4
Type=0x005,5
Type=0x01b,5
Type=0x01d,5
Type=0x038,5
Type=0x039,5
Type=0x03c,5
Expand All @@ -46,6 +45,7 @@ Type=0x053,5
Type=0x013,6
Type=0x018,6
Type=0x01a,6
Type=0x01d,6
Type=0x051,6
Type=0x10104,6
Type=0x004,7
Expand Down Expand Up @@ -398,7 +398,7 @@ String1=0x02,Meer
String2=0x04,sea
ExtendedLabels=N
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
[end]


Expand All @@ -413,7 +413,7 @@ CustomColor=DayAndNight
DaycustomColor:#1D4DFF
NightcustomColor:#808080
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
[end]


Expand All @@ -426,7 +426,7 @@ ExtendedLabels=Y
FontStyle=NoLabel (invisible)
CustomColor=No
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
[end]


Expand All @@ -440,7 +440,7 @@ CustomColor=DayAndNight
DaycustomColor:#1D4DFF
NightcustomColor:#808080
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
[end]


Expand All @@ -455,7 +455,7 @@ CustomColor=DayAndNight
DaycustomColor:#1D4DFF
NightcustomColor:#808080
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
[end]


Expand All @@ -468,7 +468,7 @@ ExtendedLabels=Y
FontStyle=NoLabel (invisible)
CustomColor=No
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
[end]


Expand Down Expand Up @@ -624,7 +624,7 @@ String2=0x04,Mud
ExtendedLabels=N
Xpm="32 32 2 1"
"# c #606060"
"! c #72CEFF"
"! c #49BDFF"
"!!!!####!!!!!!!!!!!!####!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Expand Down Expand Up @@ -1096,7 +1096,7 @@ Type=0x18
UseOrientation=N
LineWidth=2
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
String1=0x02,Bach
String2=0x04,stream
ExtendedLabels=N
Expand Down Expand Up @@ -1176,7 +1176,7 @@ Type=0x1f
UseOrientation=N
LineWidth=3
Xpm="0 0 1 0"
"1 c #72CEFF"
"1 c #49BDFF"
String1=0x02,Fluss
String2=0x04,river
ExtendedLabels=Y
Expand Down Expand Up @@ -1461,7 +1461,7 @@ Type=0x10a02
;GRMN_TYPE: Water Features/INTERMITTENT_STREAM(NT)/Intermittent or dry stream, creek, or ditch/NT
UseOrientation=Y
Xpm="32 1 2 1"
"! c #72CEFF"
"! c #49BDFF"
" c none"
"!!!!!!! !!!!!!! !!!!!!! !!!!!!! "
;12345678901234567890123456789012
Expand All @@ -1470,6 +1470,23 @@ String2=0x04,intermittent stream
ExtendedLabels=N
[end]

[_line]
Type=0x10a03
;GRMN_TYPE: ???
UseOrientation=N
Xpm="32 5 2 1"
"! c #00FF00"
" c none"
"!!!!!! !!!!!! !!!!!! !!!!!! "
" "
" "
" "
"!!!!!! !!!!!! !!!!!! !!!!!! "
;12345678901234567890123456789012
String1=0x04,Mapillary Sequence
ExtendedLabels=N
[end]


;====================== POINTS ==========================

Expand Down Expand Up @@ -2933,47 +2950,31 @@ String2=0x04,Bench
ExtendedLabels=Y
FontStyle=NoLabel (invisible)
CustomColor=No
DayXpm="20 20 19 2" Colormode=32
"!! c #000000" alpha=15
"!# c #FFFFFF" alpha=0
"!% c #C6B59A" alpha=0
"!? c #734A08" alpha=0
"!$ c #7A5415" alpha=0
"!* c #D7CBB8" alpha=0
"!= c #8E6D38" alpha=0
"!1 c #836026" alpha=0
"!2 c #754C0B" alpha=0
"!3 c #CBBBA2" alpha=0
"!4 c #BCA989" alpha=0
"!5 c #87642B" alpha=0
"!6 c #7C5518" alpha=0
"!7 c #764E0D" alpha=0
"!8 c #92723F" alpha=0
"!9 c #AE9771" alpha=0
"#! c #A28659" alpha=0
"## c #A28759" alpha=0
"#% c #AD956E" alpha=0
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!%!?!?!?!?!?!?!?!?!?!?!$!?!?!?!?!?!*!!"
"!!!!!!!!!!!?!=!!!!!!!!!!!!!1!2!!!!!!!!!!"
"!!!!!!!!!!!?!3!!!!!!!!!!!!!4!?!!!!!!!!!!"
"!!!!!!!!!!!5!6!!!!!!!!!!!!!7!8!!!!!!!!!!"
"!!!!!!!!!!!?!9!!!!!!!!!!!!#!!?!!!!!!!!!!"
"!!!!!!!!!!##!?!!!!!!!!!!!!!?#%!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
DayXpm="20 20 2 1" Colormode=32
" c None"
". c #000000"
" "
" "
" "
" "
" "
" "
" "
" "
" "
" .................. "
" .................. "
" .. .. "
" .. .. "
" .. .. "
" .. .. "
" .. .. "
" "
" "
" "
" "
;12345678901234567890
; Bench, changed to bolder, black 24-Dec-2023
[end]


Expand Down

0 comments on commit 66b3cd6

Please sign in to comment.