PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ _lwt_split_by_nodes()

static LWGEOM* _lwt_split_by_nodes ( const LWGEOM g,
const LWGEOM nodes 
)
static

Definition at line 5495 of file lwgeom_topo.c.

5496 {
5497  LWCOLLECTION *col = lwgeom_as_lwcollection(nodes);
5498  uint32_t i;
5499  LWGEOM *bg;
5500 
5501  bg = lwgeom_clone_deep(g);
5502  if ( ! col->ngeoms ) return bg;
5503 
5504  for (i=0; i<col->ngeoms; ++i)
5505  {
5506  LWGEOM *g2;
5507  g2 = lwgeom_split(bg, col->geoms[i]);
5508  lwgeom_free(bg);
5509  bg = g2;
5510  }
5511  bg->srid = nodes->srid;
5512 
5513  return bg;
5514 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_split(const LWGEOM *lwgeom_in, const LWGEOM *blade_in)
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
Definition: lwgeom.c:520
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:224
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
int32_t srid
Definition: liblwgeom.h:402
unsigned int uint32_t
Definition: uthash.h:78

References LWCOLLECTION::geoms, lwgeom_as_lwcollection(), lwgeom_clone_deep(), lwgeom_free(), lwgeom_split(), LWCOLLECTION::ngeoms, and LWGEOM::srid.

Referenced by _lwt_AddLine().

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