\( \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
osm.h
1 /*Liest Rohdaten aus OSM-Datein ein*/
2 
3 #pragma once
4 #include <string>
5 #include <stdio.h>
6 #include <cstdlib>
7 #include <QtWidgets/QMessageBox>
8 #include "DataTyps.h"
9 #include "MathExt.h"
10 #include "HeightData.h"
11 
12 using namespace std;
14 
34 class OSM{
35  public:
36  OSM(string filename);
37  OSM();
38  ~OSM();
39  void read_OSM();
40  void get_KOO_Waysavl();
41  void check_lines();
42  void setfilename(string fileName);
43  Way* get_first_Way();
44  KOO* get_first_KOO();
45  Neighbour* add_Neighbour(KOO* k, KOO** node, KOO* nb, Way* w,
46  float d, int KOOc, readdirection rd);
48  void initiallists();
49  void RelationstoFace(relation** l,lines** f);
51  void reset_KOO_status(KOO* k, char i);
54  void calc_peak_index_pro(HeightData* h);
55 
56  void sort_peaks();
57 
58 
59  //*Bounding rect
60  void calc_brect();
61  double getminlat();
62  double getminlon();
63  double getmaxlat();
64  double getmaxlon();
65 
66  // container data
69  short mintype,maxtype;
70  lines **motorWay,**highway,**primary,**secondary,**track,**track2,
71  **river,**creek,** wood,**water, **NoHeight;
72  points **metropolis,
73  **city,
74  **town,
75  **village,
76  **locality,
77  **col,
78  **peak;
79  relation **waterr,**woodr;
80  lines **ExclCheck[8];
82 
85  short isin(lines* l,double minlat, double maxlat,
86  double minlon, double maxlon);
87  short isin(points* l,double minlat, double maxlat,
88  double minlon, double maxlon);
89  short isin(KOO* k,double minlat, double maxlat,
90  double minlon, double maxlon);
91  short isin(Way* w,double minlat, double maxlat,
92  double minlon, double maxlon);
93  short iscompletein(Way* w,double minlat, double maxlat,
94  double minlon, double maxlon);
96 
97  //aktuelle Status
98  int get_status();
99  int count_cross(KOO *k);
100  int count_STRONG(KOO *k);
101 
102  /*Berechnete Daten Speichern und laden*/
104  void save(char* filename, double minlat, double maxlat,
105  double minlon, double maxlon);
107  void load(char* filename);
108 
109  /*Daten editieren*/
110  void select_cross(double lat, double lon,
111  KOO** kdest, float* d,KOO* ksrc);
112  Way* select_Way(double lat, double lon);
113  void change_Waytype(Way* w, char newtype);
114  void del_Way(Way* w);
115  void normalize_Hm(KOO* k);
116  void invert_Hm(KOO* k);
117  void reset_Hm(KOO* k);
118  void points_Hm(KOO* k);
119  KOO* search(qint64 id, KOO* s);
120  void merge(KOO* knew, KOO* kold);
123  void deleteRect(double minlat, double maxlat,
124  double minlon, double maxlon);
125  void info();
126  private:
127  short check_AVL(Way* w);
128  qint64 extract_valuei(char* s, const char* a);
131  double extract_valuef(char* s, const char* a);
133  char* extract_valuec(char* s, const char* a);
135  void extract_bbox(char* s);
136  void quotationreplace(char* a);
137  void htmlreplace(char* c);
138 
146  int status;
147  string filename;
149  /*Hauptdatenstruktur*/
152  KOO* insert(qint64 id, KOO* s);
155  KOO* rotate(KOO** s, branch b);
157  KOO* insert_AVL(qint64 id, KOO** s);
158 
160  Way* insert(qint64 id, Way* s);
162  Way* rotate(Way** s, branch b);
164  Way* insert_AVL(qint64 id, Way** s); //einfgn. AVL-Baum-konform
166  Way* search(qint64 id, Way* s);
168  void get_KOO_Waysavl(Way* l,short next);
170 
174  void check_lines_rek(lines** l);
175  void delete_AVL(Way* l);
176  void delete_AVL(KOO* l);
177  void delete_lines(lines* l);
178  void delete_points(points* l);
179  void delete_relation(relation* l);
180 
182  void nodehandling(FILE *f,char* line,char* lineattr,char* linename);
184  void Wayhandling(FILE *f,char* line,char* lineattr,char* linename,
185  qint64* currentseek);
187  void relationhandling(FILE *f,char* line,char* lineattr,char* linename,
188  qint64* currentseek);
189 
191  void add_line(lines** l,Way* Way,char* name);
193  points* add_points(points** l,KOO* KOO,char* name,float index);
195  void add_relation(relation** l, relation* r);
197  void invert_points(points** l);
198 
200  double minlat,maxlat,minlon,maxlon;
202  double dminlat,dmaxlat,dminlon,dmaxlon;
204  void calc_brect(points** l);
206  void calc_brect(lines** l);
207 
210 
214  void save_node(KOO* k, FILE* f);
215  void save_Way(Way* w, FILE* f);
216  void save_cross(KOO* k, FILE* f, int* c, double minlat,
217  double maxlat, double minlon, double maxlon);
218  void save_lines(lines** l, FILE* f, double minlat, double maxlat,
219  double minlon, double maxlon);
220  void save_points(points** p, FILE* f, double minlat, double maxlat,
221  double minlon, double maxlon);
223 
226  void reset_KOO_status(KOO* k);
227  KOO* load_node(FILE* f);
228  Way* load_Way(FILE* f);
229  void load_cross(FILE* f);
230  void load_lines(lines** l, FILE* f);
231  void load_points(points** p, FILE* f);
232  void replace_Way_KOO(Way* w, KOO** newKOO, int newlength);
234 
236  void equal_crossheight(KOO* k);
237 
240  void extract_Way(lines* l, Way* w, Way* k, char mintype, char maxtype);
241  void del_lines(Way* w, lines** l, char* keepname);
242  void del_Neighbour(KOO* k, Way* w);
243  void del_Neighbour(KOO* k, Neighbour* n);
244  void del_Way(Way* w, double minlat, double maxlat,
245  double minlon, double maxlon);
247 };
248 
string filename
Definition: osm.h:147
container struct to hold data of a coordinate
Definition: DataTyps.h:82
short mintype
Definition: osm.h:69
routing container struct, connects cross via Way with each other
Definition: DataTyps.h:47
double minlat
bounding rect of the osm data set
Definition: osm.h:200
relation ** woodr
Definition: osm.h:79
holds digital elevation model extracted from SRTM3 data
Definition: HeightData.h:26
double dminlat
claimed bounding rect of the &amp;osm data file
Definition: osm.h:202
container for line geodata
Definition: DataTyps.h:122
OSM_Data D
Definition: osm.h:150
osm data container list for relation data (multiple lakes and forrests)
Definition: DataTyps.h:149
BTP3 database, created from OpenStreetMap data.
Definition: osm.h:34
lines ** wood
Definition: osm.h:70
int status
osm usage status variable
Definition: osm.h:146
osm data container list for line like data (roads, rivers)
Definition: DataTyps.h:143
osm data container list for point like data (summits, towns, ...)
Definition: DataTyps.h:137
points ** village
20 : tag village, suburban
Definition: osm.h:72