diff --git a/draw/draw.c b/draw/draw.c index 12c8570..1d479fc 100644 --- a/draw/draw.c +++ b/draw/draw.c @@ -485,13 +485,13 @@ void draw_map () { || ((view_scale < 0.1 && (n % 2) == 0) || carea->p_cnt < 5) || ((view_scale < 0.1 && (n % 4) == 0) || carea->p_cnt < 10)) { p1 = draw_geo2screen (view_lon, view_lat, carea->p[n].lon, carea->p[n].lat); - if (n == 0) { - draw_line (img_map, p1.x + center.x - 5, p1.y + center.y - 5, p1.x + center.x + 5, p1.y + center.y + 5, tmplinestyle); - draw_line (img_map, p1.x + center.x + 5, p1.y + center.y - 5, p1.x + center.x - 5, p1.y + center.y + 5, tmplinestyle); - } - if (n == 0) sprintf (text, "%d:%d", n, carea->subid); - else sprintf (text, "%d", n); - gfx_draw_text (img_map, p1.x + center.x - 20, p1.y + center.y - 10, text, &color[COLOR_white][3]); + // if (n == 0) { + // draw_line (img_map, p1.x + center.x - 5, p1.y + center.y - 5, p1.x + center.x + 5, p1.y + center.y + 5, tmplinestyle); + // draw_line (img_map, p1.x + center.x + 5, p1.y + center.y - 5, p1.x + center.x - 5, p1.y + center.y + 5, tmplinestyle); + // } + // if (n == 0) sprintf (text, "%d:%d", n, carea->subid); + // else sprintf (text, "%d", n); + // gfx_draw_text (img_map, p1.x + center.x - 20, p1.y + center.y - 10, text, &color[COLOR_white][3]); draw_polygonadd (p1.x + center.x, p1.y + center.y); } draw_polygonfinish (img_map, tmplinestyle, &color_polygon[carea->type], 0); diff --git a/mapsys/map_osmload.c b/mapsys/map_osmload.c index 15d98c8..e021933 100644 --- a/mapsys/map_osmload.c +++ b/mapsys/map_osmload.c @@ -1191,9 +1191,9 @@ int osm_area_split_add (struct s_osmmarea *marea) { int _debug = 0; float angle_sum; - if (marea->marea->id == 22963833) _debug = 0; - else return 1; - d_printf ("marea: %lld cnt:%d", marea->marea->id, marea->marea->p_cnt); +// if (marea->marea->id == 22963835) _debug = 1; +// else return 1; +// d_printf ("marea: %lld cnt:%d", marea->marea->id, marea->marea->p_cnt); // map_area_add (marea->marea, MHLOAD_RELOAD); // 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]; ml_free (pt); pt = pt_; + continue; } /* if c==0 save last areapart */ @@ -1333,11 +1334,6 @@ int osm_area_split_add (struct s_osmmarea *marea) { if (a->p_cnt < 3) { /* 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; } @@ -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); } - 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 (" 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 */