26 #ifndef LIBLWGEOM_TOPO_H 27 #define LIBLWGEOM_TOPO_H 1 53 #define LWT_COL_NODE_NODE_ID 1<<0 54 #define LWT_COL_NODE_CONTAINING_FACE 1<<1 55 #define LWT_COL_NODE_GEOM 1<<2 56 #define LWT_COL_NODE_ALL (1<<3)-1 73 #define LWT_COL_EDGE_EDGE_ID 1<<0 74 #define LWT_COL_EDGE_START_NODE 1<<1 75 #define LWT_COL_EDGE_END_NODE 1<<2 76 #define LWT_COL_EDGE_FACE_LEFT 1<<3 77 #define LWT_COL_EDGE_FACE_RIGHT 1<<4 78 #define LWT_COL_EDGE_NEXT_LEFT 1<<5 79 #define LWT_COL_EDGE_NEXT_RIGHT 1<<6 80 #define LWT_COL_EDGE_GEOM 1<<7 81 #define LWT_COL_EDGE_ALL (1<<8)-1 92 #define LWT_COL_FACE_FACE_ID 1<<0 93 #define LWT_COL_FACE_MBR 1<<1 94 #define LWT_COL_FACE_ALL (1<<2)-1 161 const char* name,
int srid,
double precision,
int hasZ
203 const LWT_ELEMID* ids,
int* numelems,
int fields
228 const LWPOINT* pt,
double dist,
int* numelems,
229 int fields,
int limit
269 const LWT_ELEMID* ids,
int* numelems,
int fields
294 const LWPOINT* pt,
double dist,
int* numelems,
295 int fields,
int limit
374 const LWT_ELEMID* ids,
int* numelems,
int fields
453 int* numelems,
int fields,
int limit
478 int* numelems,
int fields,
int limit
501 const LWT_ELEMID* ids,
int* numelems,
int fields
655 const LWT_ELEMID* ids,
int* numelems,
int fields,
679 const LWT_ELEMID* faces,
int* numelems,
int fields,
864 int* numelems,
int fields,
int limit
952 int srid,
double prec,
int hasz);
1197 LWLINE *geom,
int skipChecks);
1218 LWLINE *geom,
int skipChecks);
enum LWT_TOPOERR_TYPE_T LWT_TOPOERR_TYPE
Topology errors type.
LWT_ELEMID lwt_AddIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWPOINT *pt, int skipChecks)
Add an isolated node.
void lwt_FreeBackendIface(LWT_BE_IFACE *iface)
Release memory associated with an LWT_BE_IFACE.
LWT_ELEMID containing_face
struct LWT_TOPOERR_T LWT_TOPOERR
Topology error.
struct LWT_BE_CALLBACKS_T LWT_BE_CALLBACKS
Structure containing base backend callbacks.
LWT_ELEMID lwt_RemEdgeNewFace(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an edge, possibly merging two faces (replacing both with a new one)
int(* checkTopoGeomRemEdge)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_edge, LWT_ELEMID face_left, LWT_ELEMID face_right)
Check TopoGeometry objects before an edge removal event.
void lwt_iso_node_release(LWT_ISO_NODE *node)
int(* freeTopology)(LWT_BE_TOPOLOGY *topo)
Release memory associated to a backend topology.
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.
int(* updateFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_FACE *faces, int numfaces)
Update faces by id.
LWT_ELEMID lwt_GetEdgeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Find the edge-id of an edge that intersects a given point.
int(* updateTopoGeomFaceHeal)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID face1, LWT_ELEMID face2, LWT_ELEMID newface)
Update TopoGeometry objects after healing two faces.
LWT_BE_IFACE * lwt_CreateBackendIface(const LWT_BE_DATA *data)
Create a new backend interface.
int(* insertNodes)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_NODE *nodes, int numelems)
Insert nodes.
LWT_TOPOLOGY * lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name)
Loads an existing topology by name from the database.
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.
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID face)
Return the geometry of a face.
int(* updateTopoGeomFaceSplit)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID split_face, LWT_ELEMID new_face1, LWT_ELEMID new_face2)
Update TopoGeometry objects after a face split event.
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.
LWT_ELEMID lwt_GetNodeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Retrieve the id of a node at a point location.
int lwt_ChangeEdgeGeom(LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWLINE *curve)
Changes the shape of an edge without affecting the topology structure.
LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY *topo, LWPOINT *point, double tol)
Adds a point to the topology.
int(* updateNodes)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *sel_node, int sel_fields, const LWT_ISO_NODE *upd_node, int upd_fields, const LWT_ISO_NODE *exc_node, int exc_fields)
Update nodes selected by fields match/mismatch.
enum LWT_SPATIALTYPE_T LWT_SPATIALTYPE
int lwt_RemIsoEdge(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an isolated edge.
LWT_ELEMID(* getNextEdgeId)(const LWT_BE_TOPOLOGY *topo)
Get next available edge identifier.
int(* deleteFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, int numelems)
Delete faces by id.
int(* updateTopoGeomEdgeHeal)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge)
Update TopoGeometry objects after healing two edges.
struct LWT_BE_DATA_T LWT_BE_DATA
Backend private data pointer.
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)
void lwt_CreateTopoGeo(LWT_TOPOLOGY *topo, LWGEOM *geom)
Populate an empty topology with data from a simple geometry.
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)
int(* insertEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_EDGE *edges, int numelems)
Insert edges.
int lwt_MoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node, LWPOINT *pt)
Move an isolated node.
LWT_ELEMID(* getFaceContainingPoint)(const LWT_BE_TOPOLOGY *topo, const LWPOINT *pt)
Get face containing point.
int(* updateEdgesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
Update edges by id.
double(* topoGetPrecision)(const LWT_BE_TOPOLOGY *topo)
Get topology precision.
LWT_ELEMID elem1
Identifier of first affected element.
LWT_ELEMID lwt_NewEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
Merge two edges, replacing both with a new one.
int(* deleteNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, int numelems)
Delete nodes by id.
LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Find the face-id of a face containing a given point.
int(* insertFaces)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, int numelems)
Insert faces.
LWT_ELEMID lwt_ModEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
Merge two edges, modifying the first and deleting the second.
int(* topoHasZ)(const LWT_BE_TOPOLOGY *topo)
Get topology Z flag.
void lwt_DropTopology(LWT_TOPOLOGY *topo)
Drop a topology and all its associated objects from the database.
int(* updateTopoGeomEdgeSplit)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2)
Update TopoGeometry objects after an edge split event.
LWT_ELEMID * lwt_AddLine(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
Adds a linestring to the topology.
struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
Topology handler.
LWT_TOPOLOGY * lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int srid, double prec, int hasz)
Initializes a new topology.
LWT_TOPOERR_TYPE err
Type of error.
int lwt_RemoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node)
Remove an isolated node.
int(* checkTopoGeomRemNode)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_node, LWT_ELEMID e1, LWT_ELEMID e2)
Check TopoGeometry objects before a node removal event.
Structure containing base backend callbacks.
int lwt_GetFaceEdges(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWT_ELEMID **edges)
Return the list of directed edges bounding a face.
int(* deleteEdges)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
Delete edges.
void lwt_BackendIfaceRegisterCallbacks(LWT_BE_IFACE *iface, const LWT_BE_CALLBACKS *cb)
Register backend callbacks into the opaque iface handler.
int(* updateEdges)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields, const LWT_ISO_EDGE *upd_edge, int upd_fields, const LWT_ISO_EDGE *exc_edge, int exc_fields)
Update edges selected by fields match/mismatch.
LWT_INT64 LWT_ELEMID
Identifier of topology element.
LWT_ELEMID lwt_RemEdgeModFace(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an edge, possibly merging two faces (replacing one with the other)
int(* topoGetSRID)(const LWT_BE_TOPOLOGY *topo)
Get topology SRID.
LWT_ELEMID * lwt_AddPolygon(LWT_TOPOLOGY *topo, LWPOLY *poly, double tol, int *nfaces)
Adds a polygon to the topology.
int(* updateNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, int numnodes, int upd_fields)
Update nodes by id.
void lwt_FreeTopology(LWT_TOPOLOGY *topo)
Release memory associated with an LWT_TOPOLOGY.
LWT_ELEMID elem2
Identifier of second affected element (0 if inapplicable)
This library is the generic geometry handling section of PostGIS.
LWT_TOPOERR_TYPE_T
Topology errors type.