PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwline_add_lwpoint()

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

Add a LWPOINT to an LWLINE.

Definition at line 336 of file lwline.c.

337 {
338  POINT4D pt;
339  getPoint4d_p(point->point, 0, &pt);
340 
341  if ( ptarray_insert_point(line->points, &pt, where) != LW_SUCCESS )
342  return LW_FAILURE;
343 
344  /* Update the bounding box */
345  if ( line->bbox )
346  {
347  lwgeom_refresh_bbox((LWGEOM*)line);
348  }
349 
350  return LW_SUCCESS;
351 }
void lwgeom_refresh_bbox(LWGEOM *lwgeom)
Drop current bbox and calculate a fresh one.
Definition: lwgeom.c:698
#define LW_FAILURE
Definition: liblwgeom.h:79
#define LW_SUCCESS
Definition: liblwgeom.h:80
int ptarray_insert_point(POINTARRAY *pa, const POINT4D *p, uint32_t where)
Insert a point into an existing POINTARRAY.
Definition: ptarray.c:96
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:123
GBOX * bbox
Definition: liblwgeom.h:423
POINTARRAY * points
Definition: liblwgeom.h:425
POINTARRAY * point
Definition: liblwgeom.h:414

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

Referenced by LWGEOM_addpoint().

Here is the call graph for this function:
Here is the caller graph for this function: