5429 LWPOINT *start_point, *end_point;
5438 LWDEBUGF(1,
"_lwtAddLineEdge with tolerance %g", tol);
5441 if ( ! start_point )
5443 lwnotice(
"Empty component of noded line");
5448 if ( nid[0] == -1 )
return -1;
5453 lwerror(
"could not get last point of line " 5454 "after successfully getting first point !?");
5459 if ( nid[1] == -1 )
return -1;
5466 nn = nid[0] == nid[1] ? 1 : 2;
5474 start_point = NULL; end_point = NULL;
5475 for (i=0; i<nn; ++i)
5477 if ( node[i].node_id == nid[0] ) start_point = node[i].
geom;
5478 if ( node[i].node_id == nid[1] ) end_point = node[i].
geom;
5480 if ( ! start_point || ! end_point )
5512 LWDEBUG(1,
"Made-valid snapped edge collapsed");
5524 lwerror(
"lwcollection_extract(LINETYPE) returned a non-line?");
5533 LWDEBUGF(1,
"Made-valid snapped edge collapsed to %s",
5561 LWDEBUGG(1, tmp2,
"Repeated-point removed");
static LWT_ELEMID _lwt_GetEqualEdge(LWT_TOPOLOGY *topo, LWLINE *edge)
static void _lwt_release_nodes(LWT_ISO_NODE *nodes, int num_nodes)
LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY *topo, LWPOINT *point, double tol)
Adds a point to the topology.
LWCOLLECTION * lwcollection_extract(LWCOLLECTION *col, int type)
Takes a potentially heterogeneous collection and returns a homogeneous collection consisting only of ...
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
#define LWDEBUG(level, msg)
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
void lwline_setPoint4d(LWLINE *line, uint32_t which, POINT4D *newpoint)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
LWGEOM * lwgeom_make_valid(LWGEOM *geom)
Attempts to make an invalid geometries valid w/out losing points.
const LWT_BE_IFACE * be_iface
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
#define LWDEBUGG(level, geom, msg)
#define LWT_COL_NODE_NODE_ID
Node fields.
LWGEOM * lwline_remove_repeated_points(const LWLINE *in, double tolerance)
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
LWT_ELEMID lwt_AddEdgeModFace(LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, LWLINE *geom, int skipChecks)
Add a new edge possibly splitting a face (modifying it)
LWPOINT * lwline_get_lwpoint(const LWLINE *line, int where)
Returns freshly allocated LWPOINT that corresponds to the index where.
#define LWT_COL_NODE_GEOM
void lwcollection_free(LWCOLLECTION *col)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
LWT_ISO_NODE * lwt_be_getNodeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
#define LWDEBUGF(level, msg,...)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)