@crossbind/port-spatialite-wasm 2.0.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +12 -0
  3. package/config.guess +1823 -0
  4. package/config.sub +1885 -0
  5. package/crossbind.build.js +1 -0
  6. package/crossbind.config.js +11 -0
  7. package/dist/prebuilt/CMakeLists.txt +57 -0
  8. package/dist/prebuilt/wasm-wasm32-mt-release/crossbind-emccflags.fingerprint +1 -0
  9. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/control_points.h +259 -0
  10. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/debug.h +77 -0
  11. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaia_network.h +627 -0
  12. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaia_topology.h +1221 -0
  13. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaaux.h +540 -0
  14. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig-msvc.h +56 -0
  15. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig-msvc.h.in +55 -0
  16. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig.h +68 -0
  17. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig.h.in +67 -0
  18. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaexif.h +669 -0
  19. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiageo.h +77 -0
  20. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiamatrix.h +277 -0
  21. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/geojson.h +586 -0
  22. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/geopackage.h +198 -0
  23. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_advanced.h +5184 -0
  24. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_const.h +606 -0
  25. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_core.h +2294 -0
  26. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_dxf.h +993 -0
  27. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_dynamic.h +416 -0
  28. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_formats.h +2056 -0
  29. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_mbr.h +606 -0
  30. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_sequence.h +173 -0
  31. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_structs.h +880 -0
  32. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_wfs.h +581 -0
  33. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_xml.h +818 -0
  34. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/spatialite_ext.h +64 -0
  35. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/sqlite.h +70 -0
  36. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/stored_procedures.h +641 -0
  37. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite.h +2098 -0
  38. package/dist/prebuilt/wasm-wasm32-mt-release/lib/libspatialite.a +0 -0
  39. package/dist/prebuilt/wasm-wasm32-mt-release/lib/libspatialite.la +41 -0
  40. package/dist/prebuilt/wasm-wasm32-mt-release/lib/mod_spatialite.a +0 -0
  41. package/dist/prebuilt/wasm-wasm32-mt-release/lib/mod_spatialite.la +41 -0
  42. package/dist/prebuilt/wasm-wasm32-mt-release/lib/pkgconfig/spatialite.pc +12 -0
  43. package/dist/prebuilt/wasm-wasm32-st-release/crossbind-emccflags.fingerprint +1 -0
  44. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/control_points.h +259 -0
  45. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/debug.h +77 -0
  46. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaia_network.h +627 -0
  47. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaia_topology.h +1221 -0
  48. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaaux.h +540 -0
  49. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig-msvc.h +56 -0
  50. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig-msvc.h.in +55 -0
  51. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig.h +68 -0
  52. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig.h.in +67 -0
  53. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaexif.h +669 -0
  54. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiageo.h +77 -0
  55. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiamatrix.h +277 -0
  56. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/geojson.h +586 -0
  57. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/geopackage.h +198 -0
  58. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_advanced.h +5184 -0
  59. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_const.h +606 -0
  60. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_core.h +2294 -0
  61. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_dxf.h +993 -0
  62. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_dynamic.h +416 -0
  63. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_formats.h +2056 -0
  64. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_mbr.h +606 -0
  65. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_sequence.h +173 -0
  66. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_structs.h +880 -0
  67. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_wfs.h +581 -0
  68. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_xml.h +818 -0
  69. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/spatialite_ext.h +64 -0
  70. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/sqlite.h +70 -0
  71. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/stored_procedures.h +641 -0
  72. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite.h +2098 -0
  73. package/dist/prebuilt/wasm-wasm32-st-release/lib/libspatialite.a +0 -0
  74. package/dist/prebuilt/wasm-wasm32-st-release/lib/libspatialite.la +41 -0
  75. package/dist/prebuilt/wasm-wasm32-st-release/lib/mod_spatialite.a +0 -0
  76. package/dist/prebuilt/wasm-wasm32-st-release/lib/mod_spatialite.la +41 -0
  77. package/dist/prebuilt/wasm-wasm32-st-release/lib/pkgconfig/spatialite.pc +12 -0
  78. package/package.json +39 -0
@@ -0,0 +1,1221 @@
1
+ /*
2
+ gaia_topology.h -- Gaia common support for Topology
3
+
4
+ version 5.1.0, 2023 August 4
5
+
6
+ Author: Sandro Furieri a.furieri@lqt.it
7
+
8
+ ------------------------------------------------------------------------------
9
+
10
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
11
+
12
+ The contents of this file are subject to the Mozilla Public License Version
13
+ 1.1 (the "License"); you may not use this file except in compliance with
14
+ the License. You may obtain a copy of the License at
15
+ http://www.mozilla.org/MPL/
16
+
17
+ Software distributed under the License is distributed on an "AS IS" basis,
18
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19
+ for the specific language governing rights and limitations under the
20
+ License.
21
+
22
+ The Original Code is the SpatiaLite library
23
+
24
+ The Initial Developer of the Original Code is Alessandro Furieri
25
+
26
+ Portions created by the Initial Developer are Copyright (C) 2015-2023
27
+ the Initial Developer. All Rights Reserved.
28
+
29
+ Contributor(s):
30
+
31
+ Alternatively, the contents of this file may be used under the terms of
32
+ either the GNU General Public License Version 2 or later (the "GPL"), or
33
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
34
+ in which case the provisions of the GPL or the LGPL are applicable instead
35
+ of those above. If you wish to allow use of your version of this file only
36
+ under the terms of either the GPL or the LGPL, and not to allow others to
37
+ use your version of this file under the terms of the MPL, indicate your
38
+ decision by deleting the provisions above and replace them with the notice
39
+ and other provisions required by the GPL or the LGPL. If you do not delete
40
+ the provisions above, a recipient may use your version of this file under
41
+ the terms of any one of the MPL, the GPL or the LGPL.
42
+
43
+ */
44
+
45
+
46
+ /**
47
+ \file gaia_topology.h
48
+
49
+ Topology handling functions and constants
50
+ */
51
+
52
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
53
+ /* stdio.h included for FILE objects. */
54
+ #include <stdio.h>
55
+ #ifdef DLL_EXPORT
56
+ #define GAIATOPO_DECLARE __declspec(dllexport)
57
+ #else
58
+ #define GAIATOPO_DECLARE extern
59
+ #endif
60
+ #endif
61
+
62
+ #ifndef _GAIATOPO_H
63
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
64
+ #define _GAIATOPO_H
65
+ #endif
66
+
67
+ #ifdef __cplusplus
68
+ extern "C"
69
+ {
70
+ #endif
71
+
72
+ /**
73
+ Typedef for Topology Accessor Object (opaque, hidden)
74
+
75
+ \sa GaiaTopologyAccessorPtr
76
+ */
77
+ typedef struct gaia_topology_accessor GaiaTopologyAccessor;
78
+ /**
79
+ Typedef for Topology Accessor Object pointer (opaque, hidden)
80
+
81
+ \sa GaiaTopologyAccessor
82
+ */
83
+ typedef struct gaia_topology_accessor *GaiaTopologyAccessorPtr;
84
+
85
+ /**
86
+ returns the last Topology exception (if any)
87
+
88
+ \param topo_name unique name identifying the Topology.
89
+
90
+ \return pointer to the last Topology error message: may be NULL if
91
+ no Topology error is currently pending.
92
+ */
93
+ GAIATOPO_DECLARE const char *gaiaTopologyGetLastException (const char
94
+ *topo_name);
95
+
96
+ /**
97
+ creates a new Topology and all related DB objects
98
+
99
+ \param handle pointer to the current DB connection.
100
+ \param topo_name unique name identifying the Topology.
101
+ \param srid a spatial reference identifier.
102
+ \param tolerance a tolerance factor measuren in the same units defined
103
+ by the associated SRID.
104
+ \param has_z boolean: if TRUE this Topology supports 3D (XYZ).
105
+
106
+ \return 0 on failure: any other value on success.
107
+
108
+ \sa gaiaTopologyDrop
109
+ */
110
+ GAIATOPO_DECLARE int gaiaTopologyCreate (sqlite3 * handle,
111
+ const char *topo_name, int srid,
112
+ double tolerance, int has_z);
113
+
114
+ /**
115
+ completely drops an already existing Topology and removes all related DB objects
116
+
117
+ \param handle pointer to the current DB connection.
118
+ \param topo_name unique name identifying the Topology.
119
+
120
+ \return 0 on failure: any other value on success.
121
+
122
+ \sa gaiaTopologyCreate
123
+ */
124
+ GAIATOPO_DECLARE int gaiaTopologyDrop (sqlite3 * handle,
125
+ const char *topo_name);
126
+
127
+ /**
128
+ creates an opaque Topology Accessor object starting from its DB configuration
129
+
130
+ \param handle pointer to the current DB connection.
131
+ \param cache pointer to the opaque Cache Object supporting the DB connection
132
+ \param topo_name unique name identifying the Topology.
133
+
134
+ \return the pointer to newly created Topology Accessor Object: NULL on failure.
135
+
136
+ \sa gaiaTopologyCreate, gaiaTopologyDestroy, gaiaTopologyFromCache,
137
+ gaiaGetTopology
138
+
139
+ \note you are responsible to destroy (before or after) any allocated
140
+ Topology Accessor Object. The Topology Accessor once created will be
141
+ preserved within the internal connection cache for future references.
142
+ */
143
+ GAIATOPO_DECLARE GaiaTopologyAccessorPtr gaiaTopologyFromDBMS (sqlite3 *
144
+ handle,
145
+ const void
146
+ *cache,
147
+ const char
148
+ *topo_name);
149
+
150
+ /**
151
+ retrieves a Topology configuration from DB
152
+
153
+ \param handle pointer to the current DB connection.
154
+ \param cache pointer to the opaque Cache Object supporting the DB connection
155
+ \param topo_name unique name identifying the Topology.
156
+ \param topology_name on completion will point to the real Topology name.
157
+ \param srid on completion will contain the Topology SRID.
158
+ \param tolerance on completion will contain the tolerance argument.
159
+ \param has_z on completion will report if the Topology is of the 3D type.
160
+
161
+ \return 1 on success: NULL on failure.
162
+
163
+ \sa gaiaTopologyCreate, gaiaTopologyDestroy, gaiaTopologyFromCache,
164
+ gaiaGetTopology
165
+ */
166
+ GAIATOPO_DECLARE int gaiaReadTopologyFromDBMS (sqlite3 *
167
+ handle,
168
+ const char
169
+ *topo_name,
170
+ char **topology_name,
171
+ int *srid,
172
+ double *tolerance,
173
+ int *has_z);
174
+
175
+ /**
176
+ retrieves an already defined opaque Topology Accessor object from the
177
+ internal connection cache
178
+
179
+ \param cache pointer to the opaque Cache Object supporting the DB connection
180
+ \param topo_name unique name identifying the Topology.
181
+
182
+ \return pointer to an already existing Topology Accessor Object: NULL on failure.
183
+
184
+ \sa gaiaTopologyCreate, gaiaTopologyDestroy, gaiaTopologyFromDBMS,
185
+ gaiaGetTopology
186
+ */
187
+ GAIATOPO_DECLARE GaiaTopologyAccessorPtr gaiaTopologyFromCache (const void
188
+ *cache,
189
+ const char
190
+ *topo_name);
191
+
192
+ /**
193
+ will attempt to return a reference to a Topology Accessor object
194
+
195
+ \param handle pointer to the current DB connection.
196
+ \param cache pointer to the opaque Cache Object supporting the DB connection
197
+ \param topo_name unique name identifying the Topology.
198
+
199
+ \return pointer to Topology Accessor Object: NULL on failure.
200
+
201
+ \sa gaiaTopologyCreate, gaiaTopologyDestroy, gaiaTopologyFromCache,
202
+ gaiaTopologyFromDBMS
203
+
204
+ \note if a corresponding Topology Accessor Object is already defined
205
+ will return a pointer to such Objet. Otherwise an attempt will be made
206
+ in order to create a new Topology Accessor object starting from its DB
207
+ configuration.
208
+ */
209
+ GAIATOPO_DECLARE GaiaTopologyAccessorPtr gaiaGetTopology (sqlite3 *
210
+ handle,
211
+ const void
212
+ *cache,
213
+ const char
214
+ *topo_name);
215
+
216
+ /**
217
+ destroys a Topology Accessor object and any related memory allocation
218
+
219
+ \param ptr pointer to the Topology Accessor Object to be destroyed.
220
+
221
+ \sa gaiaTopologyFromDBMS
222
+ */
223
+ GAIATOPO_DECLARE void gaiaTopologyDestroy (GaiaTopologyAccessorPtr ptr);
224
+
225
+ /**
226
+ Adds an isolated node into the Topology
227
+
228
+ \param ptr pointer to the Topology Accessor Object.
229
+ \param face the unique identifier of containing face or -1 for "unknown".
230
+ \param pt pointer to the Node Geometry.
231
+ \param skip_checks boolean: if TRUE skips consistency checks
232
+ (coincident nodes, crossing edges, actual face containement)
233
+
234
+ \return the ID of the inserted Node; a negative number on failure.
235
+
236
+ \sa gaiaTopologyFromDBMS
237
+ */
238
+ GAIATOPO_DECLARE sqlite3_int64 gaiaAddIsoNode (GaiaTopologyAccessorPtr
239
+ ptr, sqlite3_int64 face,
240
+ gaiaPointPtr pt,
241
+ int skip_checks);
242
+
243
+ /**
244
+ Moves an isolated node in a Topology from one point to another
245
+
246
+ \param ptr pointer to the Topology Accessor Object.
247
+ \param node the unique identifier of node.
248
+ \param pt pointer to the Node Geometry.
249
+
250
+ \return 1 on success; 0 on failure.
251
+
252
+ \sa gaiaTopologyFromDBMS
253
+ */
254
+ GAIATOPO_DECLARE int gaiaMoveIsoNode (GaiaTopologyAccessorPtr ptr,
255
+ sqlite3_int64 node, gaiaPointPtr pt);
256
+
257
+ /**
258
+ Removes an isolated node from a Topology
259
+
260
+ \param ptr pointer to the Topology Accessor Object.
261
+ \param node the unique identifier of node.
262
+
263
+ \return 1 on success; 0 on failure.
264
+
265
+ \sa gaiaTopologyFromDBMS
266
+ */
267
+ GAIATOPO_DECLARE int gaiaRemIsoNode (GaiaTopologyAccessorPtr ptr,
268
+ sqlite3_int64 node);
269
+
270
+ /**
271
+ Adds an isolated edge into the Topology
272
+
273
+ \param ptr pointer to the Topology Accessor Object.
274
+ \param start_node the Start Node's unique identifier.
275
+ \param end_node the End Node unique identifier.
276
+ \param ln pointer to the Edge Geometry.
277
+
278
+ \return the ID of the inserted Edge; a negative number on failure.
279
+
280
+ \sa gaiaTopologyFromDBMS
281
+ */
282
+ GAIATOPO_DECLARE sqlite3_int64 gaiaAddIsoEdge (GaiaTopologyAccessorPtr
283
+ ptr,
284
+ sqlite3_int64 start_node,
285
+ sqlite3_int64 end_node,
286
+ gaiaLinestringPtr ln);
287
+
288
+ /**
289
+ Removes an isolated edge from a Topology
290
+
291
+ \param ptr pointer to the Topology Accessor Object.
292
+ \param edge the unique identifier of edge.
293
+
294
+ \return 1 on success; 0 on failure.
295
+
296
+ \sa gaiaTopologyFromDBMS
297
+ */
298
+ GAIATOPO_DECLARE int gaiaRemIsoEdge (GaiaTopologyAccessorPtr ptr,
299
+ sqlite3_int64 edge);
300
+
301
+ /**
302
+ Changes the shape of an Edge without affecting the Topology structure
303
+
304
+ \param ptr pointer to the Topology Accessor Object.
305
+ \param edge_id the Edge unique identifier.
306
+ \param ln pointer to the Edge Geometry.
307
+
308
+ \return 1 on success; 0 on failure.
309
+
310
+ \sa gaiaTopologyFromDBMS
311
+ */
312
+ GAIATOPO_DECLARE int gaiaChangeEdgeGeom (GaiaTopologyAccessorPtr ptr,
313
+ sqlite3_int64 edge_id,
314
+ gaiaLinestringPtr ln);
315
+
316
+ /**
317
+ Split an edge by a node, modifying the original edge and adding a new one.
318
+
319
+ \param ptr pointer to the Topology Accessor Object.
320
+ \param edge the unique identifier of the edge to be split.
321
+ \param pt pointer to the Node Geometry.
322
+ \param skip_checks boolean: if TRUE skips consistency checks
323
+ (coincident node, point not on edge...)
324
+
325
+ \return the ID of the inserted Node; a negative number on failure.
326
+
327
+ \sa gaiaTopologyFromDBMS
328
+ */
329
+ GAIATOPO_DECLARE sqlite3_int64 gaiaModEdgeSplit (GaiaTopologyAccessorPtr
330
+ ptr, sqlite3_int64 edge,
331
+ gaiaPointPtr pt,
332
+ int skip_checks);
333
+
334
+ /**
335
+ Split an edge by a node, replacing it with two new edges.
336
+
337
+ \param ptr pointer to the Topology Accessor Object.
338
+ \param edge the unique identifier of the edge to be split.
339
+ \param pt pointer to the Node Geometry.
340
+ \param skip_checks boolean: if TRUE skips consistency checks
341
+ (coincident node, point not on edge...)
342
+
343
+ \return the ID of the inserted Node; a negative number on failure.
344
+
345
+ \sa gaiaTopologyFromDBMS
346
+ */
347
+ GAIATOPO_DECLARE sqlite3_int64 gaiaNewEdgesSplit (GaiaTopologyAccessorPtr
348
+ ptr, sqlite3_int64 edge,
349
+ gaiaPointPtr pt,
350
+ int skip_checks);
351
+
352
+ /**
353
+ Adds a new edge possibly splitting and modifying a face.
354
+
355
+ \param ptr pointer to the Topology Accessor Object.
356
+ \param start_node the unique identifier of the starting node.
357
+ \param end_node the unique identifier of the ending node.
358
+ \param ln pointer to the Edge Geometry.
359
+ \param skip_checks boolean: if TRUE skips consistency checks
360
+ (curve being simple and valid, start/end nodes, consistency
361
+ actual face containement)
362
+
363
+ \return the ID of the inserted Edge; a negative number on failure.
364
+
365
+ \sa gaiaTopologyFromDBMS
366
+ */
367
+ GAIATOPO_DECLARE sqlite3_int64 gaiaAddEdgeModFace (GaiaTopologyAccessorPtr
368
+ ptr,
369
+ sqlite3_int64
370
+ start_node,
371
+ sqlite3_int64 end_node,
372
+ gaiaLinestringPtr ln,
373
+ int skip_checks);
374
+
375
+ /**
376
+ Adds a new edge possibly splitting a face (replacing with two new faces).
377
+
378
+ \param ptr pointer to the Topology Accessor Object.
379
+ \param start_node the unique identifier of the starting node.
380
+ \param end_node the unique identifier of the ending node.
381
+ \param ln pointer to the Edge Geometry.
382
+ \param skip_checks boolean: if TRUE skips consistency checks
383
+ (curve being simple and valid, start/end nodes, consistency
384
+ actual face containement)
385
+
386
+ \return the ID of the inserted Edge; a negative number on failure.
387
+
388
+ \sa gaiaTopologyFromDBMS
389
+ */
390
+ GAIATOPO_DECLARE sqlite3_int64
391
+ gaiaAddEdgeNewFaces (GaiaTopologyAccessorPtr ptr,
392
+ sqlite3_int64 start_node, sqlite3_int64 end_node,
393
+ gaiaLinestringPtr ln, int skip_checks);
394
+
395
+ /**
396
+ Removes an edge, and if the removed edge separated two faces, delete one
397
+ of them and modify the other to take the space of both.
398
+
399
+ \param ptr pointer to the Topology Accessor Object.
400
+ \param edge_id the unique identifier of the edge to be removed.
401
+
402
+ \return the ID of face that takes up the space previously occupied
403
+ by the removed edge; a negative number on failure.
404
+
405
+ \sa gaiaTopologyFromDBMS
406
+ */
407
+ GAIATOPO_DECLARE sqlite3_int64 gaiaRemEdgeModFace (GaiaTopologyAccessorPtr
408
+ ptr,
409
+ sqlite3_int64 edge_id);
410
+
411
+ /**
412
+ Removes an edge, and if the removed edge separated two faces, delete the
413
+ original faces and replace them with a new face.
414
+
415
+ \param ptr pointer to the Topology Accessor Object.
416
+ \param edge_id the unique identifier of the edge to be removed.
417
+
418
+ \return the ID of the created face; a negative number on failure.
419
+
420
+ \sa gaiaTopologyFromDBMS
421
+ */
422
+ GAIATOPO_DECLARE sqlite3_int64 gaiaRemEdgeNewFace (GaiaTopologyAccessorPtr
423
+ ptr,
424
+ sqlite3_int64 edge_id);
425
+
426
+ /**
427
+ Heal two edges by removing the node connecting them, modifying the
428
+ first edge and removing the second edge
429
+
430
+ \param ptr pointer to the Topology Accessor Object.
431
+ \param edge_id1 the unique identifier of the first edge to be healed.
432
+ \param edge_id2 the unique identifier of the second edge to be healed.
433
+
434
+ \return the ID of the removed node.
435
+
436
+ \sa gaiaTopologyFromDBMS
437
+ */
438
+ GAIATOPO_DECLARE sqlite3_int64 gaiaModEdgeHeal (GaiaTopologyAccessorPtr
439
+ ptr,
440
+ sqlite3_int64 edge_id1,
441
+ sqlite3_int64 edge_id2);
442
+
443
+ /**
444
+ Heal two edges by removing the node connecting them, deleting both edges
445
+ and replacing them with an edge whose orientation is the same of the
446
+ first edge provided
447
+
448
+ \param ptr pointer to the Topology Accessor Object.
449
+ \param edge_id1 the unique identifier of the first edge to be healed.
450
+ \param edge_id2 the unique identifier of the second edge to be healed.
451
+
452
+ \return the ID of the removed node.
453
+
454
+ \sa gaiaTopologyFromDBMS
455
+ */
456
+ GAIATOPO_DECLARE sqlite3_int64 gaiaNewEdgeHeal (GaiaTopologyAccessorPtr
457
+ ptr,
458
+ sqlite3_int64 edge_id1,
459
+ sqlite3_int64 edge_id2);
460
+
461
+ /**
462
+ Return the geometry of a Topology Face
463
+
464
+ \param ptr pointer to the Topology Accessor Object.
465
+ \param face the unique identifier of the face.
466
+
467
+ \return pointer to Geometry (polygon); NULL on failure.
468
+
469
+ \sa gaiaTopologyFromDBMS
470
+ */
471
+ GAIATOPO_DECLARE gaiaGeomCollPtr
472
+ gaiaGetFaceGeometry (GaiaTopologyAccessorPtr ptr, sqlite3_int64 face);
473
+
474
+ /**
475
+ Updates a temporary table containing the ordered list of Edges
476
+ (in counterclockwise order) for every Face.
477
+ EdgeIDs are signed value; a negative ID intends reverse direction.
478
+
479
+ \param ptr pointer to the Topology Accessor Object.
480
+ \param face the unique identifier of the face.
481
+
482
+ \return 1 on success; 0 on failure.
483
+
484
+ \sa gaiaTopologyFromDBMS
485
+ */
486
+ GAIATOPO_DECLARE int
487
+ gaiaGetFaceEdges (GaiaTopologyAccessorPtr ptr, sqlite3_int64 face);
488
+
489
+ /**
490
+ Find the ID of a Node at a Point location
491
+
492
+ \param ptr pointer to the Topology Accessor Object.
493
+ \param pt pointer to the Point Geometry.
494
+ \param tolerance approximation factor.
495
+
496
+ \return the ID of a Node; -1 on failure.
497
+
498
+ \sa gaiaTopologyFromDBMS
499
+ */
500
+ GAIATOPO_DECLARE sqlite3_int64
501
+ gaiaGetNodeByPoint (GaiaTopologyAccessorPtr ptr, gaiaPointPtr pt,
502
+ double tolerance);
503
+
504
+ /**
505
+ Find the ID of an Edge at a Point location
506
+
507
+ \param ptr pointer to the Topology Accessor Object.
508
+ \param pt pointer to the Point Geometry.
509
+ \param tolerance approximation factor.
510
+
511
+ \return the ID of an Edge; -1 on failure.
512
+
513
+ \sa gaiaTopologyFromDBMS
514
+ */
515
+ GAIATOPO_DECLARE sqlite3_int64
516
+ gaiaGetEdgeByPoint (GaiaTopologyAccessorPtr ptr, gaiaPointPtr pt,
517
+ double tolerance);
518
+
519
+ /**
520
+ Find the ID of a Face at a Point location
521
+
522
+ \param ptr pointer to the Topology Accessor Object.
523
+ \param pt pointer to the Point Geometry.
524
+ \param tolerance approximation factor.
525
+
526
+ \return the ID of a Face; -1 on failure.
527
+
528
+ \sa gaiaTopologyFromDBMS
529
+ */
530
+ GAIATOPO_DECLARE sqlite3_int64
531
+ gaiaGetFaceByPoint (GaiaTopologyAccessorPtr ptr, gaiaPointPtr pt,
532
+ double tolerance);
533
+
534
+ /**
535
+ Transforms a (multi)Linestring or (multi)Polygon into an new MultiLinestring.
536
+
537
+ \param geom pointer to the input Geometry (Linestring, MultiLinestring,
538
+ Polygon or MultiPolygon).
539
+ \param line_max_points if set to a positive number all input Linestrings
540
+ and/or Polygon Rings will be split into simpler Lines having no more than
541
+ this maximum number of points.
542
+ \param max_length if set to a positive value all input Linestrings
543
+ and/or Polygon Rings will be split into simpler Lines having a length
544
+ not exceeding this threshold. If both line_max_points and max_legth
545
+ are set as the same time the first condition occurring will cause
546
+ a new Line to be started.
547
+
548
+ \return a MultiLinestring Geometry; NULL on failure.
549
+
550
+ \sa gaiaTopologyFromDBMS
551
+ */
552
+ GAIATOPO_DECLARE gaiaGeomCollPtr
553
+ gaiaTopoGeo_SubdivideLines (gaiaGeomCollPtr geom, int line_max_points,
554
+ double max_length);
555
+
556
+ /**
557
+ Adds a Point to an existing Topology and possibly splitting an Edge.
558
+
559
+ \param ptr pointer to the Topology Accessor Object.
560
+ \param pt pointer to the Point Geometry.
561
+ \param tolerance approximation factor.
562
+
563
+ \return the ID of the Node; -1 on failure.
564
+
565
+ \sa gaiaTopologyFromDBMS
566
+ */
567
+ GAIATOPO_DECLARE sqlite3_int64
568
+ gaiaTopoGeo_AddPoint (GaiaTopologyAccessorPtr ptr, gaiaPointPtr pt,
569
+ double tolerance);
570
+
571
+ /**
572
+ Adds a Linestring to an existing Topology without determining generated faces..
573
+
574
+ \param ptr pointer to the Topology Accessor Object.
575
+ \param ln pointer to the Linestring Geometry.
576
+ \param tolerance approximation factor.
577
+ \param edge_ids on success will point to an array of Edge IDs
578
+ \param ids_count on success will report the number of Edge IDs in the
579
+ above array
580
+
581
+ \return 1 on success; 0 on failure.
582
+
583
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_AddLineStringNoFace
584
+ */
585
+ GAIATOPO_DECLARE int
586
+ gaiaTopoGeo_AddLineString (GaiaTopologyAccessorPtr ptr,
587
+ gaiaLinestringPtr pt, double tolerance,
588
+ sqlite3_int64 ** edge_ids, int *ids_count);
589
+
590
+ /**
591
+ Adds a Linestring to an existing Topology and possibly splitting Edges/Faces.
592
+
593
+ \param ptr pointer to the Topology Accessor Object.
594
+ \param ln pointer to the Linestring Geometry.
595
+ \param tolerance approximation factor.
596
+ \param edge_ids on success will point to an array of Edge IDs
597
+ \param ids_count on success will report the number of Edge IDs in the
598
+ above array
599
+
600
+ \return 1 on success; 0 on failure.
601
+
602
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_AddLineString, gaiaTopoGeo_Polygonize
603
+ */
604
+ GAIATOPO_DECLARE int
605
+ gaiaTopoGeo_AddLineStringNoFace (GaiaTopologyAccessorPtr ptr,
606
+ gaiaLinestringPtr pt,
607
+ double tolerance,
608
+ sqlite3_int64 ** edge_ids,
609
+ int *ids_count);
610
+
611
+ /**
612
+ Determine and register all topology faces.
613
+
614
+ \param ptr pointer to the Topology Accessor Object.
615
+
616
+ \return 1 on success; 0 on failure.
617
+
618
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_AddLineStringNoFace,
619
+ gaiaTopoGeo_FromGeoTableNoFace, FromGeoTableNoFaceExt
620
+ */
621
+ GAIATOPO_DECLARE int gaiaTopoGeo_Polygonize (GaiaTopologyAccessorPtr ptr);
622
+
623
+ /**
624
+ Snap Geometry to Topology.
625
+
626
+ \param ptr pointer to the Topology Accessor Object.
627
+ \param geom pointer to the input Geometry.
628
+ \param tolerance_snap snap tolerance.
629
+ \param tolerance_removal removal tolerance (use -1 to skip removal phase).
630
+ \param iterate if non zero, allows snapping to more than a single
631
+ vertex, iteratively.
632
+
633
+ \return pointer to the snapped Geometry; NULL on failure.
634
+
635
+ \sa gaiaTopologyFromDBMS
636
+ */
637
+ GAIATOPO_DECLARE gaiaGeomCollPtr
638
+ gaiaTopoSnap (GaiaTopologyAccessorPtr ptr, gaiaGeomCollPtr geom,
639
+ double tolerance_snap, double tolerance_removal,
640
+ int iterate);
641
+
642
+ /**
643
+ Adds a Polygon to an existing Topology and possibly splitting Edges/Faces.
644
+
645
+ \param ptr pointer to the Topology Accessor Object.
646
+ \param pg pointer to the Polygon Geometry.
647
+ \param tolerance approximation factor.
648
+ \param face_ids on success will point to an array of Face IDs
649
+ \param ids_count on success will report the number of Face IDs in the
650
+ above array
651
+
652
+ \return 1 on success; 0 on failure.
653
+
654
+ \sa gaiaTopologyFromDBMS
655
+ */
656
+ GAIATOPO_DECLARE int
657
+ gaiaTopoGeo_AddPolygon (GaiaTopologyAccessorPtr ptr,
658
+ gaiaPolygonPtr pg, double tolerance,
659
+ sqlite3_int64 ** face_ids, int *ids_count);
660
+
661
+ /**
662
+ Populates a Topology by importing a whole GeoTable
663
+
664
+ \param ptr pointer to the Topology Accessor Object.
665
+ \param db-prefix prefix of the DB containing the input GeoTable.
666
+ If NULL the "main" DB will be intended by default.
667
+ \param table name of the input GeoTable.
668
+ \param column name of the input Geometry Column.
669
+ Could be NULL is the input table has just a single Geometry Column.
670
+ \param tolerance approximation factor.
671
+ \param line_max_points if set to a positive number all input Linestrings
672
+ and/or Polygon Rings will be split into simpler Linestrings having no more
673
+ than this maximum number of points.
674
+ \param max_length if set to a positive value all input Linestrings
675
+ and/or Polygon Rings will be split into simpler Lines having a length
676
+ not exceeding this threshold. If both line_max_points and max_legth
677
+ are set as the same time the first condition occurring will cause
678
+ a new Line to be started.
679
+
680
+ \return 1 on success; -1 on failure (will raise an exception).
681
+
682
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_FromGeoTableNoFace
683
+ */
684
+ GAIATOPO_DECLARE int
685
+ gaiaTopoGeo_FromGeoTable (GaiaTopologyAccessorPtr ptr,
686
+ const char *db_prefix, const char *table,
687
+ const char *column, double tolerance,
688
+ int line_max_points, double max_length);
689
+
690
+ /**
691
+ Populates a Topology by importing a whole GeoTable without
692
+ determining generated faces
693
+
694
+ \param ptr pointer to the Topology Accessor Object.
695
+ \param db-prefix prefix of the DB containing the input GeoTable.
696
+ If NULL the "main" DB will be intended by default.
697
+ \param table name of the input GeoTable.
698
+ \param column name of the input Geometry Column.
699
+ Could be NULL is the input table has just a single Geometry Column.
700
+ \param tolerance approximation factor.
701
+ \param line_max_points if set to a positive number all input Linestrings
702
+ and/or Polygon Rings will be split into simpler Linestrings having no more
703
+ than this maximum number of points.
704
+ \param max_length if set to a positive value all input Linestrings
705
+ and/or Polygon Rings will be split into simpler Lines having a length
706
+ not exceeding this threshold. If both line_max_points and max_legth
707
+ are set as the same time the first condition occurring will cause
708
+ a new Line to be started.
709
+
710
+ \return 1 on success; -1 on failure (will raise an exception).
711
+
712
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_FromGeoTable, gaiaTopoGeo_Polygonize
713
+ */
714
+ GAIATOPO_DECLARE int
715
+ gaiaTopoGeo_FromGeoTableNoFace (GaiaTopologyAccessorPtr ptr,
716
+ const char *db_prefix,
717
+ const char *table, const char *column,
718
+ double tolerance, int line_max_points,
719
+ double max_length);
720
+
721
+ /**
722
+ Populates a Topology by importing a whole GeoTable - Extended mode
723
+
724
+ \param ptr pointer to the Topology Accessor Object.
725
+ \param sql_in an SQL statement (SELECT) returning input features
726
+ \param sql_out a second SQL statement (INSERT INTO) intended to
727
+ store failing features references into the "dustbin" table.
728
+ \param sql_in2 an SQL statement (SELECT) returning a single input
729
+ feature (used for retrying to insert a failing feature)
730
+ \param tolerance approximation factor.
731
+ \param line_max_points if set to a positive number all input Linestrings
732
+ and/or Polygon Rings will be split into simpler Linestrings having no more
733
+ than this maximum number of points.
734
+ \param max_length if set to a positive value all input Linestrings
735
+ and/or Polygon Rings will be split into simpler Lines having a length
736
+ not exceeding this threshold. If both line_max_points and max_legth
737
+ are set as the same time the first condition occurring will cause
738
+ a new Line to be started.
739
+
740
+ \return 0 if all input features were succesfully importer, or a
741
+ positive number (total count of failing features raising an exception
742
+ and referenced by the "dustbin" table); -1 if some unexpected
743
+ error occurred.
744
+
745
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_FromGeoTableNoFaceExtended
746
+ */
747
+ GAIATOPO_DECLARE int
748
+ gaiaTopoGeo_FromGeoTableExtended (GaiaTopologyAccessorPtr ptr,
749
+ const char *sql_in,
750
+ const char *sql_out,
751
+ const char *sql_in2,
752
+ double tolerance,
753
+ int line_max_points,
754
+ double max_length);
755
+
756
+ /**
757
+ Populates a Topology by importing a whole GeoTable without
758
+ determining generated faces - Extended mode
759
+
760
+ \param ptr pointer to the Topology Accessor Object.
761
+ \param sql_in an SQL statement (SELECT) returning input features
762
+ \param sql_out a second SQL statement (INSERT INTO) intended to
763
+ store failing features references into the "dustbin" table.
764
+ \param sql_in2 an SQL statement (SELECT) returning a single input
765
+ feature (used for retrying to insert a failing feature)
766
+ \param tolerance approximation factor.
767
+ \param line_max_points if set to a positive number all input Linestrings
768
+ and/or Polygon Rings will be split into simpler Linestrings having no more
769
+ than this maximum number of points.
770
+ \param max_length if set to a positive value all input Linestrings
771
+ and/or Polygon Rings will be split into simpler Lines having a length
772
+ not exceeding this threshold. If both line_max_points and max_legth
773
+ are set as the same time the first condition occurring will cause
774
+ a new Line to be started.
775
+
776
+ \return 0 if all input features were succesfully importer, or a
777
+ positive number (total count of failing features raising an exception
778
+ and referenced by the "dustbin" table); -1 if some unexpected
779
+ error occurred.
780
+
781
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_FromGeoTableExtended,
782
+ gaiaTopoGeo_Polygonize
783
+ */
784
+ GAIATOPO_DECLARE int
785
+ gaiaTopoGeo_FromGeoTableNoFaceExtended (GaiaTopologyAccessorPtr ptr,
786
+ const char *sql_in,
787
+ const char *sql_out,
788
+ const char *sql_in2,
789
+ double tolerance,
790
+ int line_max_points,
791
+ double max_length);
792
+
793
+ /**
794
+ Creates and populates a new GeoTable by snapping all Geometries
795
+ contained into another GeoTable against a given Topology
796
+
797
+ \param ptr pointer to the Topology Accessor Object.
798
+ \param db-prefix prefix of the DB containing the input GeoTable.
799
+ If NULL the "main" DB will be intended by default.
800
+ \param table name of the input GeoTable.
801
+ \param column name of the input Geometry Column.
802
+ Could be NULL is the input table has just a single Geometry Column.
803
+ \param outtable name of the output GeoTable.
804
+ \param tolerance_snap snap tolerance.
805
+ \param tolerance_removal removal tolerance (use -1 to skip removal phase).
806
+ \param iterate if non zero, allows snapping to more than a single
807
+ vertex, iteratively.
808
+
809
+ \return 1 on success; -1 on failure (will raise an exception).
810
+
811
+ \sa gaiaTopologyFromDBMS
812
+ */
813
+ GAIATOPO_DECLARE int
814
+ gaiaTopoGeo_SnappedGeoTable (GaiaTopologyAccessorPtr ptr,
815
+ const char *db_prefix, const char *table,
816
+ const char *column, const char *outtable,
817
+ double tolerance_snap,
818
+ double tolerance_removal, int iterate);
819
+
820
+ /**
821
+ Creates a temporary table containing a validation report for a given TopoGeo.
822
+
823
+ \param ptr pointer to the Topology Accessor Object.
824
+
825
+ \return 1 on success; 0 on failure.
826
+
827
+ \sa gaiaTopologyFromDBMS
828
+ */
829
+ GAIATOPO_DECLARE int gaiaValidateTopoGeo (GaiaTopologyAccessorPtr ptr);
830
+
831
+ /**
832
+ Return a Point geometry (seed) identifying a Topology Edge
833
+
834
+ \param ptr pointer to the Topology Accessor Object.
835
+ \param edge the unique identifier of the edge.
836
+
837
+ \return pointer to Geometry (point); NULL on failure.
838
+
839
+ \sa gaiaTopologyFromDBMS
840
+ */
841
+ GAIATOPO_DECLARE gaiaGeomCollPtr
842
+ gaiaGetEdgeSeed (GaiaTopologyAccessorPtr ptr, sqlite3_int64 edge);
843
+
844
+ /**
845
+ Return a Point geometry (seed) identifying a Topology Face
846
+
847
+ \param ptr pointer to the Topology Accessor Object.
848
+ \param face the unique identifier of the face.
849
+
850
+ \return pointer to Geometry (point); NULL on failure.
851
+
852
+ \sa gaiaTopologyFromDBMS
853
+ */
854
+ GAIATOPO_DECLARE gaiaGeomCollPtr
855
+ gaiaGetFaceSeed (GaiaTopologyAccessorPtr ptr, sqlite3_int64 face);
856
+
857
+ /**
858
+ Ensures that all Edges on a Topology-Geometry will have not less
859
+ than three vertices; for all Edges found being simple two-points
860
+ segments a third intermediate point will be interpolated.
861
+
862
+ \param ptr pointer to the Topology Accessor Object.
863
+
864
+ \return the total number of changed Edges; a negativa number on error
865
+
866
+ \sa gaiaTopologyFromDBMS
867
+ */
868
+ GAIATOPO_DECLARE int
869
+ gaiaTopoGeo_DisambiguateSegmentEdges (GaiaTopologyAccessorPtr ptr);
870
+
871
+ /**
872
+ Will update all Seeds for a Topology-Geometry
873
+
874
+ \param ptr pointer to the Topology Accessor Object.
875
+ \param mode if set to 0 a full update of all Seeds will be performed,
876
+ otherwise an incremental update will happen.
877
+
878
+ \return 1 on success; 0 on failure.
879
+
880
+ \sa gaiaTopologyFromDBMS
881
+ */
882
+ GAIATOPO_DECLARE int
883
+ gaiaTopoGeoUpdateSeeds (GaiaTopologyAccessorPtr ptr, int mode);
884
+
885
+ /**
886
+ Will snap a Point geometry to TopoSeeds
887
+
888
+ \param ptr pointer to the Topology Accessor Object.
889
+ \param pt pointer to the Point Geometry.
890
+ \param distance tolerance approximation factor.
891
+
892
+ \return pointer to Geometry (point); NULL on failure.
893
+
894
+ \sa gaiaTopologyFromDBMS
895
+ */
896
+ GAIATOPO_DECLARE gaiaGeomCollPtr
897
+ gaiaTopoGeoSnapPointToSeed (GaiaTopologyAccessorPtr ptr,
898
+ gaiaGeomCollPtr pt, double distance);
899
+
900
+ /**
901
+ Will snap a Linestring geometry to TopoSeeds
902
+
903
+ \param ptr pointer to the Topology Accessor Object.
904
+ \param ln pointer to the Linestring Geometry.
905
+ \param distance tolerance approximation factor.
906
+
907
+ \return pointer to Geometry (linestring); NULL on failure.
908
+
909
+ \sa gaiaTopologyFromDBMS
910
+ */
911
+ GAIATOPO_DECLARE gaiaGeomCollPtr
912
+ gaiaTopoGeoSnapLinestringToSeed (GaiaTopologyAccessorPtr ptr,
913
+ gaiaGeomCollPtr ln, double distance);
914
+
915
+ /**
916
+ Extracts a Simple Features Table out from a Topology by matching
917
+ Topology Seeds to a given reference Table.
918
+
919
+ \param ptr pointer to the Topology Accessor Object.
920
+ \param db-prefix prefix of the DB containing the reference GeoTable.
921
+ If NULL the "main" DB will be intended by default.
922
+ \param ref_table name of the reference GeoTable.
923
+ \param ref_column name of the reference Geometry Column.
924
+ Could be NULL is the reference table has just a single Geometry Column.
925
+ \param out_table name of the output output table to be created and populated.
926
+ \param with_spatial_index boolean flag: if set to TRUE (non ZERO) a Spatial
927
+ Index supporting the output table will be created.
928
+
929
+ \return 1 on success; -1 on failure (will raise an exception).
930
+
931
+ \sa gaiaTopologyFromDBMS
932
+ */
933
+ GAIATOPO_DECLARE int
934
+ gaiaTopoGeo_ToGeoTable (GaiaTopologyAccessorPtr ptr,
935
+ const char *db_prefix, const char *ref_table,
936
+ const char *ref_column, const char *out_table,
937
+ int with_spatial_index);
938
+
939
+ /**
940
+ Creates and populates a Table containing a comprehensive report
941
+ about all intesections between the Faces of some Topology and
942
+ a given reference Table of the Polygon/Multipolygon type.
943
+
944
+ \param ptr pointer to the Topology Accessor Object.
945
+ \param db-prefix prefix of the DB containing the reference GeoTable.
946
+ If NULL the "main" DB will be intended by default.
947
+ \param ref_table name of the reference GeoTable.
948
+ \param ref_column name of the reference Geometry Column.
949
+ Could be NULL is the reference table has just a single Geometry Column.
950
+ \param out_table name of the output output table to be created and populated.
951
+
952
+ \return 1 on success; -1 on failure (will raise an exception).
953
+
954
+ \sa gaiaTopologyFromDBMS
955
+ */
956
+ GAIATOPO_DECLARE int
957
+ gaiaTopoGeo_PolyFacesList (GaiaTopologyAccessorPtr ptr,
958
+ const char *db_prefix, const char *ref_table,
959
+ const char *ref_column,
960
+ const char *out_table);
961
+
962
+ /**
963
+ Creates and populates a Table containing a comprehensive report
964
+ about all intesections between the Edges of some Topology and
965
+ a given reference Table of the Linestring/Multilinestring type.
966
+
967
+ \param ptr pointer to the Topology Accessor Object.
968
+ \param db-prefix prefix of the DB containing the reference GeoTable.
969
+ If NULL the "main" DB will be intended by default.
970
+ \param ref_table name of the reference GeoTable.
971
+ \param ref_column name of the reference Geometry Column.
972
+ Could be NULL is the reference table has just a single Geometry Column.
973
+ \param out_table name of the output output table to be created and populated.
974
+
975
+ \return 1 on success; -1 on failure (will raise an exception).
976
+
977
+ \sa gaiaTopologyFromDBMS
978
+ */
979
+ GAIATOPO_DECLARE int
980
+ gaiaTopoGeo_LineEdgesList (GaiaTopologyAccessorPtr ptr,
981
+ const char *db_prefix, const char *ref_table,
982
+ const char *ref_column,
983
+ const char *out_table);
984
+
985
+ /**
986
+ Extracts a simplified/generalized Simple Features Table out from a Topology
987
+ by matching Topology Seeds to a given reference Table.
988
+
989
+ \param ptr pointer to the Topology Accessor Object.
990
+ \param db-prefix prefix of the DB containing the reference GeoTable.
991
+ If NULL the "main" DB will be intended by default.
992
+ \param ref_table name of the reference GeoTable.
993
+ \param ref_column name of the reference Geometry Column.
994
+ Could be NULL is the reference table has just a single Geometry Column.
995
+ \param out_table name of the output output table to be created and populated.
996
+ \param tolerance approximation radius required by the Douglar-Peucker
997
+ simplification algorithm.
998
+ \param with_spatial_index boolean flag: if set to TRUE (non ZERO) a Spatial
999
+ Index supporting the output table will be created.
1000
+
1001
+ \return 1 on success; -1 on failure (will raise an exception).
1002
+
1003
+ \sa gaiaTopologyFromDBMS
1004
+ */
1005
+ GAIATOPO_DECLARE int
1006
+ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr ptr,
1007
+ const char *db_prefix,
1008
+ const char *ref_table,
1009
+ const char *ref_column,
1010
+ const char *out_table,
1011
+ double tolerance,
1012
+ int with_spatial_index);
1013
+
1014
+ /**
1015
+ Removes all small Faces from a Topology
1016
+
1017
+ \param ptr pointer to the Topology Accessor Object.
1018
+ \param min_circularity threshold Circularity-index identifying threadlike Faces.
1019
+ \param min_area threshold area to identify small Faces.
1020
+
1021
+ \return 1 on success; -1 on failure (will raise an exception).
1022
+
1023
+ \sa gaiaTopologyFromDBMS
1024
+ */
1025
+ GAIATOPO_DECLARE int
1026
+ gaiaTopoGeo_RemoveSmallFaces (GaiaTopologyAccessorPtr ptr,
1027
+ double min_circularity, double min_area);
1028
+
1029
+ /**
1030
+ Removes all dangling Edges from a Topology
1031
+
1032
+ \param ptr pointer to the Topology Accessor Object.
1033
+
1034
+ \return 1 on success; -1 on failure (will raise an exception).
1035
+
1036
+ \sa gaiaTopologyFromDBMS
1037
+ */
1038
+ GAIATOPO_DECLARE int
1039
+ gaiaTopoGeo_RemoveDanglingEdges (GaiaTopologyAccessorPtr ptr);
1040
+
1041
+ /**
1042
+ Removes all dangling Nodes from a Topology
1043
+
1044
+ \param ptr pointer to the Topology Accessor Object.
1045
+
1046
+ \return 1 on success; -1 on failure (will raise an exception).
1047
+
1048
+ \sa gaiaTopologyFromDBMS
1049
+ */
1050
+ GAIATOPO_DECLARE int
1051
+ gaiaTopoGeo_RemoveDanglingNodes (GaiaTopologyAccessorPtr ptr);
1052
+
1053
+ /**
1054
+ Removes all useless Nodes from a Topology by calling ST_NewEdgeHeal
1055
+
1056
+ \param ptr pointer to the Topology Accessor Object.
1057
+
1058
+ \return 1 on success; -1 on failure (will raise an exception).
1059
+
1060
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_ModEdgeHeal
1061
+ */
1062
+ GAIATOPO_DECLARE int gaiaTopoGeo_NewEdgeHeal (GaiaTopologyAccessorPtr ptr);
1063
+
1064
+ /**
1065
+ Removes all useless Nodes from a Topology by calling ST_ModEdgeHeal
1066
+
1067
+ \param ptr pointer to the Topology Accessor Object.
1068
+
1069
+ \return 1 on success; -1 on failure (will raise an exception).
1070
+
1071
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_NewEdgeHeal
1072
+ */
1073
+ GAIATOPO_DECLARE int gaiaTopoGeo_ModEdgeHeal (GaiaTopologyAccessorPtr ptr);
1074
+
1075
+ /**
1076
+ Removes all useless Nodes from a Topology by calling ST_NewEdgeHeal
1077
+
1078
+ \param ptr pointer to the Topology Accessor Object.
1079
+ \param line_max_points if set to a positive number all input Edges
1080
+ will be split into simpler Edges having no more than this maximum
1081
+ number of points.
1082
+ \param max_length if set to a positive value all input Edges will
1083
+ be split into simpler Edges having a length not exceeding this
1084
+ threshold. If both line_max_points and max_legth are set as the
1085
+ same time the first condition occurring will cause an Edge to be split
1086
+ in two halves.
1087
+
1088
+ \return 1 on success; -1 on failure (will raise an exception).
1089
+
1090
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_ModEdgeHeal
1091
+ */
1092
+ GAIATOPO_DECLARE int gaiaTopoGeo_NewEdgesSplit (GaiaTopologyAccessorPtr ptr,
1093
+ int line_max_points,
1094
+ double max_length);
1095
+
1096
+ /**
1097
+ Removes all useless Nodes from a Topology by calling ST_ModEdgeHeal
1098
+
1099
+ \param ptr pointer to the Topology Accessor Object.
1100
+ \param line_max_points if set to a positive number all input Edges
1101
+ will be split into simpler Edges having no more than this maximum
1102
+ number of points.
1103
+ \param max_length if set to a positive value all input Edges will
1104
+ be split into simpler Edges having a length not exceeding this
1105
+ threshold. If both line_max_points and max_legth are set as the
1106
+ same time the first condition occurring will cause an Edge to be split
1107
+ in two halves.
1108
+
1109
+ \return 1 on success; -1 on failure (will raise an exception).
1110
+
1111
+ \sa gaiaTopologyFromDBMS, gaiaTopoGeo_NewEdgeHeal
1112
+ */
1113
+ GAIATOPO_DECLARE int gaiaTopoGeo_ModEdgeSplit (GaiaTopologyAccessorPtr ptr,
1114
+ int line_max_points,
1115
+ double max_length);
1116
+
1117
+ /**
1118
+ creates a TopoLayer and its corresponding Feature relations for a given
1119
+ Topology by matching Topology Seeds to a given reference Table.
1120
+
1121
+ \param ptr pointer to the Topology Accessor Object.
1122
+ \param db-prefix prefix of the DB containing the reference GeoTable.
1123
+ If NULL the "main" DB will be intended by default.
1124
+ \param ref_table name of the reference GeoTable.
1125
+ \param ref_column name of the reference Geometry Column.
1126
+ Could be NULL is the reference table has just a single Geometry Column.
1127
+ \param topolayer_name name of the TopoLayer to be created.
1128
+
1129
+ \return 1 on success; -1 on failure (will raise an exception).
1130
+
1131
+ \sa gaiaTopologyFromDBMS
1132
+ */
1133
+ GAIATOPO_DECLARE int
1134
+ gaiaTopoGeo_CreateTopoLayer (GaiaTopologyAccessorPtr ptr,
1135
+ const char *db_prefix,
1136
+ const char *ref_table,
1137
+ const char *ref_column,
1138
+ const char *topolayer_name);
1139
+
1140
+ /**
1141
+ initializes a TopoLayer (laking all corresponding Feature relations) for a given
1142
+ Topology from a given reference Table.
1143
+
1144
+ \param ptr pointer to the Topology Accessor Object.
1145
+ \param db-prefix prefix of the DB containing the reference GeoTable.
1146
+ If NULL the "main" DB will be intended by default.
1147
+ \param ref_table name of the reference GeoTable.
1148
+ \param topolayer_name name of the TopoLayer to be created.
1149
+
1150
+ \return 1 on success; -1 on failure (will raise an exception).
1151
+
1152
+ \sa gaiaTopologyFromDBMS
1153
+ */
1154
+ GAIATOPO_DECLARE int
1155
+ gaiaTopoGeo_InitTopoLayer (GaiaTopologyAccessorPtr ptr,
1156
+ const char *db_prefix,
1157
+ const char *ref_table,
1158
+ const char *topolayer_name);
1159
+
1160
+ /**
1161
+ completely removes a TopoLayer from a Topology.
1162
+
1163
+ \param ptr pointer to the Topology Accessor Object.
1164
+ \param topolayer_name name of the TopoLayer to be removed.
1165
+
1166
+ \return 1 on success; -1 on failure (will raise an exception).
1167
+
1168
+ \sa gaiaTopologyFromDBMS
1169
+ */
1170
+ GAIATOPO_DECLARE int
1171
+ gaiaTopoGeo_RemoveTopoLayer (GaiaTopologyAccessorPtr ptr,
1172
+ const char *topolayer_name);
1173
+
1174
+ /**
1175
+ creates a GeoTable by exporting Features out from a given TopoLayer.
1176
+
1177
+ \param ptr pointer to the Topology Accessor Object.
1178
+ \param topolayer_name name of an existing TopoLayer.
1179
+ \param out_table name of the output GeoTable to be created.
1180
+ \param with_spatial_index boolean flag: if set to TRUE (non ZERO) a Spatial
1181
+ Index supporting the output table will be created.
1182
+ \param create_only boolean flag; is set to any value != 0 (TRUE)
1183
+ just the output table will be creayed but no TopoFeature will
1184
+ be actually inserted.
1185
+
1186
+ \return 1 on success; -1 on failure (will raise an exception).
1187
+
1188
+ \sa gaiaTopologyFromDBMS
1189
+ */
1190
+ GAIATOPO_DECLARE int
1191
+ gaiaTopoGeo_ExportTopoLayer (GaiaTopologyAccessorPtr ptr,
1192
+ const char *topolayer_name,
1193
+ const char *out_table,
1194
+ int with_spatial_index, int create_only);
1195
+
1196
+ /**
1197
+ inserts into the output GeoTable a single Features extracted out
1198
+ from a given TopoLayer.
1199
+
1200
+ \param ptr pointer to the Topology Accessor Object.
1201
+ \param topolayer_name name of an existing TopoLayer.
1202
+ \param out_table name of the target GeoTable.
1203
+ \param fid unique identifier of the TopoLayer's Feature to
1204
+ be inserted.
1205
+
1206
+ \return 1 on success; -1 on failure (will raise an exception).
1207
+
1208
+ \sa gaiaTopologyFromDBMS
1209
+ */
1210
+ GAIATOPO_DECLARE int
1211
+ gaiaTopoGeo_InsertFeatureFromTopoLayer (GaiaTopologyAccessorPtr ptr,
1212
+ const char *topolayer_name,
1213
+ const char *out_table,
1214
+ sqlite3_int64 fid);
1215
+
1216
+ #ifdef __cplusplus
1217
+ }
1218
+ #endif
1219
+
1220
+
1221
+ #endif /* _GAIATOPO_H */