4200 int e2sign, e2freenode;
4204 size_t bufleft = 256;
4212 " with itself, try with another", eid1);
4219 if ((nedges == -1) || (edges == NULL))
4224 for ( i=0; i<nedges; ++i )
4226 if ( edges[i].edge_id == eid1 ) {
4229 lwerror(
"Corrupted topology: multiple edges have id %"
4235 else if ( edges[i].edge_id == eid2 ) {
4238 lwerror(
"Corrupted topology: multiple edges have id %"
4249 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4257 "SQL/MM Spatial exception - non-existent edge %" LWTFMT_ELEMID,
4291 if ( commonnode != -1 )
4296 if ( num_node_edges == -1 ) {
4301 for (i=0; i<num_node_edges; ++i)
4304 if ( node_edges[i].edge_id == eid1 )
continue;
4305 if ( node_edges[i].edge_id == eid2 )
continue;
4308 if ( bufleft > 0 ) {
4310 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4311 if (
r >= (
int) bufleft )
4329 if ( commonnode == -1 )
4342 if ( commonnode != -1 )
4347 if ( num_node_edges == -1 ) {
4352 for (i=0; i<num_node_edges; ++i)
4355 if ( node_edges[i].edge_id == eid1 )
continue;
4356 if ( node_edges[i].edge_id == eid2 )
continue;
4359 if ( bufleft > 0 ) {
4361 ( ptr==buf ?
"" :
"," ), node_edges[i].edge_id);
4362 if (
r >= (
int) bufleft )
4377 if ( num_node_edges )
lwfree(node_edges);
4381 if ( commonnode == -1 )
4386 lwerror(
"SQL/MM Spatial exception - other edges connected (%s)",
4391 lwerror(
"SQL/MM Spatial exception - non-connected edges");
4468 lwerror(
"Coding error: caseno=%d should never happen", caseno);
4494 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
4510 }
else if ( i == 0 ) {
4513 lwerror(
"Insertion of split edge failed (no reason)");
4625 eid1, eid2, newedge.
edge_id) )
4631 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)
void ptarray_free(POINTARRAY *pa)
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
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)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
static int lwt_be_updateTopoGeomEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge)
static int lwt_be_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int numelems)
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)
static LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
int lwt_be_insertEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, int 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