]> granicus.if.org Git - postgis/commitdiff
#2845, Bad geometry created from ST_AddPoint
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 1 Aug 2014 18:43:59 +0000 (18:43 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 1 Aug 2014 18:43:59 +0000 (18:43 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12849 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
liblwgeom/lwline.c

diff --git a/NEWS b/NEWS
index b59c50e2f7d80b69bc5358482d90e5ad2ac31269..c4bb01558dcfbc8b2e4fb3b072ef875d60e8bc68 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,7 @@ PostGIS 2.2.0
   - #2803, ST_MapAlgebra handles no userarg and STRICT callback function
   - #2822, Use @ operator instead of ST_CoveredBy() for raster
            max extent constraint
+  - #2845, Bad geometry created from ST_AddPoint
 
  * Code refactoring *
 
index f10ef7c84384abae3c827cfaeb7d24f85218a8ee..1f5da5ebef9e1001bee713e2e033887e136b65e1 100644 (file)
@@ -313,7 +313,15 @@ lwline_add_lwpoint(LWLINE *line, LWPOINT *point, int where)
 {
        POINT4D pt;     
        getPoint4d_p(point->point, 0, &pt);
-       return ptarray_insert_point(line->points, &pt, where);
+
+       if ( ptarray_insert_point(line->points, &pt, where) != LW_SUCCESS )
+               return LW_FAILURE;
+
+       /* Update the bounding box */
+       lwgeom_drop_bbox(lwline_as_lwgeom(line));
+       lwgeom_drop_bbox(lwline_as_lwgeom(line));
+       
+       return LW_SUCCESS;
 }