PostGIS  2.1.10dev-r@@SVN_REVISION@@
int lwline_add_lwpoint ( LWLINE line,
LWPOINT point,
int  where 
)

Add a LWPOINT to an LWLINE.

Definition at line 312 of file lwline.c.

References LWLINE::bbox, getPoint4d_p(), LW_FAILURE, LW_SUCCESS, lwgeom_add_bbox(), lwgeom_drop_bbox(), lwline_as_lwgeom(), LWPOINT::point, LWLINE::points, and ptarray_insert_point().

Referenced by LWGEOM_addpoint().

313 {
314  POINT4D pt;
315  getPoint4d_p(point->point, 0, &pt);
316 
317  if ( ptarray_insert_point(line->points, &pt, where) != LW_SUCCESS )
318  return LW_FAILURE;
319 
320  /* Update the bounding box */
321  if ( line->bbox )
322  {
325  }
326 
327  return LW_SUCCESS;
328 }
GBOX * bbox
Definition: liblwgeom.h:376
#define LW_SUCCESS
Definition: liblwgeom.h:55
POINTARRAY * point
Definition: liblwgeom.h:367
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:542
#define LW_FAILURE
Definition: liblwgeom.h:54
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:249
int ptarray_insert_point(POINTARRAY *pa, const POINT4D *p, int where)
Insert a point into an existing POINTARRAY.
Definition: ptarray.c:84
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:555
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:217
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: