|
|
|
@ -1191,9 +1191,9 @@ int osm_area_split_add (struct s_osmmarea *marea) {
|
|
|
|
int _debug = 0;
|
|
|
|
int _debug = 0;
|
|
|
|
float angle_sum;
|
|
|
|
float angle_sum;
|
|
|
|
|
|
|
|
|
|
|
|
if (marea->marea->id == 22963833) _debug = 0;
|
|
|
|
// if (marea->marea->id == 22963835) _debug = 1;
|
|
|
|
else return 1;
|
|
|
|
// else return 1;
|
|
|
|
d_printf ("marea: %lld cnt:%d", marea->marea->id, marea->marea->p_cnt);
|
|
|
|
// d_printf ("marea: %lld cnt:%d", marea->marea->id, marea->marea->p_cnt);
|
|
|
|
// map_area_add (marea->marea, MHLOAD_RELOAD);
|
|
|
|
// map_area_add (marea->marea, MHLOAD_RELOAD);
|
|
|
|
// return 1;
|
|
|
|
// return 1;
|
|
|
|
|
|
|
|
|
|
|
|
@ -1245,6 +1245,7 @@ int osm_area_split_add (struct s_osmmarea *marea) {
|
|
|
|
for (i = 0; i < pt_c; i++) pt_[pt_c - i - 1] = pt[i];
|
|
|
|
for (i = 0; i < pt_c; i++) pt_[pt_c - i - 1] = pt[i];
|
|
|
|
ml_free (pt);
|
|
|
|
ml_free (pt);
|
|
|
|
pt = pt_;
|
|
|
|
pt = pt_;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* if c==0 save last areapart */
|
|
|
|
/* if c==0 save last areapart */
|
|
|
|
@ -1333,11 +1334,6 @@ int osm_area_split_add (struct s_osmmarea *marea) {
|
|
|
|
|
|
|
|
|
|
|
|
if (a->p_cnt < 3) {
|
|
|
|
if (a->p_cnt < 3) {
|
|
|
|
/* found nothing try next one */
|
|
|
|
/* found nothing try next one */
|
|
|
|
// i = sel + 1; if (i >= pt_c) i = 0;
|
|
|
|
|
|
|
|
// do {
|
|
|
|
|
|
|
|
// sel = i;
|
|
|
|
|
|
|
|
// i++; if (i >= pt_c) i = 0;
|
|
|
|
|
|
|
|
// } while (sel > st && (pt[i].angle > M_PI || pt[sel].angle < M_PI));
|
|
|
|
|
|
|
|
sel++; if (sel >= pt_c) sel = 0;
|
|
|
|
sel++; if (sel >= pt_c) sel = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1363,11 +1359,10 @@ int osm_area_split_add (struct s_osmmarea *marea) {
|
|
|
|
d_printf ("%s:%d max subid reached. area id:%lld", __FILE__, __LINE__, a->id);
|
|
|
|
d_printf ("%s:%d max subid reached. area id:%lld", __FILE__, __LINE__, a->id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pt[0].pnr >= 0 && pt_c > 0) {
|
|
|
|
if (pt[0].pnr >= 0 && pt_c > 2) {
|
|
|
|
d_printf ("%s:%d osm_area_split_add: something went very wrong", __FILE__, __LINE__);
|
|
|
|
d_printf ("%s:%d osm_area_split_add: something went very wrong", __FILE__, __LINE__);
|
|
|
|
d_printf (" marea->id: %lld:%d", a->id, a->subid);
|
|
|
|
d_printf (" marea->id: %lld:%d", a->id, a->subid);
|
|
|
|
d_printf (" pt[0].pnr:%d pall_cnt: %d", pt[0].pnr, pt_c);
|
|
|
|
d_printf (" pt[0].pnr:%d pt[1].pnr:%d pall_cnt: %d", pt[0].pnr, pt[1].pnr, pt_c);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* free unneeded memory and return to caller */
|
|
|
|
/* free unneeded memory and return to caller */
|
|
|
|
|