PostGIS  3.4.0dev-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-2021 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 
378  const LWT_BE_TOPOLOGY* topo,
379  LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2
380  );
381 
393  int (*deleteEdges) (
394  const LWT_BE_TOPOLOGY* topo,
395  const LWT_ISO_EDGE* sel_edge, int sel_fields
396  );
397 
418  *getNodeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit);
419 
440  *getEdgeWithinBox2D)(const LWT_BE_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, int limit);
441 
460  LWT_ISO_EDGE *(*getEdgeByNode)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
461 
480  int (*updateNodes) (
481  const LWT_BE_TOPOLOGY* topo,
482  const LWT_ISO_NODE* sel_node, int sel_fields,
483  const LWT_ISO_NODE* upd_node, int upd_fields,
484  const LWT_ISO_NODE* exc_node, int exc_fields
485  );
486 
502  const LWT_BE_TOPOLOGY* topo,
503  LWT_ELEMID split_face, LWT_ELEMID new_face1, LWT_ELEMID new_face2
504  );
505 
519  int (*insertFaces)(const LWT_BE_TOPOLOGY *topo, LWT_ISO_FACE *faces, uint64_t numelems);
520 
532  uint64_t (*updateFacesById) (
533  const LWT_BE_TOPOLOGY* topo,
534  const LWT_ISO_FACE* faces, uint64_t numfaces
535  );
536 
537  /*
538  * Get the ordered list edge visited by a side walk
539  *
540  * The walk starts from the side of an edge and stops when
541  * either the max number of visited edges OR the starting
542  * position is reached. The output list never includes a
543  * duplicated signed edge identifier.
544  *
545  * It is expected that the walk uses the "next_left" and "next_right"
546  * attributes of ISO edges to perform the walk (rather than recomputing
547  * the turns at each node).
548  *
549  * @param topo the topology to operate on
550  * @param edge walk start position and direction:
551  * abs value identifies the edge, sign expresses
552  * side (left if positive, right if negative)
553  * and direction (forward if positive, backward if negative).
554  * @param numedges output parameter, gets the number of edges visited
555  *
556  * @param limit max edges to return (to avoid an infinite loop in case
557  * of a corrupted topology). 0 is for unlimited.
558  * The function is expected to error out if the limit is hit.
559  *
560  * @return an array of signed edge identifiers (positive edges being
561  * walked in their direction, negative ones in opposite) or
562  * NULL on error (@see lastErrorMessage)
563  */
564  LWT_ELEMID *(*getRingEdges)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID edge, uint64_t *numedges, int limit);
565 
579  int (*updateEdgesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, uint64_t numedges, int upd_fields);
580 
601  LWT_ISO_EDGE *(*getEdgeByFace)(const LWT_BE_TOPOLOGY *topo,
602  const LWT_ELEMID *ids,
603  uint64_t *numelems,
604  int fields,
605  const GBOX *box);
606 
625  LWT_ISO_NODE *(*getNodeByFace)(const LWT_BE_TOPOLOGY *topo,
626  const LWT_ELEMID *faces,
627  uint64_t *numelems,
628  int fields,
629  const GBOX *box);
630 
644  int (*updateNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ISO_NODE *nodes, uint64_t numnodes, int upd_fields);
645 
656  int (*deleteFacesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems);
657 
662  int (*topoGetSRID) (
663  const LWT_BE_TOPOLOGY* topo
664  );
665 
669  double (*topoGetPrecision) (
670  const LWT_BE_TOPOLOGY* topo
671  );
672 
677  int (*topoHasZ) (
678  const LWT_BE_TOPOLOGY* topo
679  );
680 
691  int (*deleteNodesById)(const LWT_BE_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t numelems);
692 
706  const LWT_BE_TOPOLOGY* topo,
707  LWT_ELEMID rem_edge,
708  LWT_ELEMID face_left,
709  LWT_ELEMID face_right
710  );
711 
727  const LWT_BE_TOPOLOGY* topo,
728  LWT_ELEMID face1, LWT_ELEMID face2, LWT_ELEMID newface
729  );
730 
752  const LWT_BE_TOPOLOGY* topo,
753  LWT_ELEMID rem_node,
754  LWT_ELEMID e1,
755  LWT_ELEMID e2
756  );
757 
774  const LWT_BE_TOPOLOGY* topo,
775  LWT_ELEMID edge1, LWT_ELEMID edge2, LWT_ELEMID newedge
776  );
777 
797  LWT_ISO_FACE *(*getFaceWithinBox2D)(const LWT_BE_TOPOLOGY *topo,
798  const GBOX *box,
799  uint64_t *numelems,
800  int fields,
801  int limit);
802 
817  const LWT_BE_TOPOLOGY* topo,
818  LWT_ELEMID rem_node
819  );
820 
831  const LWT_BE_TOPOLOGY* topo,
832  LWT_ELEMID rem_edge
833  );
834 
835 
851  LWT_ISO_EDGE *(*getClosestEdge)(const LWT_BE_TOPOLOGY *topo,
852  const LWPOINT *pt,
853  uint64_t *numelems,
854  int fields);
855 
865  GBOX *(*computeFaceMBR)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID face);
866 
868 
869 
878 
886 
889 
890 /********************************************************************
891  *
892  * End of BE interface
893  *
894  *******************************************************************/
895 
899 typedef enum LWT_TOPOERR_TYPE_T {
911 
913 typedef struct LWT_TOPOERR_T {
921 
922 /*
923  * Topology functions
924  */
925 
930 typedef struct LWT_TOPOLOGY_T LWT_TOPOLOGY;
931 
932 
933 /*******************************************************************
934  *
935  * Non-ISO signatures here
936  *
937  *******************************************************************/
938 
951 LWT_TOPOLOGY *lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int32_t srid, double prec, int hasz);
952 
962 LWT_TOPOLOGY *lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name);
963 
970 
975 void lwt_FreeTopology(LWT_TOPOLOGY* topo);
976 
987 LWT_ELEMID lwt_GetNodeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
988 
1000 LWT_ELEMID lwt_GetEdgeByPoint(LWT_TOPOLOGY *topo, LWPOINT *pt, double tol);
1001 
1014 LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt, double tol);
1015 
1027 
1028 
1029 
1030 /*******************************************************************
1031  *
1032  * Topology population (non-ISO)
1033  *
1034  *******************************************************************/
1035 
1049 LWT_ELEMID lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol);
1050 
1068 LWT_ELEMID* lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol,
1069  int* nedges);
1070 
1092 LWT_ELEMID* lwt_AddLineNoFace(LWT_TOPOLOGY* topo, LWLINE* line, double tol,
1093  int* nedges);
1094 
1095 /*
1096  * Determine and register all topology faces:
1097  *
1098  * - Determines which faces are generated by existing
1099  * edges.
1100  * - Creates face records with correct mbr
1101  * - Update edge left/right face attributes
1102  *
1103  * Precondition:
1104  * - the topology edges are correctly linked
1105  * - there are no faces registered in the topology
1106  *
1107  * Postconditions:
1108  * - all left/right face attributes of edges
1109  * reference faces with correct mbr.
1110  *
1111  * Notes:
1112  * - does not attempt to assign isolated nodes to their
1113  * containing faces
1114  * - does not remove existing face records
1115  * - loads in memory all the topology edges
1116  *
1117  * @param topo the topology to operate on
1118  *
1119  * @return 0 on success, -1 on error
1120  * (librtgeom error handler will be invoked with error
1121  * message)
1122  */
1123 int lwt_Polygonize(LWT_TOPOLOGY* topo);
1124 
1143 LWT_ELEMID* lwt_AddPolygon(LWT_TOPOLOGY* topo, LWPOLY* poly, double tol,
1144  int* nfaces);
1145 
1146 /*******************************************************************
1147  *
1148  * ISO signatures here
1149  *
1150  *******************************************************************/
1151 
1162 
1180  LWPOINT* pt, int skipChecks);
1181 
1194 int lwt_MoveIsoNode(LWT_TOPOLOGY* topo,
1195  LWT_ELEMID node, LWPOINT* pt);
1196 
1208 int lwt_RemoveIsoNode(LWT_TOPOLOGY* topo, LWT_ELEMID node);
1209 
1221 int lwt_RemIsoEdge(LWT_TOPOLOGY* topo, LWT_ELEMID edge);
1222 
1237  LWT_ELEMID startNode, LWT_ELEMID endNode,
1238  const LWLINE *geom);
1239 
1262  LWT_ELEMID start_node, LWT_ELEMID end_node,
1263  LWLINE *geom, int skipChecks);
1264 
1283  LWT_ELEMID start_node, LWT_ELEMID end_node,
1284  LWLINE *geom, int skipChecks);
1285 
1298 
1315 
1327 int lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWLINE* curve);
1328 
1343 LWT_ELEMID lwt_ModEdgeSplit(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipChecks);
1344 
1358 LWT_ELEMID lwt_NewEdgesSplit(LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipChecks);
1359 
1373 
1387 
1401 int lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face, LWT_ELEMID **edges);
1402 
1415 
1416 #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:5267
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:3636
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:66
LWT_BE_IFACE * lwt_CreateBackendIface(const LWT_BE_DATA *data)
Create a new backend interface.
Definition: lwgeom_topo.c:58
LWT_ELEMID lwt_GetFaceContainingPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt)
Find the face-id of the face properly containing a given point.
Definition: lwgeom_topo.c:7034
LWT_ELEMID lwt_AddIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWPOINT *pt, int skipChecks)
Add an isolated node.
Definition: lwgeom_topo.c:600
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:72
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:1036
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:4724
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:2754
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:4219
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID face)
Return the geometry of a face.
Definition: lwgeom_topo.c:2817
int lwt_RemIsoEdge(LWT_TOPOLOGY *topo, LWT_ELEMID edge)
Remove an isolated edge.
Definition: lwgeom_topo.c:3670
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:1193
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:5975
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:787
LWT_SPATIALTYPE_T
@ LWT_PUNTAL
@ LWT_COLLECTION
@ LWT_LINEAL
@ LWT_AREAL
int64_t LWT_INT64
LWT_ELEMID lwt_GetFaceByPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt, double tol)
Find the face-id of a face containing a given point.
Definition: lwgeom_topo.c:4780
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:4225
int lwt_MoveIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID node, LWPOINT *pt)
Move an isolated node.
Definition: lwgeom_topo.c:3584
int lwt_Polygonize(LWT_TOPOLOGY *topo)
Definition: lwgeom_topo.c:6884
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:2762
LWT_TOPOLOGY * lwt_LoadTopology(LWT_BE_IFACE *iface, const char *name)
Loads an existing topology by name from the database.
Definition: lwgeom_topo.c:497
LWT_ELEMID * lwt_AddPolygon(LWT_TOPOLOGY *topo, LWPOLY *poly, double tol, int *nfaces)
Adds a polygon to the topology.
Definition: lwgeom_topo.c:5987
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:5981
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:4677
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:519
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:4683
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:4689
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:3068
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:3234
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.
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(* checkTopoGeomRemIsoNode)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_node)
Check TopoGeometry objects before an isolated node removal event.
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(* checkTopoGeomRemIsoEdge)(const LWT_BE_TOPOLOGY *topo, LWT_ELEMID rem_edge)
Check TopoGeometry objects before an isolated edge removal event.
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.