PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWT_TOPOLOGY* lwt_LoadTopology ( LWT_BE_IFACE iface,
const char *  name 
)

Loads an existing topology by name from the database.

Parameters
ifacethe backend interface handler (see lwt_CreateBackendIface)
namename of the topology to load
Returns
the handler of the topology, or NULL on error (liblwgeom error handler will be invoked with error message)

Definition at line 493 of file lwgeom_topo.c.

References LWT_TOPOLOGY_T::be_iface, LWT_TOPOLOGY_T::be_topo, LWT_TOPOLOGY_T::hasZ, lwalloc(), lwerror(), lwt_be_lastErrorMessage(), lwt_be_loadTopologyByName(), lwt_be_topoGetPrecision(), lwt_be_topoGetSRID(), lwt_be_topoHasZ(), LWT_TOPOLOGY_T::precision, and LWT_TOPOLOGY_T::srid.

494 {
495  LWT_BE_TOPOLOGY* be_topo;
496  LWT_TOPOLOGY* topo;
497 
498  be_topo = lwt_be_loadTopologyByName(iface, name);
499  if ( ! be_topo ) {
500  //lwerror("Could not load topology from backend: %s",
501  lwerror("%s", lwt_be_lastErrorMessage(iface));
502  return NULL;
503  }
504  topo = lwalloc(sizeof(LWT_TOPOLOGY));
505  topo->be_iface = iface;
506  topo->be_topo = be_topo;
507  topo->srid = lwt_be_topoGetSRID(topo);
508  topo->hasZ = lwt_be_topoHasZ(topo);
509  topo->precision = lwt_be_topoGetPrecision(topo);
510 
511  return topo;
512 }
static int lwt_be_topoGetSRID(LWT_TOPOLOGY *topo)
Definition: lwgeom_topo.c:132
static double lwt_be_topoGetPrecision(LWT_TOPOLOGY *topo)
Definition: lwgeom_topo.c:138
const LWT_BE_IFACE * be_iface
LWT_BE_TOPOLOGY * be_topo
struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
Topology handler.
void * lwalloc(size_t size)
Definition: lwutil.c:227
static int lwt_be_topoHasZ(LWT_TOPOLOGY *topo)
Definition: lwgeom_topo.c:144
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
Definition: lwgeom_topo.c:120
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
LWT_BE_TOPOLOGY * lwt_be_loadTopologyByName(LWT_BE_IFACE *be, const char *name)
Definition: lwgeom_topo.c:126

Here is the call graph for this function: