25 case CreateSTRONGLayers:
31 void WebData::exit(){}
34 QDir zdir(QString(w.
dest).append(QString(
"\\%1").arg(w.
z)));
35 QDir ydir(QString(w.
dest).append(QString(
"\\%1\\%2").arg(w.
z).arg(w.
y)));
36 if(!zdir.exists()) maind.mkdir(zdir.dirName());
37 if(!ydir.exists()) zdir.mkdir(ydir.dirName());
46 mt.
get_Map()->save(ydir.absoluteFilePath(QString(
"%1.png").arg(w.
x)),
"PNG");
50 QString filename = QString(
"D:\\ClimbProject\\pbf-Data\\%1-%2-%3.pbf").arg(w.
z).arg(w.
x).arg(w.
y);
51 QFileInfo fi = QFileInfo(filename);
52 qint64 fs = fi.size();
54 if((w.
z < 9 || fi.size() > 400e6) && fs > 250)
55 for(
int jx = 0; jx < 2; jx++)
56 for(
int jy = 0; jy < 2; jy++){
61 wt->
mode = SplitEurope;
62 double minlat = qMax( -90.,
yztolat(wt->
y+1,wt->
z) - dd);
63 double maxlat = qMin( 90.,
yztolat(wt->
y,wt->
z) + dd);
64 double minlon = qMax(-180.,
xztolon(wt->
x,wt->
z) - dd);
65 double maxlon = qMin( 180.,
xztolon(wt->
x+1,wt->
z) + dd);
66 QString newfile = QString(
"D:\\ClimbProject\\pbf-Data\\%1-%2-%3.pbf").arg(wt->
z).arg(wt->
x).arg(wt->
y);
67 QString cmdline = QString(
"D:\\ClimbProject\\pbf-Data\\osmconvert.exe");
68 QStringList arguments;
69 arguments << filename;
70 arguments << QString(
"-b=%1,%2,%3,%4").arg(minlon)
74 arguments << QString(
"-o=").append(newfile);
79 System_Call.start(cmdline,arguments);
80 System_Call.waitForFinished(-1);
86 double step = 360. / pow(2.,z);
90 double step = 360. / pow(2.,z);
91 return mercatortolat(180-y*step);
94 QFileInfo fi = QFileInfo(w.
src);
95 qint64 fs = fi.size();
96 if(fi.exists() && fs > 250){
97 QString osmout(w.
dest);
98 osmout.append(
".osm");
99 QString cmdline = QString(
"D:\\ClimbProject\\pbf-Data\\osmconvert.exe");
100 QStringList arguments;
102 arguments << QString(
"-o=").append(osmout);
103 QProcess System_Call;
104 System_Call.start(cmdline,arguments);
105 System_Call.waitForFinished(-1);
106 cmdline = QString(
"C:\\Users\\User\\c++\\BTP3\\release\\BTP3.exe");
107 QStringList argumentBTP;
108 argumentBTP << QString(
"-r=").append(osmout);
109 argumentBTP << QString(
"-d=").append(w.
dest);
110 argumentBTP << QString(
"close");
111 System_Call.start(cmdline,argumentBTP);
112 System_Call.waitForFinished(-1);
113 QFile(osmout).remove();
118 QString dirname = di.dirName();
124 QString srcfilename = QString(w.
dest).append(
"\\")
126 .append(
"-BinaryList.src");
127 FILE* srcfile = fopen(srcfilename.toLocal8Bit().data(),
"wb");
129 fwrite(&zero,4,1,srcfile);
131 srcfilename = QString(w.
dest).append(
"\\")
133 .append(
"-names.txt");
134 srcfile = fopen(srcfilename.toLocal8Bit().data(),
"w");
136 QFileInfo fi = QFileInfo(w.
src);
137 qint64 fs = fi.size();
138 if(fi.exists() && fs > 108){
139 QString dummyfile = QString(w.
dest).append(
".dmy");
140 FILE* dmy = fopen(dummyfile.toLocal8Bit().data(),
"w");
142 double minlat = qMax( -90.,
yztolat(w.
y+1,w.
z));
143 double maxlat = qMin( 90.,
yztolat(w.
y,w.
z) );
144 double minlon = qMax(-180.,
xztolon(w.
x,w.
z) );
145 double maxlon = qMin( 180.,
xztolon(w.
x+1,w.
z));
146 QString cmdline = QString(
"C:\\Users\\User\\c++\\BTP3\\release\\BTP3.exe");
147 QStringList arguments;
149 arguments << QString(
"-b=%1,%2,%3,%4").arg(minlon)
153 arguments << QString(
"-a=").append(w.
dest);
154 arguments << QString(
"close");
155 QProcess System_Call;
156 System_Call.start(cmdline,arguments);
157 System_Call.waitForFinished(-1);
158 QFile fi2(dummyfile);
159 if(fi2.exists()) fi2.remove();
167 for(
int dx = -1; dx < 2; dx++)
168 for(
int dy = -1; dy < 2; dy++)
169 osm.
load(QString(
"%1%4-%2-%3.btp").arg(w.
src).arg(w.
x+dx)
171 .toLocal8Bit().data());
177 for(
int z = 9; z < 12; z++){
178 QDir zdir(QString(w.
dest).append(QString(
"\\%1").arg(z)));
179 if(!zdir.exists()) maind.mkdir(zdir.dirName());
181 int m = pow(2,z-w.
z);
188 for(
int y = 0; y < m; y++){
189 QDir ydir(QString(w.
dest).append(QString(
"\\%1\\%2").arg(z).arg(w.
y*m+y)));
190 if(!ydir.exists()) zdir.mkdir(ydir.dirName());
191 for(
int x = 0; x < m; x++){
192 QPixmap pt = mt.
get_Map()->copy((m+x)*256,(m+y)*256,256,256);
193 QString filename = QString(
"%1%2\\%3\\%4.png").arg(w.
dest)
197 pt.save(filename,
"PNG");
204 for(wt.
x = w.
x*8; wt.
x < (w.
x+1)*8; wt.
x++)
205 for(wt.
y = w.
y*8; wt.
y < (w.
y+1)*8; wt.
y++)
206 for(
int z = 12; z < 15; z++){
207 QDir zdir(QString(w.
dest).append(QString(
"\\%1").arg(z)));
208 if(!zdir.exists()) maind.mkdir(zdir.dirName());
210 int m = pow(2,z-wt.
z);
217 for(
int y = 0; y < m; y++){
218 QDir ydir(QString(w.
dest).append(QString(
"\\%1\\%2").arg(z).arg(wt.
y*m+y)));
219 if(!ydir.exists()) zdir.mkdir(ydir.dirName());
220 for(
int x = 0; x < m; x++){
221 QPixmap pt = mt.
get_Map()->copy((m+x)*256,(m+y)*256,256,256);
222 QString filename = QString(
"%1%2\\%3\\%4.png").arg(wt.
dest)
226 pt.save(filename,
"PNG");
236 osm.
load(QString(
"%1%4-%2-%3.btp").arg(w.
src).arg(w.
x).arg(w.
y).arg(9).toLocal8Bit().data());
246 for(
int i = 0; i < N; i++)
255 QString SLfile = QString(
"%1%4-%2-%3.bsl").arg(w.
dest).arg(w.
y).arg(w.
x).arg(9);
262 for(
int z = 9; z < 12; z++){
263 QDir zdir(QString(w.
dest).append(QString(
"\\%1").arg(z)));
264 if(!zdir.exists()) maind.mkdir(zdir.dirName());
266 int m = pow(2,z-w.
z);
271 QImage image(mt.getwidth(),mt.getheight(),QImage::Format_ARGB32);
272 image.fill(qRgba(0,0,0,0));
274 p.setRenderHint(QPainter::Antialiasing);
277 for(
int y = 0; y < m; y++){
278 QDir ydir(QString(w.
dest).append(QString(
"\\%1\\%2").arg(z).arg(w.
y*m+y)));
279 if(!ydir.exists()) zdir.mkdir(ydir.dirName());
280 for(
int x = 0; x < m; x++){
281 QImage it = image.copy((m+x)*256,(m+y)*256,256,256);
282 QString filename = QString(
"%1%2\\%3\\%4.png").arg(w.
dest)
286 it.save(filename,
"PNG");
293 for(wt.
x = w.
x*8; wt.
x < (w.
x+1)*8; wt.
x++)
294 for(wt.
y = w.
y*8; wt.
y < (w.
y+1)*8; wt.
y++)
295 for(
int z = 12; z < 15; z++){
296 QDir zdir(QString(w.
dest).append(QString(
"\\%1").arg(z)));
297 if(!zdir.exists()) maind.mkdir(zdir.dirName());
299 int m = pow(2,z-wt.
z);
304 QImage image(mt.getwidth(),mt.getheight(),QImage::Format_ARGB32);
305 image.fill(qRgba(0,0,0,0));
307 p.setRenderHint(QPainter::Antialiasing);
310 for(
int y = 0; y < m; y++){
311 QDir ydir(QString(w.
dest).append(QString(
"\\%1\\%2").arg(z).arg(wt.
y*m+y)));
312 if(!ydir.exists()) zdir.mkdir(ydir.dirName());
313 for(
int x = 0; x < m; x++){
314 QImage it = image.copy((m+x)*256,(m+y)*256,256,256);
315 QString filename = QString(
"%1%2\\%3\\%4.png").arg(wt.
dest)
319 it.save(filename,
"PNG");
void settings(MapSettings *MS)
assigns new settings
void load(char *filename)
load btp to dataset
void STRONGlayer_save(char *filename, STRONGlayer *SL)
saves STRONGlayer to file
double xztolon(int x, int z)
longitude of tile x in zoom z
void STRONGlayer_to_Map(QPainter *p, STRONGlayer *SL)
draws STRONG calculation network
list elements to handle multiple STRONGlayers
KOO * get_first_KOO()
returns root of node-AVL tree
label algorithm to solve multicriteria shortes path problem
WebData(webdatacmd w)
contructor to create png tiles of bounding rect
int width
rendering image size
double yztolat(int y, int z)
lattitude of tile y in zoom z
config * c
BTP configuration to be used.
char SRTM3folder[260]
SRTM3 data folder.
char maxtype
way restrictions
void analyse_climbs()
analyses climbs on btp files and saves html data
holds digital elevation model extracted from SRTM3 data
official representation of Track in BTP3
QString src
source file name
void resize(int width, int height)
adapts size, recalculate borders from desired borders
QString dest
destination file name
void set_borders(double latmin0, double latmax0, double lonmin0, double lonmax0)
sets desired borders, recalculate bordes due to window size
int height
rendering image size
multithreading working command, defines the task to be executed
class to perform routing routines on osm data sets
void set_SRTM3_folder(char *folder)
specifies the folder where hgt-files of SRTM3 data are searched
STRONGsetting cconfig
STRONGAlgo setting, climb mode.
QPixmap * get_Map()
return pixmap of the last generated map
void calc_borders()
desired borders to real borders
void draw_map(STRONGlayer *SL, climblayer *cl, Track *ct, int fastmode)
universal high quality drawing
STRONGlayer * STRONGlayer_create(STRONGlayer *SL, int N)
creates STRONGlayer from a unfinalized STRONG network
BTP3 database, created from OpenStreetMap data.
void invert_Hm(KOO *k)
switches descenting and ascenting vertical meters in Neighbour relation
void read_osm()
creats *.osm file from pbf and reads in with external BTP process