@crossbind/port-spatialite-wasi 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 (45) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +11 -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/wasi-wasm32-st-release/crossbind-emccflags.fingerprint +1 -0
  9. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/control_points.h +259 -0
  10. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/debug.h +77 -0
  11. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaia_network.h +627 -0
  12. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaia_topology.h +1221 -0
  13. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiaaux.h +540 -0
  14. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiaconfig-msvc.h +56 -0
  15. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiaconfig-msvc.h.in +55 -0
  16. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiaconfig.h +68 -0
  17. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiaconfig.h.in +67 -0
  18. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiaexif.h +669 -0
  19. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiageo.h +77 -0
  20. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gaiamatrix.h +277 -0
  21. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/geojson.h +586 -0
  22. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/geopackage.h +198 -0
  23. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_advanced.h +5184 -0
  24. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_const.h +606 -0
  25. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_core.h +2294 -0
  26. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_dxf.h +993 -0
  27. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_dynamic.h +416 -0
  28. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_formats.h +2056 -0
  29. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_mbr.h +606 -0
  30. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_sequence.h +173 -0
  31. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_structs.h +880 -0
  32. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_wfs.h +581 -0
  33. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/gg_xml.h +818 -0
  34. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/spatialite_ext.h +64 -0
  35. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/sqlite.h +70 -0
  36. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite/stored_procedures.h +641 -0
  37. package/dist/prebuilt/wasi-wasm32-st-release/include/spatialite.h +2098 -0
  38. package/dist/prebuilt/wasi-wasm32-st-release/lib/libspatialite.a +0 -0
  39. package/dist/prebuilt/wasi-wasm32-st-release/lib/libspatialite.la +41 -0
  40. package/dist/prebuilt/wasi-wasm32-st-release/lib/mod_spatialite.a +0 -0
  41. package/dist/prebuilt/wasi-wasm32-st-release/lib/mod_spatialite.la +41 -0
  42. package/dist/prebuilt/wasi-wasm32-st-release/lib/pkgconfig/spatialite.pc +12 -0
  43. package/e2e/main.c +38 -0
  44. package/e2e/run.mjs +89 -0
  45. package/package.json +40 -0
@@ -0,0 +1,2098 @@
1
+ /*
2
+ spatialite.h -- Gaia spatial support for SQLite
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) 2008-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
+ \file spatialite.h
47
+
48
+ Main SpatiaLite header file
49
+ */
50
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
51
+ #ifdef _WIN32
52
+ #ifdef DLL_EXPORT
53
+ #define SPATIALITE_DECLARE __declspec(dllexport)
54
+ #else
55
+ #define SPATIALITE_DECLARE extern
56
+ #endif
57
+ #else
58
+ #define SPATIALITE_DECLARE __attribute__ ((visibility("default")))
59
+ #endif
60
+ #endif
61
+
62
+ #ifndef _SPATIALITE_H
63
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
64
+ #define _SPATIALITE_H
65
+ #endif
66
+
67
+ #define SPLITE_AXIS_1 0x51
68
+ #define SPLITE_AXIS_2 0x52
69
+ #define SPLITE_AXIS_NAME 0x3e
70
+ #define SPLITE_AXIS_ORIENTATION 0x3f
71
+
72
+ #ifdef __cplusplus
73
+ extern "C"
74
+ {
75
+ #endif
76
+
77
+ #include <spatialite/gaiageo.h>
78
+
79
+ #ifdef LOADABLE_EXTENSION
80
+ SPATIALITE_DECLARE int
81
+ sqlite3_spatialite_init (sqlite3 * db, char **pzErrMsg,
82
+ const sqlite3_api_routines * pApi);
83
+ #endif
84
+
85
+ /**
86
+ Initializes the library
87
+
88
+ \note you are always expected to explicitly call this function
89
+ before attempting to call any SpatiaLite own function.
90
+ */
91
+ SPATIALITE_DECLARE void spatialite_initialize (void);
92
+
93
+ /**
94
+ Finalizes the library
95
+
96
+ \note you are always expected to explicitly call this function
97
+ immediately before exiting the main application.\n
98
+ This function will free any memory allocation and will release
99
+ any system resource internally used by the library.\n
100
+ */
101
+ SPATIALITE_DECLARE void spatialite_shutdown (void);
102
+
103
+ /**
104
+ Return the current library version.
105
+
106
+ \return the version string.
107
+ */
108
+ SPATIALITE_DECLARE const char *spatialite_version (void);
109
+
110
+ /**
111
+ Return the target CPU name.
112
+
113
+ \return the target CPU string.
114
+ */
115
+ SPATIALITE_DECLARE const char *spatialite_target_cpu (void);
116
+
117
+ /**
118
+ Initializes the internal memory block supporting each connection
119
+
120
+ \sa spatialite_init_ex, spatialite_cleanup_ex
121
+
122
+ */
123
+ SPATIALITE_DECLARE void *spatialite_alloc_connection (void);
124
+
125
+ /**
126
+ Disables reporting GEOS/RTTOPO error and warnings on stderr
127
+
128
+ \param ptr a memory pointer returned by spatialite_alloc_connection()
129
+
130
+ \sa spatialite_init_ex, spatialite_cleanup_ex,
131
+ spatialite_set_verbose_mode
132
+
133
+ */
134
+ SPATIALITE_DECLARE void spatialite_set_silent_mode (const void *ptr);
135
+
136
+ /**
137
+ Enables reporting GEOS/RTTOPO error and warnings on stderr
138
+
139
+ \param ptr a memory pointer returned by spatialite_alloc_connection()
140
+
141
+ \sa spatialite_init_ex, spatialite_cleanup_ex,
142
+ spatialite_set_silent_mode
143
+
144
+ */
145
+ SPATIALITE_DECLARE void spatialite_set_verbode_mode (const void *ptr);
146
+
147
+ /**
148
+ Initializes a SpatiaLite connection.
149
+
150
+ This function is now \b DEPRECATED because is not reentrant (not thread safe);
151
+ use spatialite_init_ex() for all new development.
152
+
153
+ \param verbose if TRUE a short start-up message is shown on stderr
154
+
155
+ \sa spatialite_cleanup, spatialite_init_ex
156
+
157
+ \note You absolutely must invoke this function before attempting to perform
158
+ any other SpatiaLite's call.
159
+
160
+ */
161
+ SPATIALITE_DECLARE void spatialite_init (int verbose);
162
+
163
+ /**
164
+ Initializes a SpatiaLite connection.
165
+
166
+ \param db_handle handle to the current SQLite connection
167
+ \param ptr a memory pointer returned by spatialite_alloc_connection()
168
+ \param verbose if TRUE a short start-up message is shown on stderr
169
+
170
+ \sa spatialite_alloc_connection, spatialite_cleanup_ex, spatialite_init
171
+
172
+ \note You absolutely must invoke this function before attempting to perform
173
+ any other SpatiaLite's call.
174
+
175
+ */
176
+ SPATIALITE_DECLARE void spatialite_init_ex (sqlite3 * db_handle,
177
+ const void *ptr, int verbose);
178
+
179
+ /**
180
+ Initializes the GEOS library.
181
+
182
+ \note You are never supposed to invoke this function (internally handled).
183
+
184
+ */
185
+ SPATIALITE_DECLARE void spatialite_init_geos (void);
186
+
187
+ /**
188
+ Cleanup a SpatiaLite connection
189
+
190
+ This function is now \b DEPRECATED; use spatialite_cleanup_ex() for all new development.
191
+
192
+ This function performs general cleanup, essentially undoing the effect
193
+ of spatialite_init().
194
+
195
+ \sa spatialite_init
196
+ */
197
+ SPATIALITE_DECLARE void spatialite_cleanup (void);
198
+
199
+ /**
200
+ Cleanup a SpatiaLite connection
201
+
202
+ This function performs general cleanup, essentially undoing the effect
203
+ of spatialite_init_ex().
204
+
205
+ \param ptr the same memory pointer passed to the corresponding call to
206
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
207
+
208
+ \sa spatialite_init_ex, spatialite_alloc_connection
209
+ */
210
+ SPATIALITE_DECLARE void spatialite_cleanup_ex (const void *ptr);
211
+
212
+ /**
213
+ Partially Cleaning-up a SpatiaLite connection
214
+
215
+ This function will destroy all TopoGeo and TopoNet objects from within a local cache.
216
+
217
+ \param ptr the same memory pointer passed to the corresponding call to
218
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
219
+
220
+ \sa spatialite_init_ex, spatialite_alloc_connection
221
+ */
222
+ SPATIALITE_DECLARE void spatialite_finalize_topologies (const void *ptr);
223
+
224
+ /**
225
+ Enables the BLOB-TinyPoint encoding
226
+
227
+ \param ptr the same memory pointer passed to the corresponding call to
228
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
229
+
230
+ \sa disable_tiny_point, is_tiny_point_enabled
231
+ */
232
+ SPATIALITE_DECLARE void enable_tiny_point (const void *ptr);
233
+
234
+ /**
235
+ Disables the BLOB-TinyPoint encoding
236
+
237
+ \param ptr the same memory pointer passed to the corresponding call to
238
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
239
+
240
+ \sa disable_tiny_point, is_tiny_point_enabled
241
+ */
242
+ SPATIALITE_DECLARE void disable_tiny_point (const void *ptr);
243
+
244
+ /**
245
+ Checks if the BLOB-TinyPoint encoding is enabled or not
246
+
247
+ \param ptr the same memory pointer passed to the corresponding call to
248
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
249
+
250
+ \return 0 (FALSE) if not enabled, any other value (TRUE) if enabled
251
+
252
+ \sa enable_tiny_point, disable_tiny_point
253
+ */
254
+ SPATIALITE_DECLARE int is_tiny_point_enabled (const void *ptr);
255
+
256
+ /**
257
+ Dumps a full geometry-table into an external Shapefile
258
+
259
+ \param sqlite handle to current DB connection
260
+ \param table the name of the table to be exported
261
+ \param column the name of the geometry column
262
+ \param shp_path pathname of the Shapefile to be exported (no suffix)
263
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
264
+ \param geom_type "POINT", "LINESTRING", "POLYGON", "MULTIPOINT" or NULL
265
+ \param verbose if TRUE a short report is shown on stderr
266
+ \param rows on completion will contain the total number of exported rows
267
+ \param err_msg on completion will contain an error message (if any)
268
+
269
+ \sa dump_shapefile_ex
270
+
271
+ \return 0 on failure, any other value on success
272
+ */
273
+ SPATIALITE_DECLARE int dump_shapefile (sqlite3 * sqlite, char *table,
274
+ char *column, char *shp_path,
275
+ char *charset, char *geom_type,
276
+ int verbose, int *rows,
277
+ char *err_msg);
278
+
279
+ /**
280
+ Dumps a full geometry-table into an external Shapefile
281
+
282
+ \param sqlite handle to current DB connection
283
+ \param table the name of the table to be exported
284
+ \param column the name of the geometry column
285
+ \param shp_path pathname of the Shapefile to be exported (no suffix)
286
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
287
+ \param geom_type "POINT", "LINESTRING", "POLYGON", "MULTIPOINT" or NULL
288
+ \param verbose if TRUE a short report is shown on stderr
289
+ \param rows on completion will contain the total number of exported rows
290
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
291
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
292
+ \param err_msg on completion will contain an error message (if any)
293
+
294
+ \sa dump_shapefile
295
+
296
+ \return 0 on failure, any other value on success
297
+ */
298
+ SPATIALITE_DECLARE int dump_shapefile_ex (sqlite3 * sqlite, char *table,
299
+ char *column, char *shp_path,
300
+ char *charset, char *geom_type,
301
+ int verbose, int *rows,
302
+ int colcase_name, char *err_msg);
303
+
304
+ /**
305
+ Dumps a full geometry-table into an external Shapefile
306
+
307
+ \param sqlite handle to current DB connection
308
+ \param proj_ctx pointer to the current PROJ.6 context (may be NULL)
309
+ \param table the name of the table to be exported
310
+ \param column the name of the geometry column
311
+ \param shp_path pathname of the Shapefile to be exported (no suffix)
312
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
313
+ \param geom_type "POINT", "LINESTRING", "POLYGON", "MULTIPOINT" or NULL
314
+ \param verbose if TRUE a short report is shown on stderr
315
+ \param rows on completion will contain the total number of exported rows
316
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
317
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
318
+ \param err_msg on completion will contain an error message (if any)
319
+
320
+ \sa dump_shapefile
321
+
322
+ \return 0 on failure, any other value on success
323
+ */
324
+ SPATIALITE_DECLARE int dump_shapefile_ex2 (sqlite3 * sqlite, void *proj_ctx,
325
+ char *table, char *column,
326
+ char *shp_path, char *charset,
327
+ char *geom_type, int verbose,
328
+ int *rows, int colcase_name,
329
+ char *err_msg);
330
+
331
+ /**
332
+ Loads an external Shapefile into a newly created table
333
+
334
+ \param sqlite handle to current DB connection
335
+ \param shp_path pathname of the Shapefile to be imported (no suffix)
336
+ \param table the name of the table to be created
337
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
338
+ \param srid the SRID to be set for Geometries
339
+ \param column the name of the geometry column
340
+ \param coerce2d if TRUE any Geometry will be casted to 2D [XY]
341
+ \param compressed if TRUE compressed Geometries will be created
342
+ \param verbose if TRUE a short report is shown on stderr
343
+ \param spatial_index if TRUE an R*Tree Spatial Index will be created
344
+ \param rows on completion will contain the total number of imported rows
345
+ \param err_msg on completion will contain an error message (if any)
346
+
347
+ \return 0 on failure, any other value on success
348
+
349
+ \sa load_shapefile_ex, load_shapefile_ex2, load_shapefile_ex3
350
+
351
+ \note this function simply calls load_shapefile_ex by passing
352
+ implicit gype="AUTO" and pk_column=NULL arguments
353
+ */
354
+ SPATIALITE_DECLARE int load_shapefile (sqlite3 * sqlite, char *shp_path,
355
+ char *table, char *charset, int srid,
356
+ char *column, int coerce2d,
357
+ int compressed, int verbose,
358
+ int spatial_index, int *rows,
359
+ char *err_msg);
360
+
361
+ /**
362
+ Loads an external Shapefile into a newly created table
363
+
364
+ \param sqlite handle to current DB connection
365
+ \param shp_path pathname of the Shapefile to be imported (no suffix)
366
+ \param table the name of the table to be created
367
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
368
+ \param srid the SRID to be set for Geometries
369
+ \param geo_column the name of the geometry column
370
+ \param gtype expected to be one of: "LINESTRING", "LINESTRINGZ",
371
+ "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ",
372
+ "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM",
373
+ "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM",
374
+ "MULTIPOLYGONZM" or "AUTO".
375
+ \param pk_column name of the Primary Key column; if NULL or mismatching
376
+ then "PK_UID" will be assumed by default.
377
+ \param coerce2d if TRUE any Geometry will be casted to 2D [XY]
378
+ \param compressed if TRUE compressed Geometries will be created
379
+ \param verbose if TRUE a short report is shown on stderr
380
+ \param spatial_index if TRUE an R*Tree Spatial Index will be created
381
+ \param rows on completion will contain the total number of imported rows
382
+ \param err_msg on completion will contain an error message (if any)
383
+
384
+ \return 0 on failure, any other value on success
385
+
386
+ \sa load_shapefile, load_shapefile_ex2, load_shapefile_ex3
387
+
388
+ \note the Shapefile format doesn't supports any distinction between
389
+ LINESTRINGs and MULTILINESTRINGs, or between POLYGONs and MULTIPOLYGONs;
390
+ as does not allows to clearly distinguish if the M-measure is required.
391
+ \n So a first preliminary scan of the Shapefile is required in order to
392
+ correctly identify the actual payload (gtype = "AUTO", default case).
393
+ \n By explicitly specifying some expected geometry type this first scan
394
+ will be skipped at all thus introducing a noticeable performance gain.
395
+ \n Anyway, declaring a mismatching geometry type will surely cause a failure.
396
+ */
397
+ SPATIALITE_DECLARE int load_shapefile_ex (sqlite3 * sqlite, char *shp_path,
398
+ char *table, char *charset,
399
+ int srid, char *geo_column,
400
+ char *gtype, char *pk_column,
401
+ int coerce2d, int compressed,
402
+ int verbose, int spatial_index,
403
+ int *rows, char *err_msg);
404
+
405
+ /**
406
+ Loads an external Shapefile into a newly created table
407
+
408
+ \param sqlite handle to current DB connection
409
+ \param shp_path pathname of the Shapefile to be imported (no suffix)
410
+ \param table the name of the table to be created
411
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
412
+ \param srid the SRID to be set for Geometries
413
+ \param geo_column the name of the geometry column
414
+ \param gtype expected to be one of: "LINESTRING", "LINESTRINGZ",
415
+ "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ",
416
+ "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM",
417
+ "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM",
418
+ "MULTIPOLYGONZM" or "AUTO".
419
+ \param pk_column name of the Primary Key column; if NULL or mismatching
420
+ then "PK_UID" will be assumed by default.
421
+ \param coerce2d if TRUE any Geometry will be casted to 2D [XY]
422
+ \param compressed if TRUE compressed Geometries will be created
423
+ \param verbose if TRUE a short report is shown on stderr
424
+ \param spatial_index if TRUE an R*Tree Spatial Index will be created
425
+ \param text_dates is TRUE all DBF dates will be considered as TEXT
426
+ \param rows on completion will contain the total number of imported rows
427
+ \param err_msg on completion will contain an error message (if any)
428
+
429
+ \return 0 on failure, any other value on success
430
+
431
+ \sa load_shapefile, load_shapefile_ex, load_shapefile_ex3
432
+
433
+ \note the Shapefile format doesn't supports any distinction between
434
+ LINESTRINGs and MULTILINESTRINGs, or between POLYGONs and MULTIPOLYGONs;
435
+ as does not allows to clearly distinguish if the M-measure is required.
436
+ \n So a first preliminary scan of the Shapefile is required in order to
437
+ correctly identify the actual payload (gtype = "AUTO", default case).
438
+ \n By explicitly specifying some expected geometry type this first scan
439
+ will be skipped at all thus introducing a noticeable performance gain.
440
+ \n Anyway, declaring a mismatching geometry type will surely cause a failure.
441
+ */
442
+ SPATIALITE_DECLARE int load_shapefile_ex2 (sqlite3 * sqlite, char *shp_path,
443
+ char *table, char *charset,
444
+ int srid, char *geo_column,
445
+ char *gtype, char *pk_column,
446
+ int coerce2d, int compressed,
447
+ int verbose, int spatial_index,
448
+ int text_date, int *rows,
449
+ char *err_msg);
450
+
451
+ /**
452
+ Loads an external Shapefile into a newly created table
453
+
454
+ \param sqlite handle to current DB connection
455
+ \param shp_path pathname of the Shapefile to be imported (no suffix)
456
+ \param table the name of the table to be created
457
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
458
+ \param srid the SRID to be set for Geometries
459
+ \param geo_column the name of the geometry column
460
+ \param gtype expected to be one of: "LINESTRING", "LINESTRINGZ",
461
+ "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ",
462
+ "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM",
463
+ "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM",
464
+ "MULTIPOLYGONZM" or "AUTO".
465
+ \param pk_column name of the Primary Key column; if NULL or mismatching
466
+ then "PK_UID" will be assumed by default.
467
+ \param coerce2d if TRUE any Geometry will be casted to 2D [XY]
468
+ \param compressed if TRUE compressed Geometries will be created
469
+ \param verbose if TRUE a short report is shown on stderr
470
+ \param spatial_index if TRUE an R*Tree Spatial Index will be created
471
+ \param text_dates is TRUE all DBF dates will be considered as TEXT
472
+ \param rows on completion will contain the total number of imported rows
473
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
474
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
475
+ \param err_msg on completion will contain an error message (if any)
476
+
477
+ \return 0 on failure, any other value on success
478
+
479
+ \sa load_shapefile, load_shapefile_ex, load_shapefile_ex2, load_zip_shapefile
480
+
481
+ \note the Shapefile format doesn't supports any distinction between
482
+ LINESTRINGs and MULTILINESTRINGs, or between POLYGONs and MULTIPOLYGONs;
483
+ as does not allows to clearly distinguish if the M-measure is required.
484
+ \n So a first preliminary scan of the Shapefile is required in order to
485
+ correctly identify the actual payload (gtype = "AUTO", default case).
486
+ \n By explicitly specifying some expected geometry type this first scan
487
+ will be skipped at all thus introducing a noticeable performance gain.
488
+ \n Anyway, declaring a mismatching geometry type will surely cause a failure.
489
+ */
490
+ SPATIALITE_DECLARE int load_shapefile_ex3 (sqlite3 * sqlite,
491
+ const char *shp_path,
492
+ const char *table,
493
+ const char *charset, int srid,
494
+ const char *geo_column,
495
+ const char *gtype,
496
+ const char *pk_column,
497
+ int coerce2d, int compressed,
498
+ int verbose, int spatial_index,
499
+ int text_date, int *rows,
500
+ int colname_case, char *err_msg);
501
+
502
+ /**
503
+ Loads an external Shapefile (from Zipfile) into a newly created table
504
+
505
+ \param sqlite handle to current DB connection
506
+ \param zip_path pathname of the Zipfile
507
+ \param shp_path pseudo-pathname of the Shapefile to be imported (no suffix)
508
+ \param table the name of the table to be created
509
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
510
+ \param srid the SRID to be set for Geometries
511
+ \param geo_column the name of the geometry column
512
+ \param gtype expected to be one of: "LINESTRING", "LINESTRINGZ",
513
+ "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ",
514
+ "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM",
515
+ "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM",
516
+ "MULTIPOLYGONZM" or "AUTO".
517
+ \param pk_column name of the Primary Key column; if NULL or mismatching
518
+ then "PK_UID" will be assumed by default.
519
+ \param coerce2d if TRUE any Geometry will be casted to 2D [XY]
520
+ \param compressed if TRUE compressed Geometries will be created
521
+ \param verbose if TRUE a short report is shown on stderr
522
+ \param spatial_index if TRUE an R*Tree Spatial Index will be created
523
+ \param text_dates is TRUE all DBF dates will be considered as TEXT
524
+ \param rows on completion will contain the total number of imported rows
525
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
526
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
527
+ \param err_msg on completion will contain an error message (if any)
528
+
529
+ \return 0 on failure, any other value on success
530
+
531
+ \sa load_shapefile_ex3
532
+
533
+ \note the Shapefile format doesn't supports any distinction between
534
+ LINESTRINGs and MULTILINESTRINGs, or between POLYGONs and MULTIPOLYGONs;
535
+ as does not allows to clearly distinguish if the M-measure is required.
536
+ \n So a first preliminary scan of the Shapefile is required in order to
537
+ correctly identify the actual payload (gtype = "AUTO", default case).
538
+ \n By explicitly specifying some expected geometry type this first scan
539
+ will be skipped at all thus introducing a noticeable performance gain.
540
+ \n Anyway, declaring a mismatching geometry type will surely cause a failure.
541
+ */
542
+ SPATIALITE_DECLARE int load_zip_shapefile (sqlite3 * sqlite,
543
+ const char *zip_path,
544
+ const char *shp_path,
545
+ const char *table,
546
+ const char *charset, int srid,
547
+ const char *geo_column,
548
+ const char *gtype,
549
+ const char *pk_column,
550
+ int coerce2d, int compressed,
551
+ int verbose, int spatial_index,
552
+ int text_date, int *rows,
553
+ int colname_case, char *err_msg);
554
+
555
+ /**
556
+ Loads an external DBF file into a newly created table
557
+
558
+ \param sqlite handle to current DB connection
559
+ \param dbf_path pathname of the DBF file to be imported
560
+ \param table the name of the table to be created
561
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
562
+ \param verbose if TRUE a short report is shown on stderr
563
+ \param rows on completion will contain the total number of actually exported rows
564
+ \param err_msg on completion will contain an error message (if any)
565
+
566
+ \sa load_dbf_ex, load_dbf_ex2, load_dbf_ex3
567
+
568
+ \note this function simply calls load_dbf_ex by passing an
569
+ implicit pk_column=NULL argument
570
+
571
+ \return 0 on failure, any other value on success
572
+ */
573
+ SPATIALITE_DECLARE int load_dbf (sqlite3 * sqlite, char *dbf_path,
574
+ char *table, char *charset, int verbose,
575
+ int *rows, char *err_msg);
576
+
577
+ /**
578
+ Loads an external DBF file into a newly created table
579
+
580
+ \param sqlite handle to current DB connection
581
+ \param dbf_path pathname of the DBF file to be imported
582
+ \param table the name of the table to be created
583
+ \param pk_column name of the Primary Key column; if NULL or mismatching
584
+ then "PK_UID" will be assumed by default.
585
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
586
+ \param verbose if TRUE a short report is shown on stderr
587
+ \param rows on completion will contain the total number of actually exported rows
588
+ \param err_msg on completion will contain an error message (if any)
589
+
590
+ \sa load_dbf, load_dbf_ex2, load_dbf_ex3
591
+
592
+ \return 0 on failure, any other value on success
593
+ */
594
+ SPATIALITE_DECLARE int load_dbf_ex (sqlite3 * sqlite, char *dbf_path,
595
+ char *table, char *pk_column,
596
+ char *charset, int verbose, int *rows,
597
+ char *err_msg);
598
+
599
+ /**
600
+ Loads an external DBF file into a newly created table
601
+
602
+ \param sqlite handle to current DB connection
603
+ \param dbf_path pathname of the DBF file to be imported
604
+ \param table the name of the table to be created
605
+ \param pk_column name of the Primary Key column; if NULL or mismatching
606
+ then "PK_UID" will be assumed by default.
607
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
608
+ \param verbose if TRUE a short report is shown on stderr
609
+ \param text_dates is TRUE all DBF dates will be considered as TEXT
610
+ \param rows on completion will contain the total number of imported rows
611
+ \param err_msg on completion will contain an error message (if any)
612
+
613
+ \sa load_dbf, load_dbf_ex, load_dbf_ex3
614
+
615
+ \return 0 on failure, any other value on success
616
+ */
617
+ SPATIALITE_DECLARE int load_dbf_ex2 (sqlite3 * sqlite, char *dbf_path,
618
+ char *table, char *pk_column,
619
+ char *charset, int verbose,
620
+ int text_date, int *rows,
621
+ char *err_msg);
622
+
623
+ /**
624
+ Loads an external DBF file into a newly created table
625
+
626
+ \param sqlite handle to current DB connection
627
+ \param dbf_path pathname of the DBF file to be imported
628
+ \param table the name of the table to be created
629
+ \param pk_column name of the Primary Key column; if NULL or mismatching
630
+ then "PK_UID" will be assumed by default.
631
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
632
+ \param verbose if TRUE a short report is shown on stderr
633
+ \param text_dates is TRUE all DBF dates will be considered as TEXT
634
+ \param rows on completion will contain the total number of imported rows
635
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
636
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
637
+ \param err_msg on completion will contain an error message (if any)
638
+
639
+ \sa load_dbf, load_dbf_ex, load_dbf_ex2, load_zip_dbf
640
+
641
+ \return 0 on failure, any other value on success
642
+ */
643
+ SPATIALITE_DECLARE int load_dbf_ex3 (sqlite3 * sqlite, const char *dbf_path,
644
+ const char *table,
645
+ const char *pk_column,
646
+ const char *charset, int verbose,
647
+ int text_date, int *rows,
648
+ int colname_case, char *err_msg);
649
+
650
+ /**
651
+ Loads an external DBF file (from Zipfile) into a newly created table
652
+
653
+ \param sqlite handle to current DB connection
654
+ \param zip_path pathname of the Zipfile
655
+ \param shp_path pseudo-pathname of the Shapefile to be imported (no suffix)
656
+
657
+ \param sqlite handle to current DB connection
658
+ \param zip_path pathname of the Zipfile
659
+ \param filenamepseudo-pathname of the DBF file to be imported (including the '.dbf' suffix)
660
+ \param table the name of the table to be created
661
+ \param pk_column name of the Primary Key column; if NULL or mismatching
662
+ then "PK_UID" will be assumed by default.
663
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
664
+ \param verbose if TRUE a short report is shown on stderr
665
+ \param text_dates is TRUE all DBF dates will be considered as TEXT
666
+ \param rows on completion will contain the total number of imported rows
667
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
668
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
669
+ \param err_msg on completion will contain an error message (if any)
670
+
671
+ \sa load_dbf_ex3
672
+
673
+ \return 0 on failure, any other value on success
674
+ */
675
+ SPATIALITE_DECLARE int load_zip_dbf (sqlite3 * sqlite, const char *zip_file,
676
+ const char *dbf_path,
677
+ const char *table,
678
+ const char *pk_column,
679
+ const char *charset, int verbose,
680
+ int text_date, int *rows,
681
+ int colname_case, char *err_msg);
682
+
683
+ /**
684
+ Dumps a full table into an external DBF file
685
+
686
+ \param sqlite handle to current DB connection
687
+ \param table the name of the table to be exported
688
+ \param dbf_path pathname of the DBF to be exported
689
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
690
+ \param err_msg on completion will contain an error message (if any)
691
+
692
+ \sa dump_dbf_ex, dump_dbf_ex2
693
+
694
+ \return 0 on failure, any other value on success
695
+ */
696
+ SPATIALITE_DECLARE int dump_dbf (sqlite3 * sqlite, char *table,
697
+ char *dbf_path, char *charset,
698
+ char *err_msg);
699
+
700
+ /**
701
+ Dumps a full table into an external DBF file
702
+
703
+ \param sqlite handle to current DB connection
704
+ \param table the name of the table to be exported
705
+ \param dbf_path pathname of the DBF to be exported
706
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
707
+ \param rows on completion will contain the total number of exported rows
708
+ \param err_msg on completion will contain an error message (if any)
709
+
710
+ \sa dump_dbf, dump_dbf_ex2
711
+
712
+ \return 0 on failure, any other value on success
713
+ */
714
+ SPATIALITE_DECLARE int dump_dbf_ex (sqlite3 * sqlite, char *table,
715
+ char *dbf_path, char *charset,
716
+ int *rows, char *err_msg);
717
+
718
+ /**
719
+ Dumps a full table into an external DBF file
720
+
721
+ \param sqlite handle to current DB connection
722
+ \param table the name of the table to be exported
723
+ \param dbf_path pathname of the DBF to be exported
724
+ \param charset a valid GNU ICONV charset to be used for DBF text strings
725
+ \param rows on completion will contain the total number of exported rows
726
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
727
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
728
+ \param err_msg on completion will contain an error message (if any)
729
+
730
+ \sa dump_dbf, dump_dbf_ex
731
+
732
+ \return 0 on failure, any other value on success
733
+ */
734
+ SPATIALITE_DECLARE int dump_dbf_ex2 (sqlite3 * sqlite, char *table,
735
+ char *dbf_path, char *charset,
736
+ int *rows, int colname_case,
737
+ char *err_msg);
738
+
739
+ /**
740
+ Loads an external spreadsheet (.xls) file into a newly created table
741
+
742
+ \param sqlite handle to current DB connection
743
+ \param path pathname of the spreadsheet file to be imported
744
+ \param table the name of the table to be created
745
+ \param worksheetIndex the index identifying the worksheet to be imported
746
+ \param first_titles if TRUE the first line is assumed to contain column names
747
+ \param rows on completion will contain the total number of actually exported rows
748
+ \param err_msg on completion will contain an error message (if any)
749
+
750
+ \return 0 on failure, any other value on success
751
+ */
752
+ SPATIALITE_DECLARE int load_XL (sqlite3 * sqlite, const char *path,
753
+ const char *table,
754
+ unsigned int worksheetIndex,
755
+ int first_titles, unsigned int *rows,
756
+ char *err_msg);
757
+
758
+ /**
759
+ A portable replacement for C99 round()
760
+
761
+ \param value a double value
762
+
763
+ \return the nearest integeral value
764
+ */
765
+ SPATIALITE_DECLARE double math_round (double value);
766
+
767
+ /**
768
+ A portable replacement for C99 llabs()
769
+
770
+ \param value a 64 bit integer value
771
+
772
+ \return the corresponding absolute value
773
+ */
774
+ SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value);
775
+
776
+ /**
777
+ Inserts the inlined EPSG dataset into the "spatial_ref_sys" table
778
+
779
+ \param sqlite handle to current DB connection
780
+ \param verbose if TRUE a short report is shown on stderr
781
+
782
+ \return 0 on failure, any other value on success
783
+
784
+ \sa spatial_ref_sys_init2
785
+
786
+ \note this function is internally invoked by the SQL function
787
+ InitSpatialMetadata(), and is not usually intended for direct use.
788
+ This functions is now deprecated, and will simply call
789
+ spatial_ref_sys_init2(sqlite, GAIA_EPSG_ANY, verbose).
790
+ */
791
+ SPATIALITE_DECLARE int spatial_ref_sys_init (sqlite3 * sqlite, int verbose);
792
+
793
+ /**
794
+ Inserts the inlined EPSG dataset into the "spatial_ref_sys" table
795
+
796
+ \param sqlite handle to current DB connection
797
+ \param mode can be one of GAIA_EPSG_ANY, GAIA_EPSG_NONE or GAIA_EPSG_WGS84_ONLY
798
+ \param verbose if TRUE a short report is shown on stderr
799
+
800
+ \return 0 on failure, any other value on success
801
+
802
+ \note this function is internally invoked by the SQL function
803
+ InitSpatialMetadata(), and is not usually intended for direct use.
804
+ */
805
+ SPATIALITE_DECLARE int spatial_ref_sys_init2 (sqlite3 * sqlite, int mode,
806
+ int verbose);
807
+
808
+ /**
809
+ Inserts some inlined EPSG definition into the "spatial_ref_sys" table
810
+
811
+ \param sqlite handle to current DB connection
812
+ \param srid the SRID value uniquely identifying the required EPSG definition
813
+
814
+ \return 0 on failure, any other value on success
815
+ */
816
+ SPATIALITE_DECLARE int insert_epsg_srid (sqlite3 * sqlite, int srid);
817
+
818
+ /**
819
+ checks a SRID definition from the "spatial_ref_sys" table
820
+ determining if it is of the geographic type
821
+
822
+ \param sqlite handle to current DB connection
823
+ \param srid the SRID value uniquely identifying the required EPSG definition
824
+ \param geographic on successful completion will contain TRUE or FALSE
825
+
826
+ \return 0 on failure, any other value on success
827
+ */
828
+ SPATIALITE_DECLARE int srid_is_geographic (sqlite3 * sqlite, int srid,
829
+ int *geographic);
830
+
831
+ /**
832
+ checks a SRID definition from the "spatial_ref_sys" table
833
+ determining if it is of the projected type
834
+
835
+ \param sqlite handle to current DB connection
836
+ \param srid the SRID value uniquely identifying the required EPSG definition
837
+ \param projected on successful completion will contain TRUE or FALSE
838
+
839
+ \return 0 on failure, any other value on success
840
+ */
841
+ SPATIALITE_DECLARE int srid_is_projected (sqlite3 * sqlite, int srid,
842
+ int *projected);
843
+
844
+ /**
845
+ checks a SRID definition from the "spatial_ref_sys" table
846
+ determining if the axes order is X-Y or Y-X
847
+
848
+ \param sqlite handle to current DB connection
849
+ \param srid the SRID value uniquely identifying the required EPSG definition
850
+ \param flipped on successful completion will contain 0 (FALSE) if axes order
851
+ is X-Y, any other value (TRUE) if axes order is Y-X.
852
+
853
+ \return 0 on failure, any other value on success
854
+ */
855
+ SPATIALITE_DECLARE int srid_has_flipped_axes (sqlite3 * sqlite, int srid,
856
+ int *flipped);
857
+
858
+ /**
859
+ checks a SRID definition from the "spatial_ref_sys" table
860
+ then returning the corresponding Spheroid name
861
+
862
+ \param sqlite handle to current DB connection
863
+ \param srid the SRID value uniquely identifying the required EPSG definition
864
+
865
+ \return the Spheroid name on succes, NULL on failure
866
+
867
+ \note you are responsible for freeing the returned name.
868
+ */
869
+ SPATIALITE_DECLARE char *srid_get_spheroid (sqlite3 * sqlite, int srid);
870
+
871
+ /**
872
+ checks a SRID definition from the "spatial_ref_sys" table
873
+ then returning the corresponding Prime Meridian name
874
+
875
+ \param sqlite handle to current DB connection
876
+ \param srid the SRID value uniquely identifying the required EPSG definition
877
+
878
+ \return the Prime Meridian name on succes, NULL on failure
879
+
880
+ \note you are responsible for freeing the returned name.
881
+ */
882
+ SPATIALITE_DECLARE char *srid_get_prime_meridian (sqlite3 * sqlite,
883
+ int srid);
884
+
885
+ /**
886
+ checks a SRID definition from the "spatial_ref_sys" table
887
+ then returning the corresponding Projection name
888
+
889
+ \param sqlite handle to current DB connection
890
+ \param srid the SRID value uniquely identifying the required EPSG definition
891
+
892
+ \return the Projection name on succes, NULL on failure
893
+
894
+ \note you are responsible for freeing the returned name.
895
+ */
896
+ SPATIALITE_DECLARE char *srid_get_projection (sqlite3 * sqlite, int srid);
897
+
898
+ /**
899
+ checks a SRID definition from the "spatial_ref_sys" table
900
+ then returning the corresponding Datum name
901
+
902
+ \param sqlite handle to current DB connection
903
+ \param srid the SRID value uniquely identifying the required EPSG definition
904
+
905
+ \return the Datum name on succes, NULL on failure
906
+
907
+ \note you are responsible for freeing the returned name.
908
+ */
909
+ SPATIALITE_DECLARE char *srid_get_datum (sqlite3 * sqlite, int srid);
910
+
911
+ /**
912
+ checks a SRID definition from the "spatial_ref_sys" table
913
+ then returning the corresponding Unit name
914
+
915
+ \param sqlite handle to current DB connection
916
+ \param srid the SRID value uniquely identifying the required EPSG definition
917
+
918
+ \return the Unit name on succes, NULL on failure
919
+
920
+ \note you are responsible for freeing the returned name.
921
+ */
922
+ SPATIALITE_DECLARE char *srid_get_unit (sqlite3 * sqlite, int srid);
923
+
924
+ /**
925
+ checks a SRID definition from the "spatial_ref_sys" table
926
+ then returning an Axis definition
927
+
928
+ \param sqlite handle to current DB connection
929
+ \param srid the SRID value uniquely identifying the required EPSG definition
930
+ \param axis should be one of SPLITE_AXIS_1 or SPLITE_AXIS_2
931
+ \param mode should be one of SPLITE_AXIS_NAME or SPLITE_AXIS_ORIENTATION
932
+
933
+ \return the reqested name on succes, NULL on failure
934
+
935
+ \note you are responsible for freeing the returned name.
936
+ */
937
+ SPATIALITE_DECLARE char *srid_get_axis (sqlite3 * sqlite, int srid,
938
+ char axis, char mode);
939
+
940
+ /**
941
+ Checks if a column is actually defined into the given table
942
+
943
+ \param sqlite handle to current DB connection
944
+ \param table the table to be checked
945
+ \param column the column to be checked
946
+
947
+ \return 0 on success, any other value on success
948
+
949
+ \note internally used to detect if some KML attribute defaults to a constant value
950
+ */
951
+ SPATIALITE_DECLARE int
952
+ is_kml_constant (sqlite3 * sqlite, char *table, char *column);
953
+
954
+ /**
955
+ Dumps a full geometry-table into an external KML file
956
+
957
+ \param sqlite handle to current DB connection
958
+ \param table the name of the table to be exported
959
+ \param geom_col the name of the geometry column
960
+ \param kml_path pathname of the KML file to be exported
961
+ \param name_col column to be used for KML "name" (may be null)
962
+ \param desc_col column to be used for KML "description" (may be null)
963
+ \param precision number of decimal digits for coordinates
964
+
965
+ \sa dump_kml_ex
966
+
967
+ \return 0 on failure, any other value on success
968
+ */
969
+ SPATIALITE_DECLARE int dump_kml (sqlite3 * sqlite, char *table,
970
+ char *geom_col, char *kml_path,
971
+ char *name_col, char *desc_col,
972
+ int precision);
973
+
974
+ /**
975
+ Dumps a full geometry-table into an external KML file
976
+
977
+ \param sqlite handle to current DB connection
978
+ \param table the name of the table to be exported
979
+ \param geom_col the name of the geometry column
980
+ \param kml_path pathname of the KML file to be exported
981
+ \param name_col column to be used for KML "name" (may be null)
982
+ \param desc_col column to be used for KML "description" (may be null)
983
+ \param precision number of decimal digits for coordinates
984
+ \param rows on completion will contain the total number of exported rows
985
+
986
+ \sa dump_kml
987
+
988
+ \return 0 on failure, any other value on success
989
+ */
990
+ SPATIALITE_DECLARE int dump_kml_ex (sqlite3 * sqlite, char *table,
991
+ char *geom_col, char *kml_path,
992
+ char *name_col, char *desc_col,
993
+ int precision, int *rows);
994
+
995
+ /**
996
+ Checks for duplicated rows into the same table
997
+
998
+ \param sqlite handle to current DB connection
999
+ \param table name of the table to be checked
1000
+ \param dupl_count on completion will contain the number of duplicated rows found
1001
+
1002
+ \sa remove_duplicated_rows
1003
+ \note two (or more) rows are assumed to be duplicated if any column
1004
+
1005
+ value (excluding any Primary Key column) is exacly the same
1006
+ */
1007
+ SPATIALITE_DECLARE void check_duplicated_rows (sqlite3 * sqlite,
1008
+ char *table,
1009
+ int *dupl_count);
1010
+
1011
+ /**
1012
+ Remove duplicated rows from a table
1013
+
1014
+ \param sqlite handle to current DB connection
1015
+ \param table name of the table to be cleaned
1016
+
1017
+ \sa check_duplicated_rows, remove_duplicated_rows_ex
1018
+
1019
+ \note when two (or more) duplicated rows exist, only the first occurrence
1020
+ will be preserved, then deleting any further occurrence.
1021
+ */
1022
+ SPATIALITE_DECLARE void remove_duplicated_rows (sqlite3 * sqlite,
1023
+ char *table);
1024
+
1025
+ /**
1026
+ Remove duplicated rows from a table
1027
+
1028
+ \param sqlite handle to current DB connection
1029
+ \param table name of the table to be cleaned
1030
+ \param removed on successful completion will contain the total
1031
+ count of removed duplicate rows
1032
+
1033
+ \sa check_duplicated_rows, remove_duplicated_rows_ex2
1034
+
1035
+ \note when two (or more) duplicated rows exist, only the first occurrence
1036
+ will be preserved, then deleting any further occurrence.
1037
+ */
1038
+ SPATIALITE_DECLARE void remove_duplicated_rows_ex (sqlite3 * sqlite,
1039
+ char *table,
1040
+ int *removed);
1041
+
1042
+ /**
1043
+ Remove duplicated rows from a table
1044
+
1045
+ \param sqlite handle to current DB connection
1046
+ \param table name of the table to be cleaned
1047
+ \param removed on successful completion will contain the total
1048
+ count of removed duplicate rows
1049
+ \param transaction boolena; if set to TRUE will internally handle
1050
+ a SQL Transaction
1051
+
1052
+ \sa check_duplicated_rows, remove_duplicated_rows
1053
+
1054
+ \note when two (or more) duplicated rows exist, only the first occurrence
1055
+ will be preserved, then deleting any further occurrence.
1056
+ */
1057
+ SPATIALITE_DECLARE void remove_duplicated_rows_ex2 (sqlite3 * sqlite,
1058
+ char *table,
1059
+ int *removed,
1060
+ int transaction);
1061
+
1062
+ /**
1063
+ Creates a derived table surely containing elementary Geometries
1064
+
1065
+ \param sqlite handle to current DB connection
1066
+ \param inTable name of the input table
1067
+ \param geometry name of the Geometry column
1068
+ \param outTable name of the output table to be created
1069
+ \param pKey name of the Primary Key column in the output table
1070
+ \param multiId name of the column identifying origins in the output table
1071
+
1072
+ \sa elementary_geometries_ex
1073
+
1074
+ \note if the input table contains some kind of complex Geometry
1075
+ (MULTIPOINT, MULTILINESTRING, MULTIPOLYGON or GEOMETRYCOLLECTION),
1076
+ then many rows are inserted into the output table: each single
1077
+ row will contain the same attributes and an elementaty Geometry.
1078
+ All the rows created by expanding the same input row will expose
1079
+ the same value in the "multiId" column.
1080
+ */
1081
+ SPATIALITE_DECLARE void elementary_geometries (sqlite3 * sqlite,
1082
+ char *inTable,
1083
+ char *geometry,
1084
+ char *outTable, char *pKey,
1085
+ char *multiId);
1086
+
1087
+ /**
1088
+ Creates a derived table surely containing elementary Geometries
1089
+
1090
+ \param sqlite handle to current DB connection
1091
+ \param inTable name of the input table
1092
+ \param geometry name of the Geometry column
1093
+ \param outTable name of the output table to be created
1094
+ \param pKey name of the Primary Key column in the output table
1095
+ \param multiId name of the column identifying origins in the output table
1096
+ \param rows on completion will contain the total number of inserted rows
1097
+
1098
+ \sa elementary_geometries_ex2
1099
+
1100
+ \note if the input table contains some kind of complex Geometry
1101
+ (MULTIPOINT, MULTILINESTRING, MULTIPOLYGON or GEOMETRYCOLLECTION),
1102
+ then many rows are inserted into the output table: each single
1103
+ row will contain the same attributes and an elementaty Geometry.
1104
+ All the rows created by expanding the same input row will expose
1105
+ the same value in the "multiId" column.
1106
+ */
1107
+ SPATIALITE_DECLARE void elementary_geometries_ex (sqlite3 * sqlite,
1108
+ char *inTable,
1109
+ char *geometry,
1110
+ char *outTable,
1111
+ char *pKey, char *multiId,
1112
+ int *rows);
1113
+
1114
+ /**
1115
+ Creates a derived table surely containing elementary Geometries
1116
+
1117
+ \param sqlite handle to current DB connection
1118
+ \param inTable name of the input table
1119
+ \param geometry name of the Geometry column
1120
+ \param outTable name of the output table to be created
1121
+ \param pKey name of the Primary Key column in the output table
1122
+ \param multiId name of the column identifying origins in the output table
1123
+ \param rows on completion will contain the total number of inserted rows
1124
+ \param transaction boolena; if set to TRUE will internally handle
1125
+ a SQL Transaction
1126
+
1127
+ \sa elementary_geometries_ex3
1128
+
1129
+ \note if the input table contains some kind of complex Geometry
1130
+ (MULTIPOINT, MULTILINESTRING, MULTIPOLYGON or GEOMETRYCOLLECTION),
1131
+ then many rows are inserted into the output table: each single
1132
+ row will contain the same attributes and an elementaty Geometry.
1133
+ All the rows created by expanding the same input row will expose
1134
+ the same value in the "multiId" column.
1135
+ */
1136
+ SPATIALITE_DECLARE void elementary_geometries_ex2 (sqlite3 * sqlite,
1137
+ char *inTable,
1138
+ char *geometry,
1139
+ char *outTable,
1140
+ char *pKey,
1141
+ char *multiId, int *rows,
1142
+ int transaction);
1143
+
1144
+ /**
1145
+ Creates a derived table surely containing elementary Geometries
1146
+
1147
+ \param sqlite handle to current DB connection
1148
+ \param inTable name of the input table
1149
+ \param geometry name of the Geometry column
1150
+ \param outTable name of the output table to be created
1151
+ \param pKey name of the Primary Key column in the output table
1152
+ \param multiId name of the column identifying origins in the output table
1153
+ \param options pointer to an Options list created by gaiaAuxClonerCreate()
1154
+ \param rows on completion will contain the total number of inserted rows
1155
+ \param transaction boolena; if set to TRUE will internally handle
1156
+ a SQL Transaction
1157
+
1158
+ \sa elementary_geometries
1159
+
1160
+ \note if the input table contains some kind of complex Geometry
1161
+ (MULTIPOINT, MULTILINESTRING, MULTIPOLYGON or GEOMETRYCOLLECTION),
1162
+ then many rows are inserted into the output table: each single
1163
+ row will contain the same attributes and an elementaty Geometry.
1164
+ All the rows created by expanding the same input row will expose
1165
+ the same value in the "multiId" column.
1166
+ */
1167
+ SPATIALITE_DECLARE void elementary_geometries_ex3 (sqlite3 * sqlite,
1168
+ char *inTable,
1169
+ char *geometry,
1170
+ char *outTable,
1171
+ char *pKey,
1172
+ char *multiId,
1173
+ const void *options,
1174
+ int *rows,
1175
+ int transaction);
1176
+
1177
+ /**
1178
+ Dumps a full geometry-table into an external GeoJSON file (old specification)
1179
+
1180
+ \param sqlite handle to current DB connection
1181
+ \param table the name of the table to be exported
1182
+ \param geom_col the name of the geometry column
1183
+ \param outfile_path pathname for the GeoJSON file to be written to
1184
+ \param precision number of decimal digits for coordinates
1185
+ \param option the format to use for output
1186
+
1187
+ \sa dump_geojson_ex, dump_geojson2
1188
+
1189
+ \note valid values for option are:
1190
+ - 0 no option
1191
+ - 1 GeoJSON MBR
1192
+ - 2 GeoJSON Short CRS (e.g EPSG:4326)
1193
+ - 3 MBR + Short CRS
1194
+ - 4 GeoJSON Long CRS (e.g urn:ogc:def:crs:EPSG::4326)
1195
+ - 5 MBR + Long CRS
1196
+
1197
+ \return 0 on failure, any other value on success
1198
+ */
1199
+ SPATIALITE_DECLARE int dump_geojson (sqlite3 * sqlite, char *table,
1200
+ char *geom_col, char *outfile_path,
1201
+ int precision, int option);
1202
+
1203
+ /**
1204
+ Dumps a full geometry-table into an external GeoJSON file (old specification)
1205
+
1206
+ \param sqlite handle to current DB connection
1207
+ \param table the name of the table to be exported
1208
+ \param geom_col the name of the geometry column
1209
+ \param outfile_path pathname for the GeoJSON file to be written to
1210
+ \param precision number of decimal digits for coordinates
1211
+ \param option the format to use for output
1212
+ \param rows on completion will contain the total number of exported rows
1213
+
1214
+ \sa dump_geojson, dump_geojson2
1215
+
1216
+ \note valid values for option are:
1217
+ - 0 no option
1218
+ - 1 GeoJSON MBR
1219
+ - 2 GeoJSON Short CRS (e.g EPSG:4326)
1220
+ - 3 MBR + Short CRS
1221
+ - 4 GeoJSON Long CRS (e.g urn:ogc:def:crs:EPSG::4326)
1222
+ - 5 MBR + Long CRS
1223
+
1224
+ \return 0 on failure, any other value on success
1225
+ */
1226
+ SPATIALITE_DECLARE int dump_geojson_ex (sqlite3 * sqlite, char *table,
1227
+ char *geom_col, char *outfile_path,
1228
+ int precision, int option,
1229
+ int *rows);
1230
+
1231
+ /**
1232
+ Dumps a full geometry-table into an external GeoJSON file (RFC 7946)
1233
+
1234
+ \param sqlite handle to current DB connection
1235
+ \param table the name of the table to be exported
1236
+ \param geom_col the name of the geometry column
1237
+ \param outfile_path pathname for the GeoJSON file to be written to
1238
+ \param precision number of decimal digits for coordinates
1239
+ \param lon_lat TRUE if all coordinates are expressed as WGS84 longitudes
1240
+ and latitudes (as required by RFC 7946); FALSE if they are in some
1241
+ other (undefined) CRS
1242
+ \param m_coords TRUE if M-values will be exported as ordinary coordinates;
1243
+ FALSE for strict RFC 7946 conformance (no M-Values at all)
1244
+ \param indent TRUE if the GeoJSON file will be properly indented for enhanced
1245
+ human readibility; FALSE if the GeoJSON file will be in a single monolithic
1246
+ line without blank spaces.
1247
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
1248
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
1249
+ \param rows on completion will contain the total number of exported rows
1250
+ \param error_message: will point to a diagnostic error message
1251
+ in case of failure, otherwise NULL
1252
+
1253
+ \sa dump_geojson, dump_geojson_ex
1254
+
1255
+ \return 0 on failure, any other value on success
1256
+
1257
+ \note you are expected to free before or later an eventual error
1258
+ message by calling sqlite3_free()
1259
+ */
1260
+ SPATIALITE_DECLARE int dump_geojson2 (sqlite3 * sqlite, char *table,
1261
+ char *geom_col, char *outfile_path,
1262
+ int precision, int lon_lat,
1263
+ int m_coords, int indented,
1264
+ int colname_case, int *rows,
1265
+ char **error_message);
1266
+
1267
+ /**
1268
+ Loads an external GeoJSON file into a newly created table
1269
+
1270
+ \param sqlite handle to current DB connection
1271
+ \param path pathname of the GeoJSON file to be imported
1272
+ \param table the name of the table to be created
1273
+ \param column the name of the geometry column. If NULL the column
1274
+ will be silently named "geometry".
1275
+ \param spatial_index if TRUE an R*Tree Spatial Index will be created
1276
+ \param srid when positive, the SRID value to be assigned to all Geometries.
1277
+ If 0 or negative SRID=4326 (lon-lat WGS84) will be always assumed accordingly
1278
+ to RFC 7946.
1279
+ \param colname_case one between GAIA_DBF_COLNAME_LOWERCASE,
1280
+ GAIA_DBF_COLNAME_UPPERCASE or GAIA_DBF_COLNAME_CASE_IGNORE.
1281
+ \param rows on completion will contain the total number of imported rows
1282
+ \param error_message: will point to a diagnostic error message
1283
+ in case of failure, otherwise NULL
1284
+
1285
+ \return 0 on failure, any other value on success
1286
+
1287
+ \note you are expected to free before or later an eventual error
1288
+ message by calling sqlite3_free()
1289
+ */
1290
+ SPATIALITE_DECLARE int load_geojson (sqlite3 * sqlite, char *path,
1291
+ char *table, char *column,
1292
+ int spatial_index, int srid,
1293
+ int colname_case, int *rows,
1294
+ char **error_message);
1295
+
1296
+ /**
1297
+ Updates the LAYER_STATICS metadata table
1298
+
1299
+ \param sqlite handle to current DB connection
1300
+ \param table name of the table to be processed
1301
+ \param column name of the geometry to be processed
1302
+
1303
+ \note this function will explore the given table/geometry determining
1304
+ the number of rows and the full layer extent; a corresponding table/geometry
1305
+ entry is expected to be already declared in the GEOMETRY_COLUMNS table.
1306
+ These informations will be permanently stored into the LAYER_STATISTICS
1307
+ table; if such table does not yet exists will be implicitly created.
1308
+ - if table is NULL, any entry found within GEOMETRY_COLUMNS
1309
+ will be processed.
1310
+ - if table is not NULL and column is NULL, any geometry
1311
+ belonging to the given table will be processed.
1312
+ - if both table and column are not NULL, then only the
1313
+ given entry will be processed.
1314
+
1315
+ \sa gaiaStatisticsInvalidate, gaiaGetLayerExtent, gaiaGetVectorLayersList
1316
+
1317
+ \return 0 on failure, the total count of processed entries on success
1318
+ */
1319
+ SPATIALITE_DECLARE int update_layer_statistics (sqlite3 * sqlite,
1320
+ const char *table,
1321
+ const char *column);
1322
+
1323
+ /**
1324
+ Immediately and unconditionally invalidates the already existing Statistics
1325
+
1326
+ \param handle SQLite handle to current DB connection.
1327
+ \param table VectorLayer Table (or View, or VirtualShape).
1328
+ \param geometry Geometry Column name.
1329
+
1330
+ \return 0 on success, any other value on success
1331
+
1332
+ \sa update_layer_statistics, gaiaGetLayerExtent, gaiaGetVectorLayersList
1333
+
1334
+ \note if the table arg is NULL all Statistics for any VectorLayer defined within
1335
+ the DB will be invalidated; otherwise only a single Layer will be affectedd (if existing).
1336
+ \n By defining the geometry arg (not NULL) you can further restrict your selection.
1337
+ */
1338
+ SPATIALITE_DECLARE int gaiaStatisticsInvalidate (sqlite3 * handle,
1339
+ const char *table,
1340
+ const char *geometry);
1341
+
1342
+ /**
1343
+ Queries the Metadata tables returning the Layer Full Extent
1344
+
1345
+ \param handle SQLite handle to current DB connection.
1346
+ \param table VectorLayer Table (or View, or VirtualShape).
1347
+ \param geometry Geometry Column name.
1348
+ \param mode if TRUE a PESSIMISTIC statistics update will be implied,
1349
+ otherwise OPTIMISTIC.
1350
+
1351
+ \return the pointer to the newly created Geometry (Envelope): NULL on failure
1352
+
1353
+ \sa update_layer_statistic, gaiaStatisticsInvalidate, gaiaGetVectorLayersList
1354
+
1355
+ \note you are responsible to destroy (before or after) any allocated
1356
+ Geometry returned by gaiaGetLayerExtent().
1357
+ \n The geometry arg is optional when the table simply has a single Geometry Column,
1358
+ and can be NULL in this case.
1359
+ \n When the mode arg is set to FALSE (default) then the returned infos
1360
+ will be simply retrieved from the staticized statistic tables (faster, but could be inaccurate).
1361
+ \n If the mode arg is set to TRUE a preliminary attempt to update the
1362
+ statistic tables will be always performed (probably slower, but surely accurate).
1363
+ \n If the named Layer doesn't exist, or if it's completely empty (not containing
1364
+ any valid Geometry) NULL will be returned.
1365
+ */
1366
+ SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetLayerExtent (sqlite3 * handle,
1367
+ const char *table,
1368
+ const char *geometry,
1369
+ int mode);
1370
+
1371
+ /**
1372
+ Queries the Metadata tables supporting Vector Layers
1373
+
1374
+ \param handle SQLite handle to current DB connection.
1375
+ \param table VectorLayer Table (or View, or VirtualShape).
1376
+ \param geometry Geometry Column name.
1377
+ \param mode one of GAIA_VECTORS_LIST_OPTIMISTIC or GAIA_VECTORS_LIST_PESSIMISTIC.
1378
+
1379
+ \return the pointer to the newly created VectorLayersList object: NULL on failure
1380
+
1381
+ \sa gaiaFreeVectorLayersList, update_layer_statistics, gaiaStatisticsInvalidate,
1382
+ gaiaGetLayerExtent, gaiaGetVectorLayersList
1383
+
1384
+ \note you are responsible to destroy (before or after) any allocated
1385
+ VectorLayersList returned by gaiaGetVectorLayersList().
1386
+ \n If the table arg is NULL all VectorLayers defined within the DB will be reported
1387
+ (and in this case all AttributeField Infos will be always suppressed);
1388
+ otherwise only a single Layer will be reported (if existing).
1389
+ \n By defining the geometry arg (not NULL) you can further restrict the returned report.
1390
+ \n When the mode arg is set to GAIA_VECTORS_LIST_OPTIMISTIC (default) then the returned infos
1391
+ will be simply retrieved from the staticized statistic tables (faster, but could be inaccurate).
1392
+ \n If the mode arg is set to GAIA_VECTORS_LIST_PESSIMISTIC a preliminary attempt to update the
1393
+ statistic tables will be always performed (probably slower, but surely accurate).
1394
+ */
1395
+ SPATIALITE_DECLARE gaiaVectorLayersListPtr gaiaGetVectorLayersList (sqlite3
1396
+ *
1397
+ handle,
1398
+ const
1399
+ char
1400
+ *table,
1401
+ const
1402
+ char
1403
+ *geometry,
1404
+ int
1405
+ mode);
1406
+
1407
+ /**
1408
+ Creates (or re-creates) the "splite_metacatalog" and
1409
+ "splite_metacalog_statistics" tables.
1410
+
1411
+ \param handle SQLite handle to current DB connection.
1412
+
1413
+ \return 0 (FALSE) on failure, any other value (TRUE) on success
1414
+
1415
+ \sa gaiaUpdateMetaCatalogStatistics, gaiaUpdateMetaCatalogStatisticsFromMaster
1416
+ */
1417
+ SPATIALITE_DECLARE int gaiaCreateMetaCatalogTables (sqlite3 * handle);
1418
+
1419
+ /**
1420
+ Updates the "splite_metacatalog_statistics" table.
1421
+
1422
+ \param handle SQLite handle to current DB connection.
1423
+ \param table name of the table to be processed.
1424
+ \param column name of the column to be processed.
1425
+
1426
+ \return 0 (FALSE) on failure, any other value (TRUE) on success
1427
+
1428
+ \sa gaiaCreateMetaCatalogTables, gaiaUpdateMetaCatalogStatisticsFromMaster
1429
+ */
1430
+ SPATIALITE_DECLARE int gaiaUpdateMetaCatalogStatistics (sqlite3 * handle,
1431
+ const char *table,
1432
+ const char *column);
1433
+
1434
+ /**
1435
+ Updates the "splite_metacatalog_statistics" table (using a Master Table).
1436
+
1437
+ \param handle SQLite handle to current DB connection.
1438
+ \param master_table name of the master-table controlling the whole process.
1439
+ \param table_name name of the column into the master-table containing table-names.
1440
+ \param column_name name of the column into the master-table containing column-names.
1441
+
1442
+ \return 0 (FALSE) on failure, any other value (TRUE) on success
1443
+
1444
+ \sa gaiaCreateMetaCatalogTables, gaiaUpdateMetaCatalogStatistics
1445
+ */
1446
+ SPATIALITE_DECLARE int gaiaUpdateMetaCatalogStatisticsFromMaster (sqlite3 *
1447
+ handle,
1448
+ const char
1449
+ *master_table,
1450
+ const char
1451
+ *table_name,
1452
+ const char
1453
+ *column_name);
1454
+
1455
+ /**
1456
+ Destroys a VectorLayersList object
1457
+
1458
+ \param ptr pointer to the VectorLayersList object to be destroyed
1459
+
1460
+ \sa gaiaGetVectorLayersList
1461
+ */
1462
+ SPATIALITE_DECLARE void gaiaFreeVectorLayersList (gaiaVectorLayersListPtr
1463
+ ptr);
1464
+
1465
+ /**
1466
+ Drops a layer-table, removing any related dependency
1467
+
1468
+ \param sqlite handle to current DB connection
1469
+ \param table name of the table to be removed
1470
+
1471
+ \note this function will drop a SpatialTable, SpatialView or VirtualShape being
1472
+ properly registered within the Metadata tables.
1473
+ \n an eventual Spatial Index will be dropped as well, and any row referring the
1474
+ selected table will be removed from the Metadata tables.
1475
+
1476
+ \return 0 on failure, any other value on success
1477
+
1478
+ \sa gaiaDropTableEx, gaiaRenameTable, gaiaRenameColumn
1479
+
1480
+ \note this one simply is a convenience method alway defaulting to
1481
+ gaiaDropTableEx(sqlite, "main", table);
1482
+ */
1483
+ SPATIALITE_DECLARE int gaiaDropTable (sqlite3 * sqlite, const char *table);
1484
+
1485
+ /**
1486
+ Drops a layer-table, removing any related dependency
1487
+
1488
+ \param sqlite handle to current DB connection
1489
+ \param prefix schema prefix identifying the target DB\n
1490
+ "main" always identifies the main DB (primary, not Attached).
1491
+ \param table name of the table to be removed
1492
+
1493
+ \note this function will drop a SpatialTable, SpatialView or VirtualShape being
1494
+ properly registered within the Metadata tables.
1495
+ \n an eventual Spatial Index will be dropped as well, and any row referring the
1496
+ selected table will be removed from the Metadata tables.
1497
+
1498
+ \return 0 on failure, any other value on success
1499
+
1500
+ \sa gaiaDropTableEx2, gaiaRenameTable, gaiaRenameColumn
1501
+ */
1502
+ SPATIALITE_DECLARE int gaiaDropTableEx (sqlite3 * sqlite,
1503
+ const char *prefix,
1504
+ const char *table);
1505
+
1506
+ /**
1507
+ Drops a layer-table, removing any related dependency
1508
+
1509
+ \param sqlite handle to current DB connection
1510
+ \param prefix schema prefix identifying the target DB\n
1511
+ "main" always identifies the main DB (primary, not Attached).
1512
+ \param table name of the table to be removed
1513
+ \param transaction boolena; if set to TRUE will internally handle
1514
+ a SQL Transaction
1515
+
1516
+ \note this function will drop a SpatialTable, SpatialView or VirtualShape being
1517
+ properly registered within the Metadata tables.
1518
+ \n an eventual Spatial Index will be dropped as well, and any row referring the
1519
+ selected table will be removed from the Metadata tables.
1520
+
1521
+ \return 0 on failure, any other value on success
1522
+
1523
+ \sa gaiaDropTable, gaiaRenameTable, gaiaRenameColumn
1524
+ */
1525
+ SPATIALITE_DECLARE int gaiaDropTableEx2 (sqlite3 * sqlite,
1526
+ const char *prefix,
1527
+ const char *table,
1528
+ int transaction);
1529
+
1530
+ /**
1531
+ Drops a layer-table, removing any related dependency
1532
+
1533
+ \param sqlite handle to current DB connection
1534
+ \param prefix schema prefix identifying the target DB\n
1535
+ "main" always identifies the main DB (primary, not Attached).
1536
+ \param table name of the table to be removed
1537
+ \param transaction boolean; if set to TRUE will internally handle
1538
+ a SQL Transaction
1539
+ \param error_message: will point to a diagnostic error message
1540
+ in case of failure, otherwise NULL
1541
+
1542
+ \note this function will drop a SpatialTable, SpatialView or VirtualShape being
1543
+ properly registered within the Metadata tables.
1544
+ \n an eventual Spatial Index will be dropped as well, and any row referring the
1545
+ selected table will be removed from the Metadata tables.
1546
+ \n an eventual diagnostic message pointed by error_message must be
1547
+ freed by calling sqlite3_free()
1548
+
1549
+ \return 0 on failure, any other value on success
1550
+
1551
+ \sa gaiaDropTable5, gaiaRenameTable, gaiaRenameColumn
1552
+
1553
+ \deprecated use gaiaDropTable5() as a full replacement
1554
+ */
1555
+ SPATIALITE_DECLARE int gaiaDropTableEx3 (sqlite3 * sqlite,
1556
+ const char *prefix,
1557
+ const char *table,
1558
+ int transaction,
1559
+ char **error_message);
1560
+
1561
+ /**
1562
+ Drops a layer-table, removing any related dependency
1563
+
1564
+ \param sqlite handle to current DB connection
1565
+ \param prefix schema prefix identifying the target DB\n
1566
+ "main" always identifies the main DB (primary, not Attached).
1567
+ \param table name of the table or view to be dropped
1568
+ \param error_message: will point to a diagnostic error message
1569
+ in case of failure, otherwise NULL
1570
+
1571
+ \note this function will drop a SpatialTable, SpatialView or VirtualShape being
1572
+ properly registered within the Metadata tables.
1573
+ \n an eventual Spatial Index will be dropped as well, and any row referring the
1574
+ selected table will be removed from the Metadata tables.
1575
+ \n an eventual diagnostic message pointed by error_message must be
1576
+ freed by calling sqlite3_free()
1577
+
1578
+ \return 0 on failure, any other value on success
1579
+
1580
+ \sa gaiaDropTableEx3, gaiaRenameTable, gaiaRenameColumn
1581
+ */
1582
+ SPATIALITE_DECLARE int gaiaDropTable5 (sqlite3 * sqlite,
1583
+ const char *prefix,
1584
+ const char *table,
1585
+ char **error_message);
1586
+
1587
+ /**
1588
+ Renames a Table
1589
+
1590
+ \param sqlite handle to current DB connection
1591
+ \param prefix schema prefix identifying the target DB\n
1592
+ "main" always identifies the main DB (primary, not Attached).
1593
+ \param old_name current name of the table to be renamed
1594
+ (always expected to be in the MAIN database).
1595
+ \param new_name new table name to be set
1596
+ \param error_message: will point to a diagnostic error message
1597
+ in case of failure, otherwise NULL
1598
+
1599
+ \note this function will corretly rename a SpatialTable being properly
1600
+ registered within the Metadata tables.
1601
+ \n all triggers, Spatial Index and alike will be correctly recovered.
1602
+ \n an eventual diagnostic message pointed by error_message must be
1603
+ freed by calling sqlite3_free()
1604
+
1605
+ \return 0 on failure, any other value on success
1606
+
1607
+ \sa gaiaDropTable, gaiaRenameColumn
1608
+
1609
+ \note SQLite 3.25 (or later) is stricly required.
1610
+ */
1611
+ SPATIALITE_DECLARE int gaiaRenameTable (sqlite3 * sqlite,
1612
+ const char *prefix,
1613
+ const char *old_name,
1614
+ const char *new_name,
1615
+ char **error_message);
1616
+
1617
+ /**
1618
+ Renames a Table's Column
1619
+
1620
+ \param sqlite handle to current DB connection
1621
+ \param prefix schema prefix identifying the target DB\n
1622
+ "main" always identifies the main DB (primary, not Attached).
1623
+ \param table name of the table containing the column to be renamed
1624
+ (always expected to be in the MAIN database).
1625
+ \param old_name current name of the column to be renamed
1626
+ \param new_name new column name to be set
1627
+ \param error_message: will point to a diagnostic error message
1628
+ in case of failure, otherwise NULL
1629
+
1630
+ \note this function will corretly rename a Geometry Column being properly
1631
+ registered within the Metadata tables.
1632
+ \n all triggers, Spatial Index and alike will be correctly recovered.
1633
+ \n an eventual diagnostic message pointed by error_message must be
1634
+ freed by calling sqlite3_free()
1635
+
1636
+ \return 0 on failure, any other value on success
1637
+
1638
+ \sa gaiaDropTable, gaiaRenameTable
1639
+
1640
+ \note SQLite 3.25 (or later) is stricly required.
1641
+ */
1642
+ SPATIALITE_DECLARE int gaiaRenameColumn (sqlite3 * sqlite,
1643
+ const char *prefix,
1644
+ const char *table,
1645
+ const char *old_name,
1646
+ const char *new_name,
1647
+ char **error_message);
1648
+
1649
+ /**
1650
+ Checks a Geometry Column for validity
1651
+
1652
+ \param sqlite handle to current DB connection
1653
+ \param table name of the table
1654
+ \param geometry name of the column to be checked
1655
+ \param report_path pathname of the report-file
1656
+ \param n_rows if this variable is not NULL on successful completion will
1657
+ contain the total number of rows found into the checkeck table
1658
+ \param n_invalids if this variable is not NULL on successful completion will
1659
+ contain the total number of invalid Geometries found into the checkeck table
1660
+ \param err_msg if this variable is not NULL and the return status is ZERO
1661
+ (failure), an appropriate error message will be returned
1662
+
1663
+ \sa check_geometry_column_r, check_all_geometry_columns,
1664
+ sanitize_geometry_column, sanitize_all_geometry_columns
1665
+
1666
+ \note this function will check a Geometry Column (layer) for validity;
1667
+ a HTML report will be produced.
1668
+ \n an eventual error message returned via err_msg requires to be deallocated
1669
+ by invoking free()\n
1670
+ not reentrant and thread unsafe.
1671
+
1672
+ \return 0 on failure, any other value on success
1673
+ */
1674
+ SPATIALITE_DECLARE int check_geometry_column (sqlite3 * sqlite,
1675
+ const char *table,
1676
+ const char *geom,
1677
+ const char *report_path,
1678
+ int *n_rows, int *n_invalids,
1679
+ char **err_msg);
1680
+
1681
+ /**
1682
+ Checks a Geometry Column for validity
1683
+
1684
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
1685
+ \param sqlite handle to current DB connection
1686
+ \param table name of the table
1687
+ \param geometry name of the column to be checked
1688
+ \param report_path pathname of the report-file
1689
+ \param n_rows if this variable is not NULL on successful completion will
1690
+ contain the total number of rows found into the checkeck table
1691
+ \param n_invalids if this variable is not NULL on successful completion will
1692
+ contain the total number of invalid Geometries found into the checkeck table
1693
+ \param err_msg if this variable is not NULL and the return status is ZERO
1694
+ (failure), an appropriate error message will be returned
1695
+
1696
+ \sa check_geometry_column, check_all_geometry_columns,
1697
+ sanitize_geometry_column, sanitize_all_geometry_columns
1698
+
1699
+ \note this function will check a Geometry Column (layer) for validity;
1700
+ a HTML report will be produced.
1701
+ \n an eventual error message returned via err_msg requires to be deallocated
1702
+ by invoking free()\n
1703
+ reentrant and thread-safe.
1704
+
1705
+ \return 0 on failure, any other value on success
1706
+ */
1707
+ SPATIALITE_DECLARE int check_geometry_column_r (const void *p_cache,
1708
+ sqlite3 * sqlite,
1709
+ const char *table,
1710
+ const char *geom,
1711
+ const char *report_path,
1712
+ int *n_rows,
1713
+ int *n_invalids,
1714
+ char **err_msg);
1715
+
1716
+ /**
1717
+ Checks all Geometry Columns for validity
1718
+
1719
+ \param sqlite handle to current DB connection
1720
+ \param output_dir pathname of the directory to be created for report-files
1721
+ \param n_invalids if this variable is not NULL on successful completion will
1722
+ contain the total number of invalid Geometries found
1723
+ \param err_msg if this variable is not NULL and the return status is ZERO
1724
+ (failure), an appropriate error message will be returned
1725
+
1726
+ \sa check_all_geometry_columns_r, check_geometry_column,
1727
+ sanitize_geometry_column, sanitize_all_geometry_columns
1728
+
1729
+ \note this function will check all Geometry Columns (vector layers) for validity;
1730
+ a HTML report will be produced.
1731
+ \n an eventual error message returned via err_msg requires to be deallocated
1732
+ by invoking free()\n
1733
+ not reentrant and thread unsafe.
1734
+
1735
+ \return 0 on failure, any other value on success
1736
+ */
1737
+ SPATIALITE_DECLARE int check_all_geometry_columns (sqlite3 * sqlite,
1738
+ const char *output_dir,
1739
+ int *n_invalids,
1740
+ char **err_msg);
1741
+
1742
+ /**
1743
+ Checks all Geometry Columns for validity
1744
+
1745
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
1746
+ \param sqlite handle to current DB connection
1747
+ \param output_dir pathname of the directory to be created for report-files
1748
+ \param n_invalids if this variable is not NULL on successful completion will
1749
+ contain the total number of invalid Geometries found
1750
+ \param err_msg if this variable is not NULL and the return status is ZERO
1751
+ (failure), an appropriate error message will be returned
1752
+
1753
+ \sa check_all_geometry_columns, check_geometry_column,
1754
+ sanitize_geometry_column, sanitize_all_geometry_columns
1755
+
1756
+ \note this function will check all Geometry Columns (vector layers) for validity;
1757
+ a HTML report will be produced.
1758
+ \n an eventual error message returned via err_msg requires to be deallocated
1759
+ by invoking free()\n
1760
+ reentrant and thread-safe.
1761
+
1762
+ \return 0 on failure, any other value on success
1763
+ */
1764
+ SPATIALITE_DECLARE int check_all_geometry_columns_r (const void *p_cache,
1765
+ sqlite3 * sqlite,
1766
+ const char *output_dir,
1767
+ int *n_invalids,
1768
+ char **err_msg);
1769
+
1770
+ /**
1771
+ Sanitizes a Geometry Column making all invalid geometries to be valid
1772
+
1773
+ \param sqlite handle to current DB connection
1774
+ \param table name of the table
1775
+ \param geometry name of the column to be checked
1776
+ \param tmp_table name of the temporary table
1777
+ \param report_path pathname of the report-file
1778
+ \param n_invalids if this variable is not NULL on successful completion will
1779
+ contain the total number of invalid Geometries found into the sanitize table
1780
+ \param n_repaired if this variable is not NULL on successful completion will
1781
+ contain the total number of repaired Geometries
1782
+ \param n_discarded if this variable is not NULL on successful completion will
1783
+ contain the total number of repaired Geometries (by discarding fragments)
1784
+ \param n_failures if this variable is not NULL on successful completion will
1785
+ contain the total number of repair failures (i.e. Geometries beyond possible repair)
1786
+ \param err_msg if this variable is not NULL and the return status is ZERO
1787
+ (failure), an appropriate error message will be returned
1788
+
1789
+ \sa sanitize_geometry_column_r, check_geometry_column,
1790
+ check_all_geometry_columns, sanitize_all_geometry_columns
1791
+
1792
+ \note this function will attempt to make valid all invalid geometries
1793
+ found within a Geometry Column (layer); a temporary table is required.
1794
+ \n if the process has full success the temprary table will be deleted;
1795
+ otherwise it will be preserved for further inspection.
1796
+ a HTML report will be produced as well.
1797
+ \n an eventual error message returned via err_msg requires to be deallocated
1798
+ by invoking free()\n
1799
+ not reentrant and thread unsafe.
1800
+
1801
+ \return 0 on failure, any other value on success
1802
+ */
1803
+ SPATIALITE_DECLARE int sanitize_geometry_column (sqlite3 * sqlite,
1804
+ const char *table,
1805
+ const char *geom,
1806
+ const char *tmp_table,
1807
+ const char *report_path,
1808
+ int *n_invalids,
1809
+ int *n_repaired,
1810
+ int *n_discarded,
1811
+ int *n_failures,
1812
+ char **err_msg);
1813
+
1814
+ /**
1815
+ Sanitizes a Geometry Column making all invalid geometries to be valid
1816
+
1817
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
1818
+ \param sqlite handle to current DB connection
1819
+ \param table name of the table
1820
+ \param geometry name of the column to be checked
1821
+ \param tmp_table name of the temporary table
1822
+ \param report_path pathname of the report-file
1823
+ \param n_invalids if this variable is not NULL on successful completion will
1824
+ contain the total number of invalid Geometries found into the sanitize table
1825
+ \param n_repaired if this variable is not NULL on successful completion will
1826
+ contain the total number of repaired Geometries
1827
+ \param n_discarded if this variable is not NULL on successful completion will
1828
+ contain the total number of repaired Geometries (by discarding fragments)
1829
+ \param n_failures if this variable is not NULL on successful completion will
1830
+ contain the total number of repair failures (i.e. Geometries beyond possible repair)
1831
+ \param err_msg if this variable is not NULL and the return status is ZERO
1832
+ (failure), an appropriate error message will be returned
1833
+
1834
+ \sa sanitize_geometry_column, check_geometry_column,
1835
+ check_all_geometry_columns, sanitize_all_geometry_columns
1836
+
1837
+ \note this function will attempt to make valid all invalid geometries
1838
+ found within a Geometry Column (layer); a temporary table is required.
1839
+ \n if the process has full success the temprary table will be deleted;
1840
+ otherwise it will be preserved for further inspection.
1841
+ a HTML report will be produced as well.
1842
+ \n an eventual error message returned via err_msg requires to be deallocated
1843
+ by invoking free()\n
1844
+ reentrant and thread-safe.
1845
+
1846
+ \return 0 on failure, any other value on success
1847
+ */
1848
+ SPATIALITE_DECLARE int sanitize_geometry_column_r (const void *p_cache,
1849
+ sqlite3 * sqlite,
1850
+ const char *table,
1851
+ const char *geom,
1852
+ const char *tmp_table,
1853
+ const char *report_path,
1854
+ int *n_invalids,
1855
+ int *n_repaired,
1856
+ int *n_discarded,
1857
+ int *n_failures,
1858
+ char **err_msg);
1859
+
1860
+ /**
1861
+ Sanitizes all Geometry Columns making all invalid geometries to be valid
1862
+
1863
+ \param sqlite handle to current DB connection
1864
+ \param tmp_prefix name-prefix for temporary tables
1865
+ \param output_dir pathname of the directory to be created for report-files
1866
+ \param not_repaired if this variable is not NULL on successful completion will
1867
+ contain the total count of repair failures (i.e. Geometries beyond possible repair)
1868
+ \param err_msg if this variable is not NULL and the return status is ZERO
1869
+ (failure), an appropriate error message will be returned
1870
+
1871
+ \sa sanitize_all_geometry_columns_r, check_geometry_column,
1872
+ check_all_geometry_columns, sanitize_geometry_column
1873
+
1874
+ \note this function will attempt to make valid all invalid geometries
1875
+ found within all Geometry Columns (vector layers); a temporary table is
1876
+ required so to support each input table.
1877
+ \n if the process has full success the temprary table will be deleted;
1878
+ otherwise it will be preserved for further inspection.
1879
+ a HTML report will be produced as well.
1880
+ \n an eventual error message returned via err_msg requires to be deallocated
1881
+ by invoking free()\n
1882
+ not reentrant and thread unsafe.
1883
+
1884
+ \return 0 on failure, any other value on success
1885
+ */
1886
+ SPATIALITE_DECLARE int sanitize_all_geometry_columns (sqlite3 * sqlite,
1887
+ const char
1888
+ *tmp_prefix,
1889
+ const char
1890
+ *output_dir,
1891
+ int *not_repaired,
1892
+ char **err_msg);
1893
+
1894
+ /**
1895
+ Sanitizes all Geometry Columns making all invalid geometries to be valid
1896
+
1897
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
1898
+ \param sqlite handle to current DB connection
1899
+ \param tmp_prefix name-prefix for temporary tables
1900
+ \param output_dir pathname of the directory to be created for report-files
1901
+ \param not_repaired if this variable is not NULL on successful completion will
1902
+ contain the total count of repair failures (i.e. Geometries beyond possible repair)
1903
+ \param err_msg if this variable is not NULL and the return status is ZERO
1904
+ (failure), an appropriate error message will be returned
1905
+
1906
+ \sa sanitize_all_geometry_columns, check_geometry_column,
1907
+ check_all_geometry_columns, sanitize_geometry_column
1908
+
1909
+ \note this function will attempt to make valid all invalid geometries
1910
+ found within all Geometry Columns (vector layers); a temporary table is
1911
+ required so to support each input table.
1912
+ \n if the process has full success the temprary table will be deleted;
1913
+ otherwise it will be preserved for further inspection.
1914
+ a HTML report will be produced as well.
1915
+ \n an eventual error message returned via err_msg requires to be deallocated
1916
+ by invoking free()\n
1917
+ reentrant and thread-safe.
1918
+
1919
+ \return 0 on failure, any other value on success
1920
+ */
1921
+ SPATIALITE_DECLARE int sanitize_all_geometry_columns_r (const void *p_cache,
1922
+ sqlite3 * sqlite,
1923
+ const char
1924
+ *tmp_prefix,
1925
+ const char
1926
+ *output_dir,
1927
+ int *not_repaired,
1928
+ char **err_msg);
1929
+
1930
+ /**
1931
+ Will precisely cut the input dataset against polygonal blade(s)
1932
+ and will consequently create and populate an output dataset
1933
+
1934
+ \param db_handle handle to the current SQLite connection
1935
+ \param cache a memory pointer returned by spatialite_alloc_connection()
1936
+ \param in_db_prefix prefix of the database where the input table
1937
+ is expected to be found. if NULL then "MAIN" will be assumed.
1938
+ \param input_table name of the input table to be processed.
1939
+ \param input_geometry name of the input table Geometry column;
1940
+ it could be NULL and in this case the appropriate column name will
1941
+ be automatically determind. anyway if the input table do contains
1942
+ two or more Geometries passing a NULL geometry name will raise a
1943
+ fatal error.
1944
+ \param blade_db_prefix prefix of the database where the "blade" table
1945
+ is expected to be found. if NULL then "MAIN" will be assumed.
1946
+ \param blade_table name of the table expected to contain Polygons
1947
+ or MultiPolygon Geometries acting as blades.
1948
+ \param blade_geometry name of the "blade" table Geometry column;
1949
+ it could be NULL and in this case the appropriate column name will
1950
+ be automatically determind. anyway if the input table do contains
1951
+ two or more Geometries passing a NULL geometry name will raise a
1952
+ fatal error.
1953
+ \param output_table name to assinged to the destination table intended
1954
+ to permanently store all results. this table must non exists.
1955
+ \param transaction boolean; if set to TRUE will internally handle
1956
+ a SQL Transaction.
1957
+ \param ram_tmp_store boolean: if set to TRUE all TEMPORARY tables
1958
+ and indices will be created in RAM, otherwise in a file.
1959
+ \param message pointer to a string buffer; if not NULL it will point
1960
+ on completion an eventual error message.
1961
+
1962
+ \return 0 on failure, any other value on success
1963
+
1964
+ \note the message buffer if not NULL will point to a dymanic memory
1965
+ allocation and is expected to be released by calling sqlite3_free()
1966
+ */
1967
+ SPATIALITE_DECLARE int gaiaCutter (sqlite3 * db_handle, const void *cache,
1968
+ const char *in_db_prefix,
1969
+ const char *input_table,
1970
+ const char *input_geom,
1971
+ const char *blade_db_prefix,
1972
+ const char *blade_table,
1973
+ const char *blade_geom,
1974
+ const char *output_table,
1975
+ int transaction, int ram_tmp_store,
1976
+ char **message);
1977
+
1978
+ /**
1979
+ Will attempt to create the Routing Nodes columns for a spatial table
1980
+
1981
+ \param db_handle handle to the current SQLite connection
1982
+ \param cache a memory pointer returned by spatialite_alloc_connection()
1983
+ \param prefix schema prefix identifying the target DB (could be
1984
+ eventually NULL)\n
1985
+ \param table name of the table to be processed.
1986
+ \param geom_column name of the table column containing Linestring Geometries
1987
+ (could be eventually NULL).
1988
+ \param from_column name of the table column where NodeFrom values
1989
+ will be stored.
1990
+ \param to_column name of the column where ToFrom values
1991
+ will be stored.
1992
+
1993
+ \return 0 on failure, any other value on success
1994
+ */
1995
+ SPATIALITE_DECLARE int gaia_create_routing_nodes (sqlite3 * db_handle,
1996
+ const void *cache,
1997
+ const char *prefix,
1998
+ const char *table,
1999
+ const char *geom_column,
2000
+ const char *from_column,
2001
+ const char *to_column);
2002
+
2003
+ /**
2004
+ Will attempt to create a VirtualRouting from an input table
2005
+
2006
+ \param db_handle handle to the current SQLite connection
2007
+ \param cache a memory pointer returned by spatialite_alloc_connection()
2008
+ \param routing_data_table name of the Routing Data Table to be created.
2009
+ \param virtual_routing_table name of the VirtualRouting Table to be created.
2010
+ \param input_table name of the input table to be processed.
2011
+ \param from_column name of the input table column containing NodeFrom.
2012
+ \param to_column name of the input table column containing NodeTo.
2013
+ \param geom_column name of the input table column containing Linestring Geometries
2014
+ (could be eventually NULL).
2015
+ \param cost_column name of the input table column containing Cost values
2016
+ (could be eventually NULL).
2017
+ \param name_column name of the input table column containing RoadName
2018
+ (could be eventually NULL).
2019
+ \param a_star_enabled if set to TRUE the Routing Data Table will support
2020
+ both Djiskra's Shortest Path and A* algorithms; if set to FALSE only
2021
+ the Djiskra's algorithm will be supported.
2022
+ \param bidirectional if set to TRUE all input arcs/links will be assumed
2023
+ to be bidirectional (from-to and to-from); if set to FALSE all input
2024
+ arcs/links will be assumed to be unidirectional (from-to only).
2025
+ \param oneway_from name of the input table column containing OneWayFrom
2026
+ (could be eventually NULL).
2027
+ \param oneway_to name of the input table column containing OneWayTo
2028
+ (could be eventually NULL).
2029
+ \param overwrite if set to TRUE both the Routing Data Table and the
2030
+ VirtualRouting Table will be dropped if already existing; if set to
2031
+ FALSE an already existing Routing Data Table or VirtualRouting Table
2032
+ will cause a fatal error.
2033
+
2034
+ \return 0 on failure, any other value on success
2035
+
2036
+ \note at least one between geom_column and cost_column shall not be NULL.
2037
+ both oneway_from and oneway_to must be NULL or must contain a valid
2038
+ column name; mixing a column name and a NULL will be considered a
2039
+ fatal error.
2040
+ */
2041
+ SPATIALITE_DECLARE int gaia_create_routing (sqlite3 * db_handle,
2042
+ const void *cache,
2043
+ const char *routing_data_table,
2044
+ const char
2045
+ *virtual_routing_table,
2046
+ const char *input_table,
2047
+ const char *from_column,
2048
+ const char *to_column,
2049
+ const char *geom_column,
2050
+ const char *cost_column,
2051
+ const char *name_column,
2052
+ int a_star_enabled,
2053
+ int bidirectional,
2054
+ const char *oneway_from,
2055
+ const char *oneway_to,
2056
+ int overwrite);
2057
+
2058
+ SPATIALITE_DECLARE const char *gaia_create_routing_get_last_error (const
2059
+ void
2060
+ *cache);
2061
+
2062
+ SPATIALITE_DECLARE int gaiaGPKG2Spatialite (sqlite3 * handle_in,
2063
+ const char *gpkg_in_path,
2064
+ sqlite3 * handle_out,
2065
+ const char *splite_out_path);
2066
+
2067
+ SPATIALITE_DECLARE int gaiaSpatialite2GPKG (sqlite3 * handle_in,
2068
+ const char *splite_in_path,
2069
+ sqlite3 * handle_out,
2070
+ const char *gpkg_out_path);
2071
+
2072
+ SPATIALITE_DECLARE const void *gaiaGetCurrentProjContext (const void
2073
+ *cache);
2074
+
2075
+ SPATIALITE_DECLARE int gaiaSetCurrentCachedProj (const void
2076
+ *cache, void *pj,
2077
+ const char *proj_string_1,
2078
+ const char *proj_string_2,
2079
+ void *area);
2080
+
2081
+ SPATIALITE_DECLARE void *gaiaGetCurrentCachedProj (const void *cache);
2082
+
2083
+ SPATIALITE_DECLARE int gaiaCurrentCachedProjMatches (const void *cache,
2084
+ const char
2085
+ *proj_string_1,
2086
+ const char
2087
+ *proj_string_2,
2088
+ void *area);
2089
+
2090
+ SPATIALITE_DECLARE char *gaiaGetDbObjectScope (sqlite3 * handle,
2091
+ const char *db_prefix,
2092
+ const char *obj_name);
2093
+
2094
+ #ifdef __cplusplus
2095
+ }
2096
+ #endif
2097
+
2098
+ #endif /* _SPATIALITE_H */