… | |
… | |
33 | * You should have received a copy of the GNU General Public License |
33 | * You should have received a copy of the GNU General Public License |
34 | * along with this program; if not, write to the |
34 | * along with this program; if not, write to the |
35 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
35 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
36 | * Boston, MA 02110-1301, USA. |
36 | * Boston, MA 02110-1301, USA. |
37 | */ |
37 | */ |
|
|
38 | |
|
|
39 | #define NO_GTYPES_ 1 |
38 | |
40 | |
39 | #define _FILE_OFFSET_BITS 64 |
41 | #define _FILE_OFFSET_BITS 64 |
40 | #define _LARGEFILE_SOURCE |
42 | #define _LARGEFILE_SOURCE |
41 | #define _LARGEFILE64_SOURCE |
43 | #define _LARGEFILE64_SOURCE |
42 | #include <stdlib.h> |
44 | #include <stdlib.h> |
… | |
… | |
231 | case type_district_label_2e5: |
233 | case type_district_label_2e5: |
232 | case type_district_label_1e5: |
234 | case type_district_label_1e5: |
233 | case type_street_n_lanes: |
235 | case type_street_n_lanes: |
234 | case type_highway_city: |
236 | case type_highway_city: |
235 | case type_highway_land: |
237 | case type_highway_land: |
236 | case type_ramp: |
238 | //case type_ramp: |
|
|
239 | case type_ramp_highway_land: |
237 | max = 8; |
240 | max = 8; |
238 | break; |
241 | break; |
239 | case type_town_label_5e4: |
242 | case type_town_label_5e4: |
240 | case type_town_label_2e4: |
243 | case type_town_label_2e4: |
241 | case type_town_label_1e4: |
244 | case type_town_label_1e4: |
… | |
… | |
244 | case type_district_label_1e4: |
247 | case type_district_label_1e4: |
245 | max = 9; |
248 | max = 9; |
246 | break; |
249 | break; |
247 | case type_street_4_land: |
250 | case type_street_4_land: |
248 | case type_street_4_city: |
251 | case type_street_4_city: |
|
|
252 | case type_ramp_street_4_city: |
249 | max = 10; |
253 | max = 10; |
250 | break; |
254 | break; |
251 | case type_town_label_5e3: |
255 | case type_town_label_5e3: |
252 | case type_town_label_2e3: |
256 | case type_town_label_2e3: |
253 | case type_town_label_1e3: |
257 | case type_town_label_1e3: |
254 | case type_district_label_5e3: |
258 | case type_district_label_5e3: |
255 | case type_district_label_2e3: |
259 | case type_district_label_2e3: |
256 | case type_district_label_1e3: |
260 | case type_district_label_1e3: |
257 | case type_street_3_city: |
261 | case type_street_3_city: |
258 | case type_street_3_land: |
262 | case type_street_3_land: |
|
|
263 | case type_ramp_street_3_city: |
259 | max = 12; |
264 | max = 12; |
260 | break; |
265 | break; |
261 | default: |
266 | default: |
262 | break; |
267 | break; |
263 | } |
268 | } |
… | |
… | |
435 | create_tile_hash(); |
440 | create_tile_hash(); |
436 | |
441 | |
437 | th = tile_head_root; |
442 | th = tile_head_root; |
438 | size = 0; |
443 | size = 0; |
439 | slices = 0; |
444 | slices = 0; |
440 | fprintf(stderr, "Maximum slice size "LONGLONG_FMT"\n", slice_size); |
445 | fprintf_(stderr, "Maximum slice size "LONGLONG_FMT"\n", slice_size); |
441 | while (th) |
446 | while (th) |
442 | { |
447 | { |
443 | if (size + th->total_size > slice_size) |
448 | if (size + th->total_size > slice_size) |
444 | { |
449 | { |
445 | fprintf(stderr,"Slice %d is of size "LONGLONG_FMT"\n", slices, size); |
450 | fprintf_(stderr,"Slice %d is of size "LONGLONG_FMT"\n", slices, size); |
446 | size = 0; |
451 | size = 0; |
447 | slices++; |
452 | slices++; |
448 | } |
453 | } |
449 | size += th->total_size; |
454 | size += th->total_size; |
450 | th = th->next; |
455 | th = th->next; |
451 | } |
456 | } |
452 | |
457 | |
453 | if (size) |
458 | if (size) |
454 | { |
459 | { |
455 | fprintf(stderr,"Slice %d is of size "LONGLONG_FMT"\n", slices, size); |
460 | fprintf_(stderr,"Slice %d is of size "LONGLONG_FMT"\n", slices, size); |
456 | } |
461 | } |
457 | |
462 | |
458 | int max_slices_ = slices; |
463 | int max_slices_ = slices; |
459 | th = tile_head_root; |
464 | th = tile_head_root; |
460 | size = 0; |
465 | size = 0; |
… | |
… | |
462 | |
467 | |
463 | while (th) |
468 | while (th) |
464 | { |
469 | { |
465 | time(&start_tt); |
470 | time(&start_tt); |
466 | |
471 | |
467 | fprintf(stderr,"Slice #%d of %d\n", (slices + 1), (max_slices_ + 1)); |
472 | fprintf_(stderr,"Slice #%d of %d\n", (slices + 1), (max_slices_ + 1)); |
468 | |
473 | |
469 | th2 = tile_head_root; |
474 | th2 = tile_head_root; |
470 | while (th2) |
475 | while (th2) |
471 | { |
476 | { |
472 | th2->process = 0; |
477 | th2->process = 0; |
… | |
… | |
488 | |
493 | |
489 | time(&end_tt); |
494 | time(&end_tt); |
490 | diff_tt = difftime(end_tt,start_tt); |
495 | diff_tt = difftime(end_tt,start_tt); |
491 | char outstring[200]; |
496 | char outstring[200]; |
492 | convert_to_human_time(diff_tt, outstring); |
497 | convert_to_human_time(diff_tt, outstring); |
493 | fprintf(stderr, "-RUNTIME-LOOP-PHASE5: %s this loop run\n", outstring); |
498 | fprintf_(stderr, "-RUNTIME-LOOP-PHASE5: %s this loop run\n", outstring); |
494 | diff2_tt = diff2_tt + diff_tt; |
499 | diff2_tt = diff2_tt + diff_tt; |
495 | if ((slices + 1) > 0) |
500 | if ((slices + 1) > 0) |
496 | { |
501 | { |
497 | double eta_time = (diff2_tt / (slices + 1)) * (max_slices_ + 1 - (slices + 1)); |
502 | double eta_time = (diff2_tt / (slices + 1)) * (max_slices_ + 1 - (slices + 1)); |
498 | convert_to_human_time(eta_time, outstring); |
503 | convert_to_human_time(eta_time, outstring); |
499 | fprintf(stderr, "-RUNTIME-LOOP-PHASE5: %s left\n", outstring); |
504 | fprintf_(stderr, "-RUNTIME-LOOP-PHASE5: %s left\n", outstring); |
500 | } |
505 | } |
501 | |
506 | |
502 | slices++; |
507 | slices++; |
503 | } |
508 | } |
504 | |
509 | |