From d89b799534ad15c9f57967cde27164152d04dba5 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 22 Mar 2012 15:06:52 +0000 Subject: [PATCH] Do not drop collapsed polygon shells (#1698) git-svn-id: http://svn.osgeo.org/postgis/trunk@9527 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwpoly.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/liblwgeom/lwpoly.c b/liblwgeom/lwpoly.c index 08d55841b..e73b42293 100644 --- a/liblwgeom/lwpoly.c +++ b/liblwgeom/lwpoly.c @@ -356,7 +356,7 @@ LWPOLY* lwpoly_simplify(const LWPOLY *ipoly, double dist) POINTARRAY *opts = ptarray_simplify(ipoly->rings[i], dist); /* One point implies an error in the ptarray_simplify */ - if ( opts->npoints < 2 ) + if ( i && ( opts->npoints < 2 ) ) { LWDEBUG(2, "ptarray_simplify returned a <2 pts array"); ptarray_free(opts); @@ -364,7 +364,7 @@ LWPOLY* lwpoly_simplify(const LWPOLY *ipoly, double dist) } /* Less points than are needed to form a closed ring, we can't use this */ - if ( opts->npoints < 4 ) + if ( i && ( opts->npoints < 4 ) ) { LWDEBUGF(3, "ring%d skipped (<4 pts)", i); ptarray_free(opts); -- 2.40.0