PostGIS  3.0.6dev-r@@SVN_REVISION@@
liblwgeom_topo.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * PostGIS - Spatial Types for PostgreSQL
4  * http://postgis.net
5  *
6  * PostGIS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * PostGIS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  **********************************************************************
20  *
21  * Copyright (C) 2015-2017 Sandro Santilli <strk@kbt.io>
22  *
23  **********************************************************************/
24 
25 
26 #ifndef LIBLWGEOM_TOPO_H
27 #define LIBLWGEOM_TOPO_H 1
28 
29 #include "liblwgeom.h"
30 
31 /* INT64 */
32 typedef int64_t LWT_INT64;
33 
36 
37 /*
38  * ISO primitive elements
39  */
40 
42 typedef struct
43 {
45  LWT_ELEMID containing_face; /* -1 if not isolated */
47 }
49 
51 
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
57 
59 typedef struct
60 {
69 }
71 
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
82 
84 typedef struct
85 {
88 }
90 
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
95 
96 typedef enum LWT_SPATIALTYPE_T {
99  LWT_AREAL = 2,
100  LWT_COLLECTION = 3
102 
103 /*
104  * Backend handling functions
105  */
106 
107 /* opaque pointers referencing native backend objects */
108 
115 typedef struct LWT_BE_DATA_T LWT_BE_DATA;
116 
124 typedef struct LWT_BE_IFACE_T LWT_BE_IFACE;
125 
133 typedef struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY;
134 
140 typedef struct LWT_BE_CALLBACKS_T {
141 
147  const char* (*lastErrorMessage) (const LWT_BE_DATA* be);
148 
159  LWT_BE_TOPOLOGY *(*createTopology)(const LWT_BE_DATA *be, const char *name, int32_t srid, double precision, int hasZ);
160 
168  LWT_BE_TOPOLOGY* (*loadTopologyByName) (
169  const LWT_BE_DATA* be,
170  const char* name
171  );
172 
180 
198  LWT_ISO_NODE *(*getNodeById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
199 
220  LWT_ISO_NODE *(*getNodeWithinDistance2D)(const LWT_BE_TOPOLOGY *topo,
221  const LWPOINT *pt,
222  double dist,
223  uint64_t *numelems,
224  int fields,
225  int64_t limit);
226 
240  int (*insertNodes)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_NODE *nodes, uint64_t numelems);
241 
258  LWT_ISO_EDGE *(*getEdgeById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
259 
280  LWT_ISO_EDGE *(*getEdgeWithinDistance2D)(const LWT_BE_TOPOLOGY *topo,
281  const LWPOINT *pt,
282  double dist,
283  uint64_t *numelems,
284  int fields,
285  int64_t limit);
286 
298  const LWT_BE_TOPOLOGY* topo
299  );
300 
314  int (*insertEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_EDGE *edges, uint64_t numelems);
315 
334  int (*updateEdges) (
335  const LWT_BE_TOPOLOGY* topo,
336  const LWT_ISO_EDGE* sel_edge, int sel_fields,
337  const LWT_ISO_EDGE* upd_edge, int upd_fields,
338  const LWT_ISO_EDGE* exc_edge, int exc_fields
339  );
340 
357  LWT_ISO_FACE *(*getFaceById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
358 
370  const LWT_BE_TOPOLOGY* topo,
371  const LWPOINT* pt
372  );
373 
393  const LWT_BE_TOPOLOGY* topo,
394  LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2
395  );
396 
408  int (*deleteEdges) (
409  const LWT_BE_TOPOLOGY* topo,
410  const LWT_ISO_EDGE* sel_edge, int sel_fields
411  );
412 
433  *getNodeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit);
434 
455  *getEdgeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit);
456 
475  LWT_ISO_EDGE *(*getEdgeByNode)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
476 
495  int (*updateNodes) (
496  const LWT_BE_TOPOLOGY* topo,
497  const LWT_ISO_NODE* sel_node, int sel_fields,
498  const LWT_ISO_NODE* upd_node, int upd_fields,
499  const LWT_ISO_NODE* exc_node, int exc_fields
500  );
501 
517  const LWT_BE_TOPOLOGY* topo,
518  LWT_ELEMID split_face, LWT_ELEMID new_face1, LWT_ELEMID new_face2
519  );
520 
534  int (*insertFaces)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, uint64_t numelems);
535 
547  uint64_t (*updateFacesById) (
548  const LWT_BE_TOPOLOGY* topo,
549  const LWT_ISO_FACE* faces, uint64_t numfaces
550  );
551 
552  /*
553  * Get the ordered list edge visited by a side walk
554  *
555  * The walk starts from the side of an edge and stops when
556  * either the max number of visited edges OR the starting
557  * position is reached. The output list never includes a
558  * duplicated signed edge identifier.
559  *
560  * It is expected that the walk uses the "next_left" and "next_right"
561  * attributes of ISO edges to perform the walk (rather than recomputing
562  * the turns at each node).
563  *
564  * @param topo the topology to operate on
565  * @param edge walk start position and direction:
566  * abs value identifies the edge, sign expresses
567  * side (left if positive, right if negative)
568  * and direction (forward if positive, backward if negative).
569  * @param numedges output parameter, gets the number of edges visited
570  *
571  * @param limit max edges to return (to avoid an infinite loop in case
572  * of a corrupted topology). 0 is for unlimited.
573  * The function is expected to error out if the limit is hit.
574  *
575  * @return an array of signed edge identifiers (positive edges being
576  * walked in their direction, negative ones in opposite) or
577  * NULL on error (@see lastErrorMessage)
578  */
579  LWT_ELEMID *(*getRingEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge, uint64_t *numedges, int limit);
580 
594  int (*updateEdgesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, uint64_t numedges, int upd_fields);
595 
616  LWT_ISO_EDGE *(*getEdgeByFace)(const LWT_BE_TOPOLOGY *topo,
617  const LWT_ELEMID *ids,
618  uint64_t *numelems,
619  int fields,
620  const GBOX *box);
621 
640  LWT_ISO_NODE *(*getNodeByFace)(const LWT_BE_TOPOLOGY *topo,
641  const LWT_ELEMID *faces,
642  uint64_t *numelems,
643  int fields,
644  const GBOX *box);
645 
659  int (*updateNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, uint64_t numnodes, int upd_fields);
660 
671  int (*deleteFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems);
672 
677  int (*topoGetSRID) (
678  const LWT_BE_TOPOLOGY* topo
679  );
680 
684  double (*topoGetPrecision) (
685  const LWT_BE_TOPOLOGY* topo
686  );
687 
692  int (*topoHasZ) (
693  const LWT_BE_TOPOLOGY* topo
694  );
695 
706  int (*deleteNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems);
707 
721  const LWT_BE_TOPOLOGY* topo,
722  LWT_ELEMID rem_edge,
723  LWT_ELEMID face_left,
724  LWT_ELEMID face_right
725  );
726 
742  const LWT_BE_TOPOLOGY* topo,
743  LWT_ELEMID face1, LWT_ELEMID face2, LWT_ELEMID newface
744  );
745 
767  const LWT_BE_TOPOLOGY* topo,
768  LWT_ELEMID rem_node,
769  LWT_ELEMID e1,
770  LWT_ELEMID e2
771  );
772 
789  const LWT_BE_TOPOLOGY* topo,
790  LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge
791  );
792 
812  LWT_ISO_FACE *(*getFaceWithinBox2D)(const LWT_BE_TOPOLOGY *topo,
813  const GBOX *box,
814  uint64_t *numelems,
815  int fields,
816  int limit);
817 
819 
820 
829 
837 
840 
841 /********************************************************************
842  *
843  * End of BE interface
844  *
845  *******************************************************************/
846 
850 typedef enum LWT_TOPOERR_TYPE_T {
862 
864 typedef struct LWT_TOPOERR_T {
872 
873 /*
874  * Topology functions
875  */
876 
881 typedef struct LWT_TOPOLOGY_T LWT_TOPOLOGY;
882 
883 
884 /*******************************************************************
885  *
886  * Non-ISO signatures here
887  *
888  *******************************************************************/
889 
902 LWT_TOPOLOGY *lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int32_t srid, double prec, int hasz);
903 
913 LWT_TOPOLOGY *lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name);
914 
921 
926 void lwt_FreeTopology(LWT_TOPOLOGY* topo);
927 
938 LWT_ELEMID lwt_GetNodeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
939 
951 LWT_ELEMID lwt_GetEdgeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
952 
965 LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
966 
967 
968 /*******************************************************************
969  *
970  * Topology population (non-ISO)
971  *
972  *******************************************************************/
973 
987 LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol);
988 
1006 LWT_ELEMID* lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol,
1007  int* nedges);
1008 
1030 LWT_ELEMID* lwt_AddLineNoFace(LWT_TOPOLOGY* topo, LWLINE* line, double tol,
1031  int* nedges);
1032 
1033 /*
1034  * Determine and register all topology faces:
1035  *
1036  * - Determines which faces are generated by existing
1037  * edges.
1038  * - Creates face records with correct mbr
1039  * - Update edge left/right face attributes
1040  *
1041  * Precondition:
1042  * - the topology edges are correctly linked
1043  * - there are no faces registered in the topology
1044  *
1045  * Postconditions:
1046  * - all left/right face attributes of edges
1047  * reference faces with correct mbr.
1048  *
1049  * Notes:
1050  * - does not attempt to assign isolated nodes to their
1051  * containing faces
1052  * - does not remove existing face records
1053  * - loads in memory all the topology edges
1054  *
1055  * @param topo the topology to operate on
1056  *
1057  * @return 0 on success, -1 on error
1058  * (librtgeom error handler will be invoked with error
1059  * message)
1060  */
1061 int lwt_Polygonize(LWT_TOPOLOGY* topo);
1062 
1081 LWT_ELEMID* lwt_AddPolygon(LWT_TOPOLOGY* topo, LWPOLY* poly, double tol,
1082  int* nfaces);
1083 
1084 /*******************************************************************
1085  *
1086  * ISO signatures here
1087  *
1088  *******************************************************************/
1089 
1100 
1118  LWPOINT* pt, int skipChecks);
1119 
1132 int lwt_MoveIsoNode(LWT_TOPOLOGY* topo,
1133  LWT_ELEMID node, LWPOINT* pt);
1134 
1146 int lwt_RemoveIsoNode(LWT_TOPOLOGY* topo, LWT_ELEMID node);
1147 
1159 int lwt_RemIsoEdge(LWT_TOPOLOGY* topo, LWT_ELEMID edge);
1160 
1175  LWT_ELEMID startNode, LWT_ELEMID endNode,
1176  const LWLINE *geom);
1177 
1200  LWT_ELEMID start_node, LWT_ELEMID end_node,
1201  LWLINE *geom, int skipChecks);
1202 
1221  LWT_ELEMID start_node, LWT_ELEMID end_node,
1222  LWLINE *geom, int skipChecks);
1223 
1236 
1253 
1265 int lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWLINE* curve);
1266 
1281 LWT_ELEMID lwt_ModEdgeSplit(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipChecks);
1282 
1296 LWT_ELEMID lwt_NewEdgesSplit(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipChecks);
1297 
1311 
1325 
1339 int lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face, LWT_ELEMID **edges);
1340 
1353 
1354 #endif /* LIBLWGEOM_TOPO_H */
static uint8_t precision
Definition: cu_in_twkb.c:25
This library is the generic geometry handling section of PostGIS.
LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY *topo, LWPOINT *point, double tol)
Adds a point to the topology.
Definition: lwgeom_topo.c:5232
struct LWT_BE_CALLBACKS_T LWT_BE_CALLBACKS
Structure containing base backend callbacks.
int lwt_RemoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node)
Remove an isolated node.
Definition: lwgeom_topo.c:3614
LWT_INT64 LWT_ELEMID
Identifier of topology element.
struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
Topology handler.
void lwt_BackendIfaceRegisterCallbacks(LWT_BE_IFACE *iface, const LWT_BE_CALLBACKS *cb)
Register backend callbacks into the opaque iface handler.
Definition: lwgeom_topo.c:60
LWT_BE_IFACE * lwt_CreateBackendIface(const LWT_BE_DATA *data)
Create a new backend interface.
Definition: lwgeom_topo.c:52
LWT_ELEMID lwt_AddIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWPOINT *pt, int skipChecks)
Add an isolated node.
Definition: lwgeom_topo.c:580
enum LWT_TOPOERR_TYPE_T LWT_TOPOERR_TYPE
Topology errors type.
void lwt_FreeBackendIface(LWT_BE_IFACE *iface)
Release memory associated with an LWT_BE_IFACE.
Definition: lwgeom_topo.c:66
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.
Definition: lwgeom_topo.c:1016
LWT_ELEMID lwt_GetEdgeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Find the edge-id of an edge that intersects a given point.
Definition: lwgeom_topo.c:4693
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)
Definition: lwgeom_topo.c:2728
LWT_ELEMID lwt_RemEdgeModFace(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an edge, possibly merging two faces (replacing one with the other)
Definition: lwgeom_topo.c:4189
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID face)
Return the geometry of a face.
Definition: lwgeom_topo.c:2791
int lwt_RemIsoEdge(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an isolated edge.
Definition: lwgeom_topo.c:3645
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.
Definition: lwgeom_topo.c:1173
LWT_TOPOERR_TYPE_T
Topology errors type.
@ LWT_TOPOERR_EDGE_STARTNODE_MISMATCH
@ LWT_TOPOERR_FACE_OVERLAPS_FACE
@ LWT_TOPOERR_EDGE_CROSSES_NODE
@ LWT_TOPOERR_EDGE_ENDNODE_MISMATCH
@ LWT_TOPOERR_EDGE_INVALID
@ LWT_TOPOERR_FACE_WITHIN_FACE
@ LWT_TOPOERR_EDGE_CROSSES_EDGE
@ LWT_TOPOERR_EDGE_NOT_SIMPLE
@ LWT_TOPOERR_FACE_HAS_NO_RINGS
@ LWT_TOPOERR_FACE_WITHOUT_EDGES
LWT_ELEMID * lwt_AddLine(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
Adds a linestring to the topology.
Definition: lwgeom_topo.c:5854
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.
Definition: lwgeom_topo.c:767
LWT_SPATIALTYPE_T
@ LWT_PUNTAL
@ LWT_COLLECTION
@ LWT_LINEAL
@ LWT_AREAL
int64_t LWT_INT64
void lwt_iso_node_release(LWT_ISO_NODE *node)
LWT_ELEMID lwt_RemEdgeNewFace(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an edge, possibly merging two faces (replacing both with a new one)
Definition: lwgeom_topo.c:4195
int lwt_MoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node, LWPOINT *pt)
Move an isolated node.
Definition: lwgeom_topo.c:3573
int lwt_Polygonize(LWT_TOPOLOGY *topo)
Definition: lwgeom_topo.c:6763
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)
Definition: lwgeom_topo.c:2736
LWT_TOPOLOGY * lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name)
Loads an existing topology by name from the database.
Definition: lwgeom_topo.c:477
LWT_ELEMID * lwt_AddPolygon(LWT_TOPOLOGY *topo, LWPOLY *poly, double tol, int *nfaces)
Adds a polygon to the topology.
Definition: lwgeom_topo.c:5866
LWT_ELEMID * lwt_AddLineNoFace(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
Adds a linestring to the topology without determining generated faces.
Definition: lwgeom_topo.c:5860
struct LWT_TOPOERR_T LWT_TOPOERR
Topology error.
LWT_ELEMID lwt_ModEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
Merge two edges, modifying the first and deleting the second.
Definition: lwgeom_topo.c:4646
void lwt_CreateTopoGeo(LWT_TOPOLOGY *topo, LWGEOM *geom)
Populate an empty topology with data from a simple geometry.
enum LWT_SPATIALTYPE_T LWT_SPATIALTYPE
LWT_TOPOLOGY * lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int32_t srid, double prec, int hasz)
Initializes a new topology.
void lwt_FreeTopology(LWT_TOPOLOGY *topo)
Release memory associated with an LWT_TOPOLOGY.
Definition: lwgeom_topo.c:499
LWT_ELEMID lwt_NewEdgeHeal(LWT_TOPOLOGY *topo, LWT_ELEMID e1, LWT_ELEMID e2)
Merge two edges, replacing both with a new one.
Definition: lwgeom_topo.c:4652
struct LWT_BE_DATA_T LWT_BE_DATA
Backend private data pointer.
void lwt_DropTopology(LWT_TOPOLOGY *topo)
Drop a topology and all its associated objects from the database.
LWT_ELEMID lwt_GetNodeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Retrieve the id of a node at a point location.
Definition: lwgeom_topo.c:4658
int lwt_GetFaceEdges(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWT_ELEMID **edges)
Return the list of directed edges bounding a face.
Definition: lwgeom_topo.c:3022
LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol)
Find the face-id of a face containing a given point.
Definition: lwgeom_topo.c:4749
int lwt_ChangeEdgeGeom(LWT_TOPOLOGY *topo, LWT_ELEMID edge, LWLINE *curve)
Changes the shape of an edge without affecting the topology structure.
Definition: lwgeom_topo.c:3187
data
Definition: ovdump.py:104
int(* updateTopoGeomFaceHeal)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID face1, LWT_ELEMID face2, LWT_ELEMID newface)
Update TopoGeometry objects after healing two faces.
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.
int(* deleteFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
Delete faces by id.
LWT_ELEMID(* getFaceContainingPoint)(const LWT_BE_TOPOLOGY *topo, const LWPOINT *pt)
Get face containing point.
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.
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.
uint64_t(* updateFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_FACE *faces, uint64_t numfaces)
Update faces by id.
int(* topoGetSRID)(const LWT_BE_TOPOLOGY *topo)
Get topology SRID.
int(* deleteNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems)
Delete nodes by id.
int(* updateNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, uint64_t numnodes, int upd_fields)
Update nodes by id.
int(* insertNodes)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_NODE *nodes, uint64_t numelems)
Insert nodes.
LWT_ISO_NODE *(* getNodeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit)
Get edges whose bounding box overlaps a given 2D bounding box.
double(* topoGetPrecision)(const LWT_BE_TOPOLOGY *topo)
Get topology precision.
LWT_ELEMID(* getNextEdgeId)(const LWT_BE_TOPOLOGY *topo)
Get next available edge identifier.
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.
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.
int(* freeTopology)(LWT_BE_TOPOLOGY *topo)
Release memory associated to a backend topology.
int(* insertEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_EDGE *edges, uint64_t numelems)
Insert edges.
int(* updateTopoGeomEdgeHeal)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge)
Update TopoGeometry objects after healing two edges.
LWT_ISO_EDGE *(* getEdgeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit)
Get edges whose bounding box overlaps a given 2D bounding box.
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.
int(* insertFaces)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, uint64_t numelems)
Insert faces.
int(* topoHasZ)(const LWT_BE_TOPOLOGY *topo)
Get topology Z flag.
int(* updateEdgesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, uint64_t numedges, int upd_fields)
Update edges by id.
int(* deleteEdges)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
Delete edges.
Structure containing base backend callbacks.
LWT_ELEMID face_right
LWT_ELEMID next_right
LWT_ELEMID end_node
LWT_ELEMID face_left
LWLINE * geom
LWT_ELEMID next_left
LWT_ELEMID edge_id
LWT_ELEMID start_node
LWT_ELEMID face_id
LWT_ELEMID node_id
LWT_ELEMID containing_face
LWPOINT * geom
LWT_ELEMID elem1
Identifier of first affected element.
LWT_TOPOERR_TYPE err
Type of error.
LWT_ELEMID elem2
Identifier of second affected element (0 if inapplicable)
Topology error.