PostGIS  2.2.7dev-r@@SVN_REVISION@@
static GEOSGeometry* LWGEOM_GEOS_nodeLines ( const GEOSGeometry *  lines)
static

Definition at line 347 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().

348 {
349  GEOSGeometry* noded;
350  GEOSGeometry* point;
351 
352  /*
353  * Union with first geometry point, obtaining full noding
354  * and dissolving of duplicated repeated points
355  *
356  * TODO: substitute this with UnaryUnion?
357  */
358 
359  point = LWGEOM_GEOS_getPointN(lines, 0);
360  if ( ! point ) return NULL;
361 
362  LWDEBUGF(3,
363  "Boundary point: %s",
364  lwgeom_to_ewkt(GEOS2LWGEOM(point, 0)));
365 
366  noded = GEOSUnion(lines, point);
367  if ( NULL == noded )
368  {
369  GEOSGeom_destroy(point);
370  return NULL;
371  }
372 
373  GEOSGeom_destroy(point);
374 
375  LWDEBUGF(3,
376  "LWGEOM_GEOS_nodeLines: in[%s] out[%s]",
377  lwgeom_to_ewkt(GEOS2LWGEOM(lines, 0)),
378  lwgeom_to_ewkt(GEOS2LWGEOM(noded, 0)));
379 
380  return noded;
381 }
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:469
GEOSGeometry * LWGEOM_GEOS_getPointN(const GEOSGeometry *, uint32_t)
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the call graph for this function:

Here is the caller graph for this function: