PostGIS  3.2.2dev-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 3696 of file lwgeom_topo.c.

3697 {
3698  LWT_ISO_NODE *node;
3699  int n = 1;
3700 
3701  node = _lwt_GetIsoNode( topo, nid );
3702  if ( ! node ) return -1;
3703 
3704  n = lwt_be_deleteNodesById( topo, &nid, n );
3705  if ( n == -1 )
3706  {
3707  lwfree(node);
3708  lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface));
3709  return -1;
3710  }
3711  if ( n != 1 )
3712  {
3713  lwfree(node);
3714  lwerror("Unexpected error: %d nodes deleted when expecting 1", n);
3715  return -1;
3716  }
3717 
3718  if ( ! lwt_be_checkTopoGeomRemIsoNode(topo, nid) )
3719  {
3720  lwfree(node);
3722  return -1;
3723  }
3724 
3725  lwfree(node);
3726  return 0; /* success */
3727 }
void lwfree(void *mem)
Definition: lwutil.c:242
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
Definition: lwgeom_topo.c:119
static int lwt_be_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
Definition: lwgeom_topo.c:208
static LWT_ISO_NODE * _lwt_GetIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID nid)
Definition: lwgeom_topo.c:3618
static int lwt_be_checkTopoGeomRemIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node_id)
Definition: lwgeom_topo.c:356
const LWT_BE_IFACE * be_iface

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

Here is the call graph for this function: