4344 int e2sign, e2freenode;
4348 size_t bufleft = 256;
4356 " with itself, try with another", eid1);
4368 for ( i=0; i<nedges; ++i )
4370 if ( edges[i].edge_id == eid1 ) {
4373 lwerror(
"Corrupted topology: multiple edges have id %" 4379 else if ( edges[i].edge_id == eid2 ) {
4382 lwerror(
"Corrupted topology: multiple edges have id %" 4392 lwerror(
"SQL/MM Spatial exception - non-existent edge %" 4399 lwerror(
"SQL/MM Spatial exception - non-existent edge %" 4433 if ( commonnode != -1 )
4438 if ( num_node_edges == -1 ) {
4443 for (i=0; i<num_node_edges; ++i)
4446 if ( node_edges[i].edge_id == eid1 )
continue;
4447 if ( node_edges[i].edge_id == eid2 )
continue;
4452 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4471 if ( commonnode == -1 )
4484 if ( commonnode != -1 )
4489 if ( num_node_edges == -1 ) {
4494 for (i=0; i<num_node_edges; ++i)
4497 if ( node_edges[i].edge_id == eid1 )
continue;
4498 if ( node_edges[i].edge_id == eid2 )
continue;
4503 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4519 if ( num_node_edges )
lwfree(node_edges);
4523 if ( commonnode == -1 )
4528 lwerror(
"SQL/MM Spatial exception - other edges connected (%s)",
4533 lwerror(
"SQL/MM Spatial exception - non-connected edges");
4610 lwerror(
"Coding error: caseno=%d should never happen", caseno);
4636 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
4652 }
else if ( i == 0 ) {
4655 lwerror(
"Insertion of split edge failed (no reason)");
4767 eid1, eid2, newedge.
edge_id) )
4773 return modEdge ? commonnode : newedge.
edge_id;
static int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
static int lwt_be_updateTopoGeomEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge)
void ptarray_free(POINTARRAY *pa)
int lwt_be_deleteEdges(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
void lwline_free(LWLINE *line)
#define LWT_COL_EDGE_START_NODE
static int lwt_be_checkTopoGeomRemNode(LWT_TOPOLOGY *topo, LWT_ELEMID node_id, LWT_ELEMID eid1, LWT_ELEMID eid2)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
int lwt_be_updateEdges(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields, const LWT_ISO_EDGE *upd_edge, int upd_fields, const LWT_ISO_EDGE *exc_edge, int exc_fields)
static int lwt_be_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int numelems)
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
const LWT_BE_IFACE * be_iface
#define LWT_COL_EDGE_END_NODE
int ptarray_append_ptarray(POINTARRAY *pa1, POINTARRAY *pa2, double gap_tolerance)
Append a POINTARRAY, pa2 to the end of an existing POINTARRAY, pa1.
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_NEXT_LEFT
int lwt_be_insertEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, int numelems)
#define LWT_COL_EDGE_NEXT_RIGHT
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
void ptarray_reverse(POINTARRAY *pa)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
static LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
#define LWT_COL_EDGE_GEOM
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.