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

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

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