PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ LWGEOM_GEOS_nodeLines()

static GEOSGeometry* LWGEOM_GEOS_nodeLines ( const GEOSGeometry *  lines)
static

Definition at line 337 of file liblwgeom/lwgeom_geos_clean.c.

References GEOS2LWGEOM(), LWDEBUGF, LWGEOM_GEOS_getPointN(), and lwgeom_to_ewkt().

Referenced by LWGEOM_GEOS_makeValidLine(), and LWGEOM_GEOS_makeValidPolygon().

338 {
339  GEOSGeometry* noded;
340  GEOSGeometry* point;
341 
342  /*
343  * Union with first geometry point, obtaining full noding
344  * and dissolving of duplicated repeated points
345  *
346  * TODO: substitute this with UnaryUnion?
347  */
348 
349  point = LWGEOM_GEOS_getPointN(lines, 0);
350  if ( ! point ) return NULL;
351 
352  LWDEBUGF(3,
353  "Boundary point: %s",
354  lwgeom_to_ewkt(GEOS2LWGEOM(point, 0)));
355 
356  noded = GEOSUnion(lines, point);
357  if ( NULL == noded )
358  {
359  GEOSGeom_destroy(point);
360  return NULL;
361  }
362 
363  GEOSGeom_destroy(point);
364 
365  LWDEBUGF(3,
366  "LWGEOM_GEOS_nodeLines: in[%s] out[%s]",
367  lwgeom_to_ewkt(GEOS2LWGEOM(lines, 0)),
368  lwgeom_to_ewkt(GEOS2LWGEOM(noded, 0)));
369 
370  return noded;
371 }
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:518
GEOSGeometry * LWGEOM_GEOS_getPointN(const GEOSGeometry *, uint32_t)
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
Here is the call graph for this function:
Here is the caller graph for this function: