|
|
|
|
@ -659,7 +659,8 @@ int osm_node_load (struct osm_node *node, unsigned long long int id) {
|
|
|
|
|
* save the waynode data inside the hash file to read all needed data later on
|
|
|
|
|
* and check the waynodes inside the map files.
|
|
|
|
|
*/
|
|
|
|
|
void osm_waynode_add (struct osm_node *node, long long int nodepos, unsigned long long int id, unsigned short int subid, unsigned short int pnr) {
|
|
|
|
|
void osm_waynode_add (struct osm_node *node, long long int nodepos, unsigned long long int id,
|
|
|
|
|
unsigned short int subid, unsigned short int pnr) {
|
|
|
|
|
struct s_osm_hashnodes *hnodes = NULL;
|
|
|
|
|
struct osm_nodehash hash;
|
|
|
|
|
struct osm_waynode wn;
|
|
|
|
|
@ -1023,7 +1024,8 @@ void osm_marea_new (struct s_osmmarea *a, int max) {
|
|
|
|
|
* hash data block. I case the way goes over more hash segments the
|
|
|
|
|
* way will be slit into peaces
|
|
|
|
|
*
|
|
|
|
|
* splitting into peaces does not work yet
|
|
|
|
|
* splitting into peaces does not work yet, also taking care of the
|
|
|
|
|
* polygons, no angles over 180°.
|
|
|
|
|
*
|
|
|
|
|
* CALL with NULL will free all unneeded memory
|
|
|
|
|
*/
|
|
|
|
|
@ -1785,6 +1787,21 @@ void map_load_web (struct map_pos hs, struct map_pos he) {
|
|
|
|
|
char fcache[LEN_FILENAME];
|
|
|
|
|
} wl[MLWEBMAX];
|
|
|
|
|
|
|
|
|
|
d_printf ("map_load_web: (%f , %f) --> (%f , %f)", hs.lon, hs.lat, he.lon, he.lat);
|
|
|
|
|
|
|
|
|
|
/* check for cache directory */
|
|
|
|
|
if (stat(cfg.cachepath, &sb) == -1) {
|
|
|
|
|
char fn[LEN_FILENAME];
|
|
|
|
|
strncpy (fn, cfg.cachepath, LEN_FILENAME);
|
|
|
|
|
fn[strlen(fn)-1] = 0;
|
|
|
|
|
d_printf ("create cache dir:%s", fn);
|
|
|
|
|
#if !defined(__MINGW32CE__) && !defined(_WIN32_WCE) && !defined(__MINGW32__)
|
|
|
|
|
mkdir (fn, 0755);
|
|
|
|
|
#else
|
|
|
|
|
mkdir (fn);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.status = APPSTATUS_loadfromweb;
|
|
|
|
|
#if defined (_LINUX_)
|
|
|
|
|
osm_load_from_web_end = he;
|
|
|
|
|
@ -1798,6 +1815,8 @@ void map_load_web (struct map_pos hs, struct map_pos he) {
|
|
|
|
|
for (h.lat = hs.lat; h.lat < he.lat || cmpf(h.lat, he.lat); h.lat = h.lat + MAP_OSMWEB_DELTA) {
|
|
|
|
|
do {
|
|
|
|
|
main_wnd_loop (-1,-1);
|
|
|
|
|
/* check for any finished forked processes
|
|
|
|
|
* if so, call osm_loadfile */
|
|
|
|
|
for (i = 0; i < MLWEBMAX; i++) {
|
|
|
|
|
if (wl[i].p.used) {
|
|
|
|
|
ret = execwait (&wl[i].p);
|
|
|
|
|
@ -1811,7 +1830,7 @@ void map_load_web (struct map_pos hs, struct map_pos he) {
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < MLWEBMAX && wl[i].p.used == 1; i++);
|
|
|
|
|
}
|
|
|
|
|
while (i >= MLWEBMAX);
|
|
|
|
|
while (i >= MLWEBMAX); /* exit if we can fork another process */
|
|
|
|
|
|
|
|
|
|
y1 = CALC_START (h.lon, MAP_OSMWEB_DELTA);
|
|
|
|
|
x1 = CALC_START (h.lat, MAP_OSMWEB_DELTA);
|
|
|
|
|
|