From 98347c53eb76dc78080dd4e45979f159deac1172 Mon Sep 17 00:00:00 2001 From: steffen Date: Thu, 16 May 2013 20:59:03 +0000 Subject: [PATCH] rotate only once.. --- mapsys/map_osmload.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mapsys/map_osmload.c b/mapsys/map_osmload.c index e021933..268fcef 100644 --- a/mapsys/map_osmload.c +++ b/mapsys/map_osmload.c @@ -1188,7 +1188,7 @@ int osm_area_split_add (struct s_osmmarea *marea) { struct map_area *a = NULL; struct s_osmareapnt *pt = ml_malloc (sizeof (struct s_osmareapnt) * marea->marea->p_cnt); int i, st, pt_c, c; - int _debug = 0; + int _debug = 0, rotated = 0; float angle_sum; // if (marea->marea->id == 22963835) _debug = 1; @@ -1238,13 +1238,14 @@ int osm_area_split_add (struct s_osmmarea *marea) { if (_debug) d_printf ("c:%d pt_c:%d st:%d angle_sum:%f",c, pt_c, st, angle_sum); /* make sure we going counterclock direction, only first area */ - if (angle_sum > M_PI && a->subid == marea->marea->subid) { + if (rotated == 0 && angle_sum > M_PI && a->subid == marea->marea->subid) { struct s_osmareapnt *pt_ = ml_malloc (sizeof (struct s_osmareapnt) * pt_c); if (_debug) d_printf ("change rotation ..."); for (i = 0; i < pt_c; i++) pt_[pt_c - i - 1] = pt[i]; ml_free (pt); pt = pt_; + rotated = 1; continue; } @@ -1350,6 +1351,7 @@ int osm_area_split_add (struct s_osmmarea *marea) { for (c = 0, i = 0; i < pt_c; i++) if (pt[i].pnr != -1) pt[c++] = pt[i]; if (pt_c == c) { d_printf ("%s:%d pt_c == c : nothing deleted.. something went wrong.", __FILE__, __LINE__); + d_printf (" rotated:%d", rotated); break; } pt_c = c;