\( \def\bold#1{\bf #1} \newcommand{\d}{\mathrm{d}} \) BTP: Manual and Source Code Documentation

Power Uphill

bike mass [kg]
body mass [kg]
altitude gain [m]
climb length [km]
gradient [%]
time [s]
speed [km/h]
power [W]
power/mass [W/kg]
climbrate [m/min]

average power on climb stage

BTP  3.0
Routing/ClimbAnalysis/PowerCalculation
 All Classes Namespaces Functions Variables Pages
Manual and Source Code Documentation

Introduction

This is BergTourenPlaner 3, an offline map resource, routing and analysing system written for passionated climbers on bike. The Program is based on OpenStreetMap (OSM) data and the Digital Elevation Model (DEM) SRTM3 of the NASA.

Beside the ordenary shortes path Dijkstra routing algorithm BTP3 provides routing routines to route paths with least altitude gain (i.g. least vertical or height meters (Hm)) as well as paths with maximized Hm, in the following called STRONG algorithm, with the associated Track called STRONG. Second important thing is Power analysis to calculate average power output at user defined rider profil and external conditions. This also works for gpx tracks with existing time stemps.

Last important thing is climb analyis, investigating the whole street network for user defined climbs. Consequently maps with the calculated clibms can be calculated.

This is open source project, feel free to try out and enrich the code, written for Qt 5.1 and tested so far at XP, Win7 and Win8 machines. For beginning consider the following important classes:

MainWindow, MAP, Routing, STRONGcalc, PowerAnalysis, Track and WayHeight

Please report bugs and wishes to degga87[ at ]web.de.

Getting Started

Installation

You just have to copy the complete folder anywhere on your computer, no additional action is necessary.

SRTM3 DEM

SRTM3 data is necessary to render terrain and calculate street data from OSM data. SRTM3 consists of hgt files representing the while terrain within 1°x1°-area. Best source to get data is http://www.viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm. Download desired area files into a folder and reference it with settings->SRTM3 data folder. The map window will be instantly rerendered. Use DataProcessing->correct hgt-files to get rid of voids.

OSM map data

BTP3 works with btp files which are binary files generated from OSM data. I recommend downloading the desired data area from http://download.geofabrik.de/ , cutting the area with osmconvert to an *.osm file, which can be read with BTP3 via data->read osm. SRTM3 data should be present at the process, the process may take up to a hour. Maximum *.osm file size is 2 GB for 32 bit Windows, otherwise unlimited. Save the generate data via file->save btp. Please note that only the data viewed in the map window will be save. You might use this to cut your btp file into smaller pieces. IF no cutting is undesired you might zoom out sufficiently.

You can instruct BTP3 to load a btp file at program start with settings->btp startup file, otherwise data->load btp to load data.

Editing

Editing btp data is possible by pressing e. Select a way and assign new type with number keys od delete it.

Routing

The following algorithms are availavle:

  • shortes path (press k)
  • least height meters path (press f)
  • maximum Hm/km (press m)
  • STRONG (press s)
  • CLIMB (as STRONG, but muximizing total climb index (press c)
    By clicking a cross at the track you can pin it to fix sections, drag and drop to modify track is possible in routing modes k and f.
    There is Undo and Redo function called by z and y key which loads the last released track.
    Every routing mode can be done without end point pressing ENTER.
    Restrict the road size by specifying upper and lower allowed road type, pressing a number between 0 and 5 with our withour ctrl.

STRONG

The investigation of the shortes track with 10000 Hm was main purpose of BTP. This can be done by routing mode s. Setup such a calculation with Settings->STRONG settings. Be aware that depending on your choice of parameters the calculation is memory intense (you can easily exceed your RAM capacity) and may take several hours depending on extent of calculation and CPU power.
Play arround easpecially with the step parameter and der Hm parameter and check its influence observing system monitor.
It is not necessary to state a start or endpoint of the track allowing to find the STRONG-track in a global view not starting from your home, but restricted to your homeland.
You can stop such a calculation every time you want by ESC. Choose the desired Hm number by PAGE UP/DOWN und accept by enter. As one calculation is time consuming an therefore valuable, you can save and load it with SAVE/LOAD STRONG calculation.
If you are interested in a track ending in a specific point, press n after calculation is ready.

STRONG layer

With a finished calculation it is possible to create an overlay indicating the most convenient roads to plan a Hm maximized route. The roads are broadend by its usage frequency when backtracing the STRONG routes from a collection of arbitary but homogeniously distributed end points.

Power calculation

A assumption of power output of the rider is calculated for every created released track. It can be done for existing gpx files as well.
There are the following contributions:

  • rolling resistence (depending on speed, mass, rolling coefficient)
  • aerodynamic drag (speed (wind + movement), cwA, air density (sea level density, height, sea level temperature))
  • accelaration (after breaking with breaking acceleration and maximum lateral acceleration)
    Major assumption of the whole calculation is a speed dependend power output effecting in both enhanced power for climbing an accelaration.

Data Processing

Aside the STRONGlayer control, void correction and STRONG save and load support it is possible to perform a CimbAnalysis on the loaded dataset. It will extract all sufficiently independent climbs of the data area, whereat the definition of climb is done by the user.
Further it is possible to influence the sectional Hm between cross making ascents to descents and vis versa. This is of particular interest when creating meaningful STRONG layers. Normalizing this kind of data will avoid STRONG calculations ending at most highest mountains.

Bugs and Contribution

Please feel free to send me Bugs you notice when working with BTP3. I aim for a stable, user friendly BTP under Win7 and Win8. With the source code it might be possible for you the build a Linux executable or even other operating system supported by Qt.
If you like to support the project or realize your own ideas within the framwork of BTP3, so do it: Get http://qt-project.org/wiki/Qt_5.0 and begin coding, I hope this documentation helps. For me it would be greates satisfaction to get BTP growing by the help of other enthusiastic programmers. Please refer to my Email if you like to collaborate.

Thanks so far to the OpenStreetMap community, Qt und NASA to enrich mankind by its free data and programms.
Remember BTP being only as good as its underlying data set from OpenStreetMap, you personally can influence the quality of the data set by editing it at http://www.openstreetmap.org.