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

◆ lwt_LoadTopology()

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

478{
479 LWT_BE_TOPOLOGY* be_topo;
480 LWT_TOPOLOGY* topo;
481
482 be_topo = lwt_be_loadTopologyByName(iface, name);
483 if ( ! be_topo ) {
484 //lwerror("Could not load topology from backend: %s",
485 lwerror("%s", lwt_be_lastErrorMessage(iface));
486 return NULL;
487 }
488 topo = lwalloc(sizeof(LWT_TOPOLOGY));
489 topo->be_iface = iface;
490 topo->be_topo = be_topo;
491 topo->srid = lwt_be_topoGetSRID(topo);
492 topo->hasZ = lwt_be_topoHasZ(topo);
494
495 return topo;
496}
void * lwalloc(size_t size)
Definition lwutil.c:227
struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
Topology handler.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
static double lwt_be_topoGetPrecision(LWT_TOPOLOGY *topo)
LWT_BE_TOPOLOGY * lwt_be_loadTopologyByName(LWT_BE_IFACE *be, const char *name)
static int lwt_be_topoHasZ(LWT_TOPOLOGY *topo)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static int lwt_be_topoGetSRID(LWT_TOPOLOGY *topo)
LWT_BE_TOPOLOGY * be_topo
const LWT_BE_IFACE * be_iface

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.

Here is the call graph for this function: