\( \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
WayHeight Class Reference

assigns heights to Way, generates Neighbour data More...

#include <WayHeight.h>

Collaboration diagram for WayHeight:

Public Member Functions

 WayHeight (HeightData *H, OSM *O)
 constructor runs the whole calculation More...
 
 WayHeight (HeightData *H, double *lat, double *lon, int count, Neighbour **nb)
 help interface to deal with gpx data, and not osm
 

Private Member Functions

void call_height_t ()
 
void check_brect (Way *w, double *latmin, double *latmax, double *lonmin, double *lonmax)
 adapt bounding rect to cover whole data set
 
void reset_cross_markers (KOO *k)
 set status of every KOO zero
 
void mark_cross (Way *w)
 
void alloc_crossdata (KOO *k)
 allocs crossdata if KOO was marked as cross More...
 
void alloc_neighbours (Way *w)
 search allong way for neighbouring cross, link them with Neighbour data
 
void add_raw_HeightData (KOO *k)
 assign raw height data to all Neighbour datasets
 
void glaze ()
 smear out gaussian the mistrust index over several hundred meter More...
 
void portion_way (KOO *k)
 smearing out the mistrust index within the Neighbour data
 
void portion_cross (KOO *k)
 smearing out at the borders of the Neighbour data, i.g. at the cross More...
 
void generate_PortionInstructions (KOO *k)
 generate the angular relation of Neighbour at a cross
 
void delete_PortionInstructions (KOO *k)
 delete the angular relation of Neighbour at a cross
 
void portion_divide (KOO *k)
 normalize the distributes mistrust index
 
short check0 (KOO *k)
 returns zero if a zero distance Neighbour was found
 
void calc_crossheight (KOO *k)
 determines the common crossheight fromthe domiciled Neighbour
 
void reduce_data (KOO *k)
 run select_heights() and finalize_data() on every Neighbour
 
void select_heights (Neighbour *n, long s, long e)
 select the most charakteristicand trustful heighdata of a Neighbour
 
void finalize_data (Neighbour *n)
 keep selected data and delete unused data
 
void show_d_h (KOO *k)
 visualization for developers
 
void show_d_confidence (KOO *k)
 
void mark_NoHeights ()
 if a Way is tunnel or bridge height must be interpolated lineary More...
 
void dismark_NoHeights ()
 reduces Way::type by 10 if member of osm::NoHeight data
 
void alloc_NoHeights_neighbours ()
 create Neighbour data (end & start only) for members of osm::NoHeight
 
void add_NoHeights_HeightData (KOO *k)
 determine the heights of tunnels and bridges at start and end
 
void trace_to_HeightData (float d, KOO *k, KOOlist *kl, trackpointlist *tl)
 work function of add_NoHeights_HeightData() More...
 
int KOO_already_used (KOO *k, KOOlist *kl)
 help function of trace_to_HeightData()
 

Private Attributes

HeightDatah
 
OSMo
 
double dstep0
 interpolation step size in km
 
double dmin
 minimum section length in km
 
double rlimit
 maximum accepted mistrust index
 
double dminur
 minimum section length to cross
 
double flach2
 move cross to place with (grad^2)
 
int glacerate
 how many times is glazed
 

Detailed Description

assigns heights to Way, generates Neighbour data

limited resolution of SRTM3 DEM requires best possible interpolation, done by HeightData and critical assignement of height data to osm Way data. This is because roads tend to be build in valleys at ground level, with equal height all the time. Combining the $osm data and SRTM3 data therefor becomes difficult when roads do not fit exactly into the valleys, and even if they do, the valley ground might not be flat due to limit SRTM3 resolution.
BTP3 aims for realistic height information, being rapidly destroyed if accepting the orange skin like DEM and there for producing mush to mush total altitude gain on tracks. A further problem is about horizontal displacement of roads at hills, where the road might permanently loose and gain height, although declining and ascenting smoothly in reality. This kind of intelligence has to be taken into account.
BTP trust in heights only, of the Relief surface is horizontaly flat or if a road strictly cross contour lines perpendiculary. The height change in road direction should be lineary, otherwise no trust. The measure of this rules is mode 4 of the HeightData::height() and HeightData::height_t() functions.
To handle tunnels and bridges with linear interpolation, these data are stored in the oms::NoHeight dataset.
As a result, the classes tags KOO as cross allocating crossdata and creating Neighbour data for every cross. Height data is no attribut of Way but of Neighbour, as a cross serves for several Way, being forced to have a single height. This height refers to the KOO, the cross is located.

Definition at line 33 of file WayHeight.h.

Constructor & Destructor Documentation

WayHeight::WayHeight ( HeightData H,
OSM O 
)

constructor runs the whole calculation

Please refer to subfunctions in that routine for detailed information. Subfunctions will be executed serially on after the other.

Definition at line 4 of file WayHeight.cpp.

Member Function Documentation

void WayHeight::alloc_crossdata ( KOO k)
private

allocs crossdata if KOO was marked as cross

mark_cross() might have marked KOO as being used by multiple Way. This indicates that this KOO is a cross and should get Neighbour data. Also Way end points have to get cross state.

Definition at line 106 of file WayHeight.cpp.

void WayHeight::call_height_t ( )
private

prepare HeighData to fast access

Definition at line 159 of file WayHeight.cpp.

void WayHeight::glaze ( )
private

smear out gaussian the mistrust index over several hundred meter

every mistrust index in a raw data array is distributed to its neighbouring array elements. To achieve a proper distribution of the mistrust index at cross, the function portion_cross() is used, within a dataset this is done by portion_way. Repeating this for glazerate times leads to an gaussian smearing out of this value.

Definition at line 258 of file WayHeight.cpp.

void WayHeight::mark_cross ( Way w)
private

mark KOO by every Way it is used from

Definition at line 94 of file WayHeight.cpp.

void WayHeight::mark_NoHeights ( )
private

if a Way is tunnel or bridge height must be interpolated lineary

from osm::NoHeight it is known whether a way is to be interpolated lineary from its neighbouring Way, and NOT from the DEM served by HeighData. Marking is increasing the Way::type by 10.

Definition at line 688 of file WayHeight.cpp.

void WayHeight::portion_cross ( KOO k)
private

smearing out at the borders of the Neighbour data, i.g. at the cross

a Neighbour mistrust data point distributes its mistrust to the Neighbour which are also domiciled at the cross. This distribution is strong, if the link from one Neighbour to another is 0° and gets small for values at 90°, expressing no relation of mistrust index of perpendicular roads.

Definition at line 291 of file WayHeight.cpp.

void WayHeight::show_d_confidence ( KOO k)
private

visualization for developers

Definition at line 433 of file WayHeight.cpp.

void WayHeight::trace_to_HeightData ( float  d,
KOO k,
KOOlist kl,
trackpointlist tl 
)
private

work function of add_NoHeights_HeightData()

searches through Neighbour network beginning from bridge or tunnel end to reach none bridge/tunnel height data

Definition at line 821 of file WayHeight.cpp.


The documentation for this class was generated from the following files: