]> granicus.if.org Git - postgis/commitdiff
ST_Segmentize returns invalid LINESTRING for zero-length input (#1304)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 30 Jan 2012 21:52:47 +0000 (21:52 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 30 Jan 2012 21:52:47 +0000 (21:52 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8971 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/ptarray.c

index 3eff56546a591e633fbd33237bee2da70ba17060..53fdab043717c0c3acf11910393d574dc2c10ee4 100644 (file)
@@ -428,7 +428,7 @@ ptarray_segmentize2d(const POINTARRAY *ipa, double dist)
                }
                else /* copy second point */
                {
-                       ptarray_append_point(opa, &p2, LW_FALSE);
+                       ptarray_append_point(opa, &p2, (ipa->npoints==2)?LW_TRUE:LW_FALSE);
                        p1 = p2;
                        ipoff++;
                }