PostGIS  2.4.9dev-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:420
#define LW_SUCCESS
Definition: liblwgeom.h:80
POINTARRAY * point
Definition: liblwgeom.h:411
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:635
#define LW_FAILURE
Definition: liblwgeom.h:79
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:298
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:648
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:122
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: