Elefix is a library to set elevation data to a list of latitude-longitude pairs. It also contains the scripts used to tune and evaluate the smoothing algorithm parameters.
In order to use this library you only need the following function:
set_altitudes(lats: List[float], lons: List[float], smooth: bool=True, window: int=151, polynom: int=2) -> List[float]
lats
andlons
are the latitudes and longitudes.- If
smooth
isFalse
the altitudes will be the originals retrieved from the SRTM digital elevation model. IfTrue
the SRTM altitudes are smoothed with Savitzky-Golay filter. window
andpolynom
are the filter's parameters. The defaults are optimized for mountain biking tracks.- Returns a
list
of altitudes.
I described the experiment I used to tune the parameters in this article (in process).
The scripts to train and test the parameters are included in evaluation/
. I optimized the parameters for mountain biking activities. You can optimize them for other type of activities with the scripts provided.
This library needs the SRTM database in binary format. In the directory bin/
You will find the utility script srtm_asc_to_bin.py
which helps you convert the ASCII database to the required format.
You can download the SRTM data from here: http://srtm.csi.cgiar.org/srtmdata
In this article I explain all the details of the project, from the motivation to the results and accuracy of the resulting altitude data.
(in process)
Zuhaitz Beloki <[email protected]>