PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ 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 3774 of file lwgeom_topo.c.

3775 {
3776  LWT_ISO_NODE *node;
3777  int n = 1;
3778 
3779  node = _lwt_GetIsoNode( topo, nid );
3780  if ( ! node ) return -1;
3781 
3782  n = lwt_be_deleteNodesById( topo, &nid, n );
3783  if ( n == -1 )
3784  {
3785  lwfree(node);
3786  PGTOPO_BE_ERROR();
3787  return -1;
3788  }
3789  if ( n != 1 )
3790  {
3791  lwfree(node);
3792  lwerror("Unexpected error: %d nodes deleted when expecting 1", n);
3793  return -1;
3794  }
3795 
3796  if ( ! lwt_be_checkTopoGeomRemIsoNode(topo, nid) )
3797  {
3798  lwfree(node);
3800  return -1;
3801  }
3802 
3803  lwfree(node);
3804  return 0; /* success */
3805 }
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.
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
Definition: lwgeom_topo.c:114
static int lwt_be_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
Definition: lwgeom_topo.c:203
static LWT_ISO_NODE * _lwt_GetIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID nid)
Definition: lwgeom_topo.c:3696
static int lwt_be_checkTopoGeomRemIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node_id)
Definition: lwgeom_topo.c:351
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: