PostGIS  2.4.9dev-r@@SVN_REVISION@@
liblwgeom_topo.h File Reference
#include "liblwgeom.h"
Include dependency graph for liblwgeom_topo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  LWT_ISO_NODE
 NODE. More...
 
struct  LWT_ISO_EDGE
 EDGE. More...
 
struct  LWT_ISO_FACE
 FACE. More...
 
struct  LWT_BE_CALLBACKS_T
 Structure containing base backend callbacks. More...
 
struct  LWT_TOPOERR_T
 Topology error. More...
 

Macros

#define LWT_COL_NODE_NODE_ID   1<<0
 Node fields. More...
 
#define LWT_COL_NODE_CONTAINING_FACE   1<<1
 
#define LWT_COL_NODE_GEOM   1<<2
 
#define LWT_COL_NODE_ALL   (1<<3)-1
 
#define LWT_COL_EDGE_EDGE_ID   1<<0
 Edge fields. More...
 
#define LWT_COL_EDGE_START_NODE   1<<1
 
#define LWT_COL_EDGE_END_NODE   1<<2
 
#define LWT_COL_EDGE_FACE_LEFT   1<<3
 
#define LWT_COL_EDGE_FACE_RIGHT   1<<4
 
#define LWT_COL_EDGE_NEXT_LEFT   1<<5
 
#define LWT_COL_EDGE_NEXT_RIGHT   1<<6
 
#define LWT_COL_EDGE_GEOM   1<<7
 
#define LWT_COL_EDGE_ALL   (1<<8)-1
 
#define LWT_COL_FACE_FACE_ID   1<<0
 Face fields. More...
 
#define LWT_COL_FACE_MBR   1<<1
 
#define LWT_COL_FACE_ALL   (1<<2)-1
 

Typedefs

typedef int64_t LWT_INT64
 
typedef LWT_INT64 LWT_ELEMID
 Identifier of topology element. More...
 
typedef enum LWT_SPATIALTYPE_T LWT_SPATIALTYPE
 
typedef struct LWT_BE_DATA_T LWT_BE_DATA
 Backend private data pointer. More...
 
typedef struct LWT_BE_IFACE_T LWT_BE_IFACE
 Backend interface handler. More...
 
typedef struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
 Topology handler. More...
 
typedef struct LWT_BE_CALLBACKS_T LWT_BE_CALLBACKS
 Structure containing base backend callbacks. More...
 
typedef enum LWT_TOPOERR_TYPE_T LWT_TOPOERR_TYPE
 Topology errors type. More...
 
typedef struct LWT_TOPOERR_T LWT_TOPOERR
 Topology error. More...
 
typedef struct LWT_TOPOLOGY_T LWT_TOPOLOGY
 Opaque topology structure. More...
 

Enumerations

enum  LWT_SPATIALTYPE_T { LWT_PUNTAL = 0, LWT_LINEAL = 1, LWT_AREAL = 2, LWT_COLLECTION = 3 }
 
enum  LWT_TOPOERR_TYPE_T {
  LWT_TOPOERR_EDGE_CROSSES_NODE, LWT_TOPOERR_EDGE_INVALID, LWT_TOPOERR_EDGE_NOT_SIMPLE, LWT_TOPOERR_EDGE_CROSSES_EDGE,
  LWT_TOPOERR_EDGE_STARTNODE_MISMATCH, LWT_TOPOERR_EDGE_ENDNODE_MISMATCH, LWT_TOPOERR_FACE_WITHOUT_EDGES, LWT_TOPOERR_FACE_HAS_NO_RINGS,
  LWT_TOPOERR_FACE_OVERLAPS_FACE, LWT_TOPOERR_FACE_WITHIN_FACE
}
 Topology errors type. More...
 

Functions

void lwt_iso_node_release (LWT_ISO_NODE *node)
 
LWT_BE_IFACElwt_CreateBackendIface (const LWT_BE_DATA *data)
 Create a new backend interface. More...
 
void lwt_BackendIfaceRegisterCallbacks (LWT_BE_IFACE *iface, const LWT_BE_CALLBACKS *cb)
 Register backend callbacks into the opaque iface handler. More...
 
void lwt_FreeBackendIface (LWT_BE_IFACE *iface)
 Release memory associated with an LWT_BE_IFACE. More...
 
LWT_TOPOLOGYlwt_CreateTopology (LWT_BE_IFACE *iface, const char *name, int srid, double prec, int hasz)
 Initializes a new topology. More...
 
LWT_TOPOLOGYlwt_LoadTopology (LWT_BE_IFACE *iface, const char *name)
 Loads an existing topology by name from the database. More...
 
void lwt_DropTopology (LWT_TOPOLOGY *topo)
 Drop a topology and all its associated objects from the database. More...
 
void lwt_FreeTopology (LWT_TOPOLOGY *topo)
 Release memory associated with an LWT_TOPOLOGY. More...
 
LWT_ELEMID lwt_GetNodeByPoint (LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
 Retrieve the id of a node at a point location. More...
 
LWT_ELEMID lwt_GetEdgeByPoint (LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
 Find the edge-id of an edge that intersects a given point. More...
 
LWT_ELEMID lwt_GetFaceByPoint (LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
 Find the face-id of a face containing a given point. More...
 
LWT_ELEMID lwt_AddPoint (LWT_TOPOLOGY *topo, LWPOINT *point, double tol)
 Adds a point to the topology. More...
 
LWT_ELEMIDlwt_AddLine (LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
 Adds a linestring to the topology. More...
 
LWT_ELEMIDlwt_AddPolygon (LWT_TOPOLOGY *topo, LWPOLY *poly, double tol, int *nfaces)
 Adds a polygon to the topology. More...
 
void lwt_CreateTopoGeo (LWT_TOPOLOGY *topo, LWGEOM *geom)
 Populate an empty topology with data from a simple geometry. More...
 
LWT_ELEMID lwt_AddIsoNode (LWT_TOPOLOGY *topo, LWT_ELEMID face, LWPOINT *pt, int skipChecks)
 Add an isolated node. More...
 
int lwt_MoveIsoNode (LWT_TOPOLOGY *topo, LWT_ELEMID node, LWPOINT *pt)
 Move an isolated node. More...
 
int lwt_RemoveIsoNode (LWT_TOPOLOGY *topo, LWT_ELEMID node)
 Remove an isolated node. More...
 
int lwt_RemIsoEdge (LWT_TOPOLOGY *topo, LWT_ELEMID edge)
 Remove an isolated edge. More...
 
LWT_ELEMID lwt_AddIsoEdge (LWT_TOPOLOGY *topo, LWT_ELEMID startNode, LWT_ELEMID endNode, const LWLINE *geom)
 Add an isolated edge connecting two existing isolated nodes. More...
 
LWT_ELEMID lwt_AddEdgeModFace (LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, LWLINE *geom, int skipChecks)
 Add a new edge possibly splitting a face (modifying it) More...
 
LWT_ELEMID lwt_AddEdgeNewFaces (LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, LWLINE *geom, int skipChecks)
 Add a new edge possibly splitting a face (replacing with two new faces) More...
 
LWT_ELEMID lwt_RemEdgeNewFace (LWT_TOPOLOGY *topo, LWT_ELEMID edge)
 Remove an edge, possibly merging two faces (replacing both with a new one) More...
 
LWT_ELEMID lwt_RemEdgeModFace (LWT_TOPOLOGY *topo, LWT_ELEMID edge)
 Remove an edge, possibly merging two faces (replacing one with the other) More...
 
int lwt_ChangeEdgeGeom (LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWLINE *curve)
 Changes the shape of an edge without affecting the topology structure. More...
 
LWT_ELEMID lwt_ModEdgeSplit (LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWPOINT *pt, int skipChecks)
 Split an edge by a node, modifying the original edge and adding a new one. More...
 
LWT_ELEMID lwt_NewEdgesSplit (LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWPOINT *pt, int skipChecks)
 Split an edge by a node, replacing it with two new edges. More...
 
LWT_ELEMID lwt_ModEdgeHeal (LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
 Merge two edges, modifying the first and deleting the second. More...
 
LWT_ELEMID lwt_NewEdgeHeal (LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
 Merge two edges, replacing both with a new one. More...
 
int lwt_GetFaceEdges (LWT_TOPOLOGY *topo, LWT_ELEMID face, LWT_ELEMID **edges)
 Return the list of directed edges bounding a face. More...
 
LWGEOMlwt_GetFaceGeometry (LWT_TOPOLOGY *topo, LWT_ELEMID face)
 Return the geometry of a face. More...