4238 uint64_t num_node_edges;
4245 int e2sign, e2freenode;
4249 size_t bufleft = 256;
4257 " with itself, try with another", eid1);
4264 if ((nedges == UINT64_MAX) || (edges == NULL))
4269 for ( i=0; i<nedges; ++i )
4271 if ( edges[i].edge_id == eid1 ) {
4274 lwerror(
"Corrupted topology: multiple edges have id %"
4280 else if ( edges[i].edge_id == eid2 ) {
4283 lwerror(
"Corrupted topology: multiple edges have id %"
4294 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4302 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4336 if ( commonnode != -1 )
4341 if (num_node_edges == UINT64_MAX)
4347 for (i=0; i<num_node_edges; ++i)
4350 if ( node_edges[i].edge_id == eid1 )
continue;
4351 if ( node_edges[i].edge_id == eid2 )
continue;
4354 if ( bufleft > 0 ) {
4356 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4357 if (
r >= (
int) bufleft )
4375 if ( commonnode == -1 )
4388 if ( commonnode != -1 )
4393 if (num_node_edges == UINT64_MAX)
4399 for (i=0; i<num_node_edges; ++i)
4402 if ( node_edges[i].edge_id == eid1 )
continue;
4403 if ( node_edges[i].edge_id == eid2 )
continue;
4406 if ( bufleft > 0 ) {
4408 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4409 if (
r >= (
int) bufleft )
4424 if ( num_node_edges )
lwfree(node_edges);
4428 if ( commonnode == -1 )
4433 lwerror(
"SQL/MM Spatial exception - other edges connected (%s)",
4438 lwerror(
"SQL/MM Spatial exception - non-connected edges");
4515 lwerror(
"Coding error: caseno=%d should never happen", caseno);
4541 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
4563 lwerror(
"Insertion of split edge failed (no reason)");
4667 eid1, eid2, newedge.
edge_id) )
4673 return modEdge ? commonnode : newedge.
edge_id;
char result[OUT_DOUBLE_BUFFER_SIZE]
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