4208 uint64_t num_node_edges;
4215 int e2sign, e2freenode;
4219 size_t bufleft = 256;
4227 " with itself, try with another", eid1);
4234 if ((nedges == UINT64_MAX) || (edges == NULL))
4239 for ( i=0; i<nedges; ++i )
4241 if ( edges[i].edge_id == eid1 ) {
4244 lwerror(
"Corrupted topology: multiple edges have id %"
4250 else if ( edges[i].edge_id == eid2 ) {
4253 lwerror(
"Corrupted topology: multiple edges have id %"
4264 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4272 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4306 if ( commonnode != -1 )
4311 if (num_node_edges == UINT64_MAX)
4317 for (i=0; i<num_node_edges; ++i)
4320 if ( node_edges[i].edge_id == eid1 )
continue;
4321 if ( node_edges[i].edge_id == eid2 )
continue;
4324 if ( bufleft > 0 ) {
4326 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4327 if (
r >= (
int) bufleft )
4345 if ( commonnode == -1 )
4358 if ( commonnode != -1 )
4363 if (num_node_edges == UINT64_MAX)
4369 for (i=0; i<num_node_edges; ++i)
4372 if ( node_edges[i].edge_id == eid1 )
continue;
4373 if ( node_edges[i].edge_id == eid2 )
continue;
4376 if ( bufleft > 0 ) {
4378 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4379 if (
r >= (
int) bufleft )
4394 if ( num_node_edges )
lwfree(node_edges);
4398 if ( commonnode == -1 )
4403 lwerror(
"SQL/MM Spatial exception - other edges connected (%s)",
4408 lwerror(
"SQL/MM Spatial exception - non-connected edges");
4485 lwerror(
"Coding error: caseno=%d should never happen", caseno);
4506 else if (result != 1)
4510 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
4528 else if (result == 0)
4532 lwerror(
"Insertion of split edge failed (no reason)");
4636 eid1, eid2, newedge.
edge_id) )
4642 return modEdge ? commonnode : newedge.
edge_id;
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)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
void ptarray_free(POINTARRAY *pa)
void lwline_free(LWLINE *line)
void ptarray_reverse_in_place(POINTARRAY *pa)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_START_NODE
#define LWT_COL_EDGE_NEXT_RIGHT
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_END_NODE
#define LWT_COL_EDGE_NEXT_LEFT
#define LWT_COL_EDGE_GEOM
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static int lwt_be_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
static int lwt_be_updateTopoGeomEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge)
static LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
static int lwt_be_checkTopoGeomRemNode(LWT_TOPOLOGY *topo, LWT_ELEMID node_id, LWT_ELEMID eid1, LWT_ELEMID eid2)
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)
int lwt_be_deleteEdges(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
int lwt_be_insertEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, uint64_t numelems)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
static int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
const LWT_BE_IFACE * be_iface