navit-project.org
http://forum.navit-project.org/

Adding elevation to the maps
http://forum.navit-project.org/viewtopic.php?f=6&t=618
Page 1 of 1

Author:  DrmCa [ 27 Nov 2016, 17:16 ]
Post subject:  Adding elevation to the maps

I often travel on the logging roads in the back country and it is important to know specific elevation for me, so I am wondering if there is a good and easy to follow write-up anywhere on adding elevation to the OpenStreetMaps used with Navit.
Can anyone please point me in the right direction?

If it matters, I am using the maps generated from Open Street Maps for Ontario,Canada.

Author:  Jandegr [ 31 Dec 2016, 17:00 ]
Post subject:  Re: Adding elevation to the maps

Hi,

The path to add elevation is collect SRTM data, convert to OSM using strm2osm and then let maptool turn it into a seperate navit map.
A bit of info here :
http://wiki.openstreetmap.org/wiki/Srtm2Osm

Navit will show heightlines on the map and sice a while you can also have some rudimentary heightprofile of a route in gui Internal
Image
For this the name of the map with heightlines must be something.heightlines.bin
(you can replace something with anything)
regards.

Author:  Jandegr [ 31 Dec 2016, 17:10 ]
Post subject:  Re: Adding elevation to the maps

And a view of the map with heightlines.
If you zoom in then labels show the altitude of the lines.

Image

Author:  DrmCa [ 17 Jan 2017, 01:00 ]
Post subject:  Re: Adding elevation to the maps

Tried this tool under Fedora 19 with mono and it crashed soon after starting, downloaded a handful of files only.
Guess I will have to find a Windows machine to try.

Author:  DrmCa [ 17 Jan 2017, 18:14 ]
Post subject:  Re: Adding elevation to the maps

Here's what I did on a Win 7 machine:
Tried downloading a map of Southern Ontario with portions of Quebec, upstate New York and some Michigan.
This did not work on a machine with 8 GB RAM as it ran out of memory at the very end of the process.

Then I moved to a machine with 16 GB RAM and it downloaded a 2650 MB file.

Tried to feed this file into maptool, but it died after allocating 112 MB RAM. Tried a handful of earlier versions as well and all crashed.

Then I downloaded smaller areas in Ontario, starting from 11 MB and up to 65 MB.
maptool crashed on all of them sooner or later, with the smallest 11 MB file getting much further according to the screen output.

So I have a bunch of OSM files which I do not know how to use with Navit.

Author:  DrmCa [ 29 Jan 2017, 13:59 ]
Post subject:  Re: Adding elevation to the maps

Any tips on how to use maptool to convert elevations to a map without it crashing?

Author:  zintor [ 01 Jun 2017, 19:27 ]
Post subject:  Re: Adding elevation to the maps

I sucessfully generated a heightline map with strm2osm under debian

Best regards,
zintor

Attachments:
heightline.PNG
heightline.PNG [ 105.48 KiB | Viewed 310 times ]

Author:  stephan58 [ 12 Jul 2017, 15:47 ]
Post subject:  Re: Adding elevation to the maps

A couple of years ago I converted SRTM3 data into contour maps to be used in
navit. I used phyghtmap and maptool under linux. As the SRTM3 files are one
degree square tiles, I also devised three scripts to help convert a number of
files in one go.

The proces:

Download the *.hgt.zip SRTM3 files of the region.
Extract the *.hgt files in a directory, e.g. in ~/contours.
Download phghtmap and install in /usr/local/bin.
Phyghtmap is used to convert the *.hgt files into .osm files.
Place the script hight2osm.sh in the directory ~/contours with the *.hgt files.

Script hgt2osm.sh:

for file in ´echo *.hgt´
do
/usr/local/bin/phyghtmap -0 ¨$file¨
done

Execute the script:
sudo sh ~/contours/hgt2osm.sh

Remarks:
- -0 is used to prevent the land contour.
- depending on the number of files and the processing power this may take a
considerable time.

Now remove the *.hgt files from the ~/contours directory:
rm ~/contours/*.hgt

Maptool is used to convert the .osm files into .bin files. In the .osm files you
now see ´><´. For maptool all labels must start a new line. Therefore the script
osm_label.sh is used. Place the script osm_label.sh in the directory ~/contours.

Script osm_label.sh:

for file in ´echo *.osm´
do
sed -i ´s/></>\n</g´ ¨$file¨
done

Execute the script:
sudo sh ~/contours/osm_label.sh

With the script osm2bin.sh maptool converts the osm files. Place the script
osm2bin.sh in the directory ~/contours.

Script osm2bin.sh:

for file in ´echo *.osm´
do
maptool -i ¨$file¨ ¨file¨.bin
done

Execute the script:
sudo sh ~/contours/osm2bin.sh

Remark:
-i to use the names of the input files.

Removing the *.osm files:
rm ~/contours/*.osm

As a result there remain files with the extension .osm.bin. E.g. with KRename
thes may be changed in .bin.

Remarks:
- Default phyghtmap gives contour steps of 20 m, 100 m for elevation medium and
200 m for elevation major.
- I don´t know how to make navit show the values in the contour lines.
- You have to place the contour .bin files in the ~/.navi/maps directory and to
enable them in the navit.xml file.
- In navit.xml you can change the way the contour lines are shown. My navit.xml
now has:

<layer name="heightlines">
<itemgra item_types="height_line_1" order="4-6">
<polyline color="#C48E48C8" width="1"/>
</itemgra>
<itemgra item_types="height_line_1" order="7">
<polyline color="#C48E48C8" width="2"/>
</itemgra>
<itemgra item_types="height_line_1" order="8-">
<polyline color="#C48E48C8" width="4"/>
<text text_size="8"/>
</itemgra>
<itemgra item_types="height_line_2" order="7">
<polyline color="#C48E48C8" width="1"/>
</itemgra>
<itemgra item_types="height_line_2" order="8-">
<polyline color="#C48E48C8" width="2"/>
<text text_size="8"/>
</itemgra>
<itemgra item_types="height_line_3" order="8-11">
<polyline color="#C48E48C8" width="1"/>
</itemgra>
<itemgra item_types="height_line_3" order="12-">
<polyline color="#C48E48C8" width="1"/>
<text text_size="8"/>
</itemgra>
</layer>

Author:  KaZeR [ 18 Jul 2017, 21:50 ]
Post subject:  Re: Adding elevation to the maps

We also recently fixed a bug that was preventing the elevation profile to be displayed correctly : https://github.com/navit-gps/navit/pull/294

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/