PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwline_add_lwpoint()

int lwline_add_lwpoint ( LWLINE line,
LWPOINT point,
int  where 
)

Add a LWPOINT to an LWLINE.

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

343 {
344  POINT4D pt;
345  getPoint4d_p(point->point, 0, &pt);
346 
347  if ( ptarray_insert_point(line->points, &pt, where) != LW_SUCCESS )
348  return LW_FAILURE;
349 
350  /* Update the bounding box */
351  if ( line->bbox )
352  {
355  }
356 
357  return LW_SUCCESS;
358 }
GBOX * bbox
Definition: liblwgeom.h:419
#define LW_SUCCESS
Definition: liblwgeom.h:79
POINTARRAY * point
Definition: liblwgeom.h:410
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:599
#define LW_FAILURE
Definition: liblwgeom.h:78
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:262
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:612
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:244
POINTARRAY * points
Definition: liblwgeom.h:421
Here is the call graph for this function:
Here is the caller graph for this function: