5307 LWPOINT *start_point, *end_point;
5317 LWDEBUGF(1,
"_lwtAddLineEdge with tolerance %g", tol);
5320 if ( ! start_point )
5322 lwnotice(
"Empty component of noded line");
5327 handleFaceSplit, &mm );
5329 if ( nid[0] == -1 )
return -1;
5336 lwerror(
"could not get last point of line "
5337 "after successfully getting first point !?");
5342 handleFaceSplit, &mm );
5345 if ( nid[1] == -1 )
return -1;
5354 nn = nid[0] == nid[1] ? 1 : 2;
5362 start_point = NULL; end_point = NULL;
5363 for (i=0; i<nn; ++i)
5365 if ( node[i].node_id == nid[0] ) start_point = node[i].
geom;
5366 if ( node[i].node_id == nid[1] ) end_point = node[i].
geom;
5368 if ( ! start_point || ! end_point )
5400 LWDEBUG(1,
"Made-valid snapped edge collapsed");
5412 lwerror(
"lwcollection_extract(LINETYPE) returned a non-line?");
5421 LWDEBUGF(1,
"Made-valid snapped edge collapsed to %s",
5450 LWDEBUGG(1, tmp2,
"Repeated-point removed");
5459 LWDEBUG(1,
"Repeated-point removed edge collapsed");
5480 id =
_lwt_AddEdge( topo, nid[0], nid[1], edge, 0, handleFaceSplit ? 1 : -1 );
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void lwcollection_free(LWCOLLECTION *col)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
void lwline_setPoint4d(LWLINE *line, uint32_t which, POINT4D *newpoint)
LWCOLLECTION * lwcollection_extract(LWCOLLECTION *col, int type)
Takes a potentially heterogeneous collection and returns a homogeneous collection consisting only of ...
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
LWGEOM * lwgeom_make_valid(LWGEOM *geom)
Attempts to make an invalid geometries valid w/out losing points.
LWPOINT * lwline_get_lwpoint(const LWLINE *line, uint32_t where)
Returns freshly allocated LWPOINT that corresponds to the index where.
LWGEOM * lwline_remove_repeated_points(const LWLINE *in, double tolerance)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_NODE_GEOM
#define LWT_COL_NODE_NODE_ID
Node fields.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
#define LWDEBUGG(level, geom, msg)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static LWT_ELEMID _lwt_AddEdge(LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, LWLINE *geom, int skipChecks, int modFace)
LWT_ISO_NODE * lwt_be_getNodeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
static void _lwt_release_nodes(LWT_ISO_NODE *nodes, int num_nodes)
static double _lwt_minTolerance(LWGEOM *g)
static LWT_ELEMID _lwt_GetEqualEdge(LWT_TOPOLOGY *topo, LWLINE *edge)
static LWT_ELEMID _lwt_AddPoint(LWT_TOPOLOGY *topo, LWPOINT *point, double tol, int findFace, int *moved)
const LWT_BE_IFACE * be_iface