PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwt_RemoveIsoNode()

int lwt_RemoveIsoNode ( LWT_TOPOLOGY topo,
LWT_ELEMID  node 
)

Remove an isolated node.

For ST_RemoveIsoNode

Parameters
topothe topology to operate on
nodethe identifier of the node to be moved
Returns
0 on success, -1 on error (liblwgeom error handler will be invoked with error message)

Definition at line 3891 of file lwgeom_topo.c.

3892{
3893 LWT_ISO_NODE *node;
3894 int n = 1;
3895
3896 node = _lwt_GetIsoNode( topo, nid );
3897 if ( ! node ) return -1;
3898
3899 n = lwt_be_deleteNodesById( topo, &nid, n );
3900 if ( n == -1 )
3901 {
3902 lwfree(node);
3904 return -1;
3905 }
3906 if ( n != 1 )
3907 {
3908 lwfree(node);
3909 lwerror("Unexpected error: %d nodes deleted when expecting 1", n);
3910 return -1;
3911 }
3912
3913 if ( ! lwt_be_checkTopoGeomRemIsoNode(topo, nid) )
3914 {
3915 lwfree(node);
3917 return -1;
3918 }
3919
3920 lwfree(node);
3921 return 0; /* success */
3922}
void lwfree(void *mem)
Definition lwutil.c:248
#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_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
static LWT_ISO_NODE * _lwt_GetIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID nid)
static int lwt_be_checkTopoGeomRemIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node_id)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
const LWT_BE_IFACE * be_iface

References _lwt_GetIsoNode(), LWT_TOPOLOGY_T::be_iface, lwerror(), lwfree(), lwt_be_checkTopoGeomRemIsoNode(), lwt_be_deleteNodesById(), lwt_be_lastErrorMessage(), and PGTOPO_BE_ERROR.

Here is the call graph for this function: