PostGIS  3.7.0dev-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 337 of file lwline.c.

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

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: