Remove an isolated edge.
3809{
3815 uint64_t n = 1;
3816 uint64_t i;
3817
3822 if ( ! edge )
3823 {
3825 return -1;
3826 }
3827 if ( ! n )
3828 {
3829 lwerror(
"SQL/MM Spatial exception - non-existent edge");
3830 return -1;
3831 }
3832 if ( n > 1 )
3833 {
3835 lwerror(
"Corrupted topology: more than a single edge have id %"
3837 return -1;
3838 }
3839
3840 if ( edge[0].face_left != edge[0].face_right )
3841 {
3843 lwerror(
"SQL/MM Spatial exception - not isolated edge");
3844 return -1;
3845 }
3847
3851
3852 n = 2;
3854 if ((n == UINT64_MAX) || (edge == NULL))
3855 {
3857 return -1;
3858 }
3859 for (i = 0; i < n; ++i)
3860 {
3861 if (edge[i].edge_id != id)
3862 {
3864 lwerror(
"SQL/MM Spatial exception - not isolated edge");
3865 return -1;
3866 }
3867 }
3869
3872 if (n == UINT64_MAX)
3873 {
3875 return -1;
3876 }
3877 if ( n != 1 )
3878 {
3879 lwerror(
"Unexpected error: %" PRIu64
" edges deleted when expecting 1", n);
3880 return -1;
3881 }
3882
3885 n = 1;
3886 if ( nid[1] != nid[0] ) {
3889 ++n;
3890 }
3893 if (n == UINT64_MAX)
3894 {
3896 return -1;
3897 }
3898
3899
3900
3901
3903 {
3905 return -1;
3906 }
3907
3908 return 0;
3909}
#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