Remove an isolated edge.
3926{
3932 uint64_t n = 1;
3933 uint64_t i;
3934
3939 if ( ! edge )
3940 {
3942 return -1;
3943 }
3944 if ( ! n )
3945 {
3946 lwerror(
"SQL/MM Spatial exception - non-existent edge");
3947 return -1;
3948 }
3949 if ( n > 1 )
3950 {
3952 lwerror(
"Corrupted topology: more than a single edge have id %"
3954 return -1;
3955 }
3956
3957 if ( edge[0].face_left != edge[0].face_right )
3958 {
3960 lwerror(
"SQL/MM Spatial exception - not isolated edge");
3961 return -1;
3962 }
3964
3968
3969 n = 2;
3971 if ((n == UINT64_MAX) || (edge == NULL))
3972 {
3974 return -1;
3975 }
3976 for (i = 0; i < n; ++i)
3977 {
3978 if (edge[i].edge_id != id)
3979 {
3981 lwerror(
"SQL/MM Spatial exception - not isolated edge");
3982 return -1;
3983 }
3984 }
3986
3989 if (n == UINT64_MAX)
3990 {
3992 return -1;
3993 }
3994 if ( n != 1 )
3995 {
3996 lwerror(
"Unexpected error: %" PRIu64
" edges deleted when expecting 1", n);
3997 return -1;
3998 }
3999
4002 n = 1;
4003 if ( nid[1] != nid[0] ) {
4006 ++n;
4007 }
4010 if (n == UINT64_MAX)
4011 {
4013 return -1;
4014 }
4015
4016
4017
4018
4020 {
4022 return -1;
4023 }
4024
4025 return 0;
4026}
#define LWT_COL_EDGE_FACE_RIGHT
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_START_NODE
#define LWT_COL_EDGE_FACE_LEFT
#define LWT_COL_NODE_CONTAINING_FACE
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_END_NODE
#define PGTOPO_BE_ERROR()
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static int lwt_be_checkTopoGeomRemIsoEdge(LWT_TOPOLOGY *topo, LWT_ELEMID edge_id)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
static int lwt_be_updateNodesById(LWT_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, int numnodes, int upd_fields)
int lwt_be_deleteEdges(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
LWT_ELEMID containing_face
const LWT_BE_IFACE * be_iface