}
}
destroy_effectivearea(ea);
+
return opts;
}
LWDEBUG(2, "Entered lwpoly_set_effective_area");
int i;
int set_m;
+ int avoid_collapse=4;
if(set_area)
set_m=1;
else
for (i = 0; i < ipoly->nrings; i++)
{
+ POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld);
/* Add ring to simplified polygon */
- if( lwpoly_add_ring(opoly, ptarray_set_effective_area(ipoly->rings[i],4,set_area,trshld)) == LW_FAILURE )
- return NULL;
+ if(pa->npoints>=4)
+ {
+ if( lwpoly_add_ring(opoly,pa ) == LW_FAILURE )
+ return NULL;
+ }
+ /*Inner rings we allow to ocollapse and then we remove them*/
+ avoid_collapse=0;
}