PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
liblwgeom_topo_internal.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 Sandro Santilli <strk@kbt.io>
22 *
23 **********************************************************************/
24
25
26#ifndef LIBLWGEOM_TOPO_INTERNAL_H
27#define LIBLWGEOM_TOPO_INTERNAL_H 1
28
29#include "../postgis_config.h"
30
31#include "liblwgeom.h"
32#include "liblwgeom_topo.h"
33
34#include <stdio.h>
35#include <inttypes.h> /* for PRId64 */
36#include <math.h>
37
38#ifdef WIN32
39# define LWTFMT_ELEMID "lld"
40#else
41# define LWTFMT_ELEMID PRId64
42#endif
43
44
45/************************************************************************
46 *
47 * Generic SQL handler
48 *
49 ************************************************************************/
50
51/*
52 * Use in backend implementation to print error from backend
53 */
54
55#define PGTOPO_BE_ERROR() lwerror(\
56 "[%s:%s:%d] Backend error: %s", \
57 __FILE__, __func__, __LINE__, \
58 lwt_be_lastErrorMessage(topo->be_iface))
59
60#define PGTOPO_BE_ERRORF(msg, ...) lwerror(\
61 "[%s:%s:%d] Backend error (" msg "): %s", \
62 __FILE__, __func__, __LINE__, \
63 lwt_be_lastErrorMessage(topo->be_iface), \
64 __VA_ARGS__ )
65
71
72const char* lwt_be_lastErrorMessage(const LWT_BE_IFACE* be);
73
75
77
79 const LWPOINT *pt,
80 double dist,
81 uint64_t *numelems,
82 int fields,
83 int64_t limit);
84
85LWT_ISO_NODE *lwt_be_getNodeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
86
87LWT_ISO_EDGE *lwt_be_getEdgeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit);
88LWT_ISO_FACE *lwt_be_getFaceWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit);
89
90void _lwt_release_faces(LWT_ISO_FACE *faces, int num_faces);
91void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges);
92int lwt_be_updateEdgesById(LWT_TOPOLOGY* topo, const LWT_ISO_EDGE* edges, int numedges, int upd_fields);
93int lwt_be_insertFaces(LWT_TOPOLOGY *topo, LWT_ISO_FACE *face, uint64_t numelems);
94
96int lwt_be_insertNodes(LWT_TOPOLOGY *topo, LWT_ISO_NODE *node, uint64_t numelems);
97
99
101LWT_ISO_EDGE *lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
103 const LWPOINT *pt,
104 double dist,
105 uint64_t *numelems,
106 int fields,
107 int64_t limit);
108LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields);
109int lwt_be_insertEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, uint64_t numelems);
110int
111lwt_be_updateEdges(LWT_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);
112int
113lwt_be_deleteEdges(LWT_TOPOLOGY* topo, const LWT_ISO_EDGE* sel_edge, int sel_fields);
114
115int lwt_be_updateTopoGeomEdgeSplit(LWT_TOPOLOGY* topo, LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2);
116
117
118/************************************************************************
119 *
120 * Internal objects
121 *
122 ************************************************************************/
123
132
133#endif /* LIBLWGEOM_TOPO_INTERNAL_H */
This library is the generic geometry handling section of PostGIS.
LWT_INT64 LWT_ELEMID
Identifier of topology element.
struct LWT_BE_TOPOLOGY_T LWT_BE_TOPOLOGY
Topology handler.
struct LWT_BE_DATA_T LWT_BE_DATA
Backend private data pointer.
LWT_ELEMID lwt_be_ExistsCoincidentNode(LWT_TOPOLOGY *topo, const LWPOINT *pt)
LWT_ISO_FACE * lwt_be_getFaceWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
LWT_ELEMID lwt_be_ExistsEdgeIntersectingPoint(LWT_TOPOLOGY *topo, const LWPOINT *pt)
LWT_ISO_EDGE * lwt_be_getEdgeWithinDistance2D(LWT_TOPOLOGY *topo, const LWPOINT *pt, double dist, uint64_t *numelems, int fields, int64_t limit)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
LWT_ELEMID lwt_be_getNextEdgeId(LWT_TOPOLOGY *topo)
void _lwt_release_faces(LWT_ISO_FACE *faces, int num_faces)
LWT_ISO_NODE * lwt_be_getNodeWithinDistance2D(LWT_TOPOLOGY *topo, const LWPOINT *pt, double dist, uint64_t *numelems, int fields, int64_t limit)
int lwt_be_updateTopoGeomEdgeSplit(LWT_TOPOLOGY *topo, LWT_ELEMID split_edge, LWT_ELEMID new_edge1, LWT_ELEMID new_edge2)
int lwt_be_insertNodes(LWT_TOPOLOGY *topo, LWT_ISO_NODE *node, uint64_t numelems)
LWT_BE_TOPOLOGY * lwt_be_loadTopologyByName(LWT_BE_IFACE *be, const char *name)
int lwt_be_updateEdges(LWT_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)
int lwt_be_deleteEdges(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *sel_edge, int sel_fields)
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
int lwt_be_freeTopology(LWT_TOPOLOGY *topo)
int lwt_be_insertEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, uint64_t numelems)
LWT_ISO_EDGE * lwt_be_getEdgeByNode(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
LWT_ISO_NODE * lwt_be_getNodeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
int lwt_be_insertFaces(LWT_TOPOLOGY *topo, LWT_ISO_FACE *face, uint64_t numelems)
LWT_ISO_EDGE * lwt_be_getEdgeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
Structure containing base backend callbacks.
const LWT_BE_DATA * data
const LWT_BE_CALLBACKS * cb
LWT_BE_TOPOLOGY * be_topo
const LWT_BE_IFACE * be_iface