PostGIS  2.2.7dev-r@@SVN_REVISION@@
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 3718 of file lwgeom_topo.c.

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

3719 {
3720  LWT_ISO_NODE *node;
3721  int n = 1;
3722 
3723  node = _lwt_GetIsoNode( topo, nid );
3724  if ( ! node ) return -1;
3725 
3726  n = lwt_be_deleteNodesById( topo, &nid, n );
3727  if ( n == -1 )
3728  {
3729  lwfree(node);
3730  lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface));
3731  return -1;
3732  }
3733  if ( n != 1 )
3734  {
3735  lwfree(node);
3736  lwerror("Unexpected error: %d nodes deleted when expecting 1", n);
3737  return -1;
3738  }
3739 
3740  /* TODO: notify to caller about node being removed ?
3741  * See https://trac.osgeo.org/postgis/ticket/3231
3742  */
3743 
3744  lwfree(node);
3745  return 0; /* success */
3746 }
void lwfree(void *mem)
Definition: lwutil.c:214
static int lwt_be_deleteNodesById(const LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int numelems)
Definition: lwgeom_topo.c:217
const LWT_BE_IFACE * be_iface
static LWT_ISO_NODE * _lwt_GetIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID nid)
Definition: lwgeom_topo.c:3652
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
Definition: lwgeom_topo.c:124
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74

Here is the call graph for this function: