4377 uint64_t num_node_edges;
4384 int e2sign, e2freenode;
4388 size_t bufleft = 256;
4396 " with itself, try with another", eid1);
4403 if ((nedges == UINT64_MAX) || (edges == NULL))
4408 for ( i=0; i<nedges; ++i )
4410 if ( edges[i].edge_id == eid1 ) {
4413 lwerror(
"Corrupted topology: multiple edges have id %"
4419 else if ( edges[i].edge_id == eid2 ) {
4422 lwerror(
"Corrupted topology: multiple edges have id %"
4433 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4441 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4475 if ( commonnode != -1 )
4480 if (num_node_edges == UINT64_MAX)
4486 for (i=0; i<num_node_edges; ++i)
4489 if ( node_edges[i].edge_id == eid1 )
continue;
4490 if ( node_edges[i].edge_id == eid2 )
continue;
4493 if ( bufleft > 0 ) {
4495 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4496 if (
r >= (
int) bufleft )
4514 if ( commonnode == -1 )
4527 if ( commonnode != -1 )
4532 if (num_node_edges == UINT64_MAX)
4538 for (i=0; i<num_node_edges; ++i)
4541 if ( node_edges[i].edge_id == eid1 )
continue;
4542 if ( node_edges[i].edge_id == eid2 )
continue;
4545 if ( bufleft > 0 ) {
4547 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4548 if (
r >= (
int) bufleft )
4563 if ( num_node_edges )
lwfree(node_edges);
4567 if ( commonnode == -1 )
4572 lwerror(
"SQL/MM Spatial exception - other edges connected (%s)",
4577 lwerror(
"SQL/MM Spatial exception - non-connected edges");
4654 lwerror(
"Coding error: caseno=%d should never happen", caseno);
4680 lwerror(
"Unexpected error: %" PRIu64
" edges updated when expecting 1", i);
4702 lwerror(
"Insertion of split edge failed (no reason)");
4806 eid1, eid2, newedge.
edge_id) )
4812 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
#define PGTOPO_BE_ERROR()
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
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 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)
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
int lwt_be_insertEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, uint64_t numelems)
const LWT_BE_IFACE * be_iface