newpa = ptarray_addPoint(line->points,
getPoint_internal(point->point, 0),
TYPE_NDIMS(point->type), where);
+
+
- ret = lwline_construct(line->SRID, NULL, newpa);
+ ret = lwline_construct(line->SRID, ptarray_compute_box2d(newpa), newpa);
return ret;
}
newpa = ptarray_removePoint(line->points, index);
- ret = lwline_construct(line->SRID, NULL, newpa);
+ ret = lwline_construct(line->SRID, ptarray_compute_box2d(newpa), newpa);
return ret;
}
lwline_setPoint4d(LWLINE *line, unsigned int index, POINT4D *newpoint)
{
setPoint4d(line->points, index, newpoint);
+ /* Update the box, if there is one to update */
+ if( line->bbox )
+ {
+ lwgeom_drop_bbox((LWGEOM*)line);
+ lwgeom_add_bbox((LWGEOM*)line);
+ }
}
/**
line = lwline_deserialize(SERIALIZED_FORM(pglwg1));
if ( where == -1 ) where = line->points->npoints;
- else if ( (unsigned int)where > line->points->npoints )
+ else if ( where < 0 || where > line->points->npoints )
{
elog(ERROR, "Invalid offset");
PG_RETURN_NULL();