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

Add a LWPOINT to an LWLINE.

Definition at line 313 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().

314 {
315  POINT4D pt;
316  getPoint4d_p(point->point, 0, &pt);
317 
318  if ( ptarray_insert_point(line->points, &pt, where) != LW_SUCCESS )
319  return LW_FAILURE;
320 
321  /* Update the bounding box */
322  if ( line->bbox )
323  {
326  }
327 
328  return LW_SUCCESS;
329 }
GBOX * bbox
Definition: liblwgeom.h:404
#define LW_SUCCESS
Definition: liblwgeom.h:65
POINTARRAY * point
Definition: liblwgeom.h:395
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:586
#define LW_FAILURE
Definition: liblwgeom.h:64
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:96
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:599
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:231
POINTARRAY * points
Definition: liblwgeom.h:406

Here is the call graph for this function:

Here is the caller graph for this function: