SpatiaLite  5.0.0
spatialite.h
Go to the documentation of this file.
1 /*
2  spatialite.h -- Gaia spatial support for SQLite
3 
4  version 5.0, 2020 August 1
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-2020
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 
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 
91  SPATIALITE_DECLARE void spatialite_initialize (void);
92 
101  SPATIALITE_DECLARE void spatialite_shutdown (void);
102 
108  SPATIALITE_DECLARE const char *spatialite_version (void);
109 
115  SPATIALITE_DECLARE const char *spatialite_target_cpu (void);
116 
123  SPATIALITE_DECLARE void *spatialite_alloc_connection (void);
124 
134  SPATIALITE_DECLARE void spatialite_set_silent_mode (const void *ptr);
135 
145  SPATIALITE_DECLARE void spatialite_set_verbode_mode (const void *ptr);
146 
161  SPATIALITE_DECLARE void spatialite_init (int verbose);
162 
176  SPATIALITE_DECLARE void spatialite_init_ex (sqlite3 * db_handle,
177  const void *ptr, int verbose);
178 
185  SPATIALITE_DECLARE void spatialite_init_geos (void);
186 
197  SPATIALITE_DECLARE void spatialite_cleanup (void);
198 
210  SPATIALITE_DECLARE void spatialite_cleanup_ex (const void *ptr);
211 
222  SPATIALITE_DECLARE void spatialite_finalize_topologies (const void *ptr);
223 
232  SPATIALITE_DECLARE void enable_tiny_point (const void *ptr);
233 
242  SPATIALITE_DECLARE void disable_tiny_point (const void *ptr);
243 
254  SPATIALITE_DECLARE int is_tiny_point_enabled (const void *ptr);
255 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
696  SPATIALITE_DECLARE int dump_dbf (sqlite3 * sqlite, char *table,
697  char *dbf_path, char *charset,
698  char *err_msg);
699 
714  SPATIALITE_DECLARE int dump_dbf_ex (sqlite3 * sqlite, char *table,
715  char *dbf_path, char *charset,
716  int *rows, char *err_msg);
717 
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 
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 
765  SPATIALITE_DECLARE double math_round (double value);
766 
774  SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value);
775 
791  SPATIALITE_DECLARE int spatial_ref_sys_init (sqlite3 * sqlite, int verbose);
792 
805  SPATIALITE_DECLARE int spatial_ref_sys_init2 (sqlite3 * sqlite, int mode,
806  int verbose);
807 
816  SPATIALITE_DECLARE int insert_epsg_srid (sqlite3 * sqlite, int srid);
817 
828  SPATIALITE_DECLARE int srid_is_geographic (sqlite3 * sqlite, int srid,
829  int *geographic);
830 
841  SPATIALITE_DECLARE int srid_is_projected (sqlite3 * sqlite, int srid,
842  int *projected);
843 
855  SPATIALITE_DECLARE int srid_has_flipped_axes (sqlite3 * sqlite, int srid,
856  int *flipped);
857 
869  SPATIALITE_DECLARE char *srid_get_spheroid (sqlite3 * sqlite, int srid);
870 
882  SPATIALITE_DECLARE char *srid_get_prime_meridian (sqlite3 * sqlite,
883  int srid);
884 
896  SPATIALITE_DECLARE char *srid_get_projection (sqlite3 * sqlite, int srid);
897 
909  SPATIALITE_DECLARE char *srid_get_datum (sqlite3 * sqlite, int srid);
910 
922  SPATIALITE_DECLARE char *srid_get_unit (sqlite3 * sqlite, int srid);
923 
937  SPATIALITE_DECLARE char *srid_get_axis (sqlite3 * sqlite, int srid,
938  char axis, char mode);
939 
951  SPATIALITE_DECLARE int
952  is_kml_constant (sqlite3 * sqlite, char *table, char *column);
953 
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 
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 
1007  SPATIALITE_DECLARE void check_duplicated_rows (sqlite3 * sqlite,
1008  char *table,
1009  int *dupl_count);
1010 
1022  SPATIALITE_DECLARE void remove_duplicated_rows (sqlite3 * sqlite,
1023  char *table);
1024 
1038  SPATIALITE_DECLARE void remove_duplicated_rows_ex (sqlite3 * sqlite,
1039  char *table,
1040  int *removed);
1041 
1057  SPATIALITE_DECLARE void remove_duplicated_rows_ex2 (sqlite3 * sqlite,
1058  char *table,
1059  int *removed,
1060  int transaction);
1061 
1081  SPATIALITE_DECLARE void elementary_geometries (sqlite3 * sqlite,
1082  char *inTable,
1083  char *geometry,
1084  char *outTable, char *pKey,
1085  char *multiId);
1086 
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 
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 
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 
1199  SPATIALITE_DECLARE int dump_geojson (sqlite3 * sqlite, char *table,
1200  char *geom_col, char *outfile_path,
1201  int precision, int option);
1202 
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 
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 
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 
1319  SPATIALITE_DECLARE int update_layer_statistics (sqlite3 * sqlite,
1320  const char *table,
1321  const char *column);
1322 
1338  SPATIALITE_DECLARE int gaiaStatisticsInvalidate (sqlite3 * handle,
1339  const char *table,
1340  const char *geometry);
1341 
1366  SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetLayerExtent (sqlite3 * handle,
1367  const char *table,
1368  const char *geometry,
1369  int mode);
1370 
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 
1417  SPATIALITE_DECLARE int gaiaCreateMetaCatalogTables (sqlite3 * handle);
1418 
1430  SPATIALITE_DECLARE int gaiaUpdateMetaCatalogStatistics (sqlite3 * handle,
1431  const char *table,
1432  const char *column);
1433 
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 
1462  SPATIALITE_DECLARE void gaiaFreeVectorLayersList (gaiaVectorLayersListPtr
1463  ptr);
1464 
1483  SPATIALITE_DECLARE int gaiaDropTable (sqlite3 * sqlite, const char *table);
1484 
1502  SPATIALITE_DECLARE int gaiaDropTableEx (sqlite3 * sqlite,
1503  const char *prefix,
1504  const char *table);
1505 
1525  SPATIALITE_DECLARE int gaiaDropTableEx2 (sqlite3 * sqlite,
1526  const char *prefix,
1527  const char *table,
1528  int transaction);
1529 
1555  SPATIALITE_DECLARE int gaiaDropTableEx3 (sqlite3 * sqlite,
1556  const char *prefix,
1557  const char *table,
1558  int transaction,
1559  char **error_message);
1560 
1582  SPATIALITE_DECLARE int gaiaDropTable5 (sqlite3 * sqlite,
1583  const char *prefix,
1584  const char *table,
1585  char **error_message);
1586 
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 
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 
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 
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 
1737  SPATIALITE_DECLARE int check_all_geometry_columns (sqlite3 * sqlite,
1738  const char *output_dir,
1739  int *n_invalids,
1740  char **err_msg);
1741 
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 
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 
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 
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 
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 
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 
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 
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 
2072  SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetRTreeFullExtent (sqlite3 *
2073  db_handle,
2074  const char
2075  *db_prefix,
2076  const char *name,
2077  int srid);
2078 
2093  SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetGpkgRTreeFullExtent (sqlite3 *
2094  db_handle,
2095  const char
2096  *db_prefix,
2097  const char
2098  *name,
2099  int srid);
2100 
2101  SPATIALITE_DECLARE const char *gaia_create_routing_get_last_error (const
2102  void
2103  *cache);
2104 
2105  SPATIALITE_DECLARE int gaiaGPKG2Spatialite (sqlite3 * handle_in,
2106  const char *gpkg_in_path,
2107  sqlite3 * handle_out,
2108  const char *splite_out_path);
2109 
2110  SPATIALITE_DECLARE int gaiaSpatialite2GPKG (sqlite3 * handle_in,
2111  const char *splite_in_path,
2112  sqlite3 * handle_out,
2113  const char *gpkg_out_path);
2114 
2115  SPATIALITE_DECLARE const void *gaiaGetCurrentProjContext (const void
2116  *cache);
2117 
2118  SPATIALITE_DECLARE int gaiaSetCurrentCachedProj (const void
2119  *cache, void *pj,
2120  const char *proj_string_1,
2121  const char *proj_string_2,
2122  void *area);
2123 
2124  SPATIALITE_DECLARE void *gaiaGetCurrentCachedProj (const void *cache);
2125 
2126  SPATIALITE_DECLARE int gaiaCurrentCachedProjMatches (const void *cache,
2127  const char
2128  *proj_string_1,
2129  const char
2130  *proj_string_2,
2131  void *area);
2132 
2133  SPATIALITE_DECLARE char *gaiaGetDbObjectScope (sqlite3 * handle,
2134  const char *db_prefix,
2135  const char *obj_name);
2136 
2137 #ifdef __cplusplus
2138 }
2139 #endif
2140 
2141 #endif /* _SPATIALITE_H */
Geometry handling functions and constants.
SPATIALITE_DECLARE void elementary_geometries_ex3(sqlite3 *sqlite, char *inTable, char *geometry, char *outTable, char *pKey, char *multiId, const void *options, int *rows, int transaction)
Creates a derived table surely containing elementary Geometries.
SPATIALITE_DECLARE int gaiaRenameColumn(sqlite3 *sqlite, const char *prefix, const char *table, const char *old_name, const char *new_name, char **error_message)
Renames a Table's Column.
SPATIALITE_DECLARE int load_zip_shapefile(sqlite3 *sqlite, const char *zip_path, const char *shp_path, const char *table, const char *charset, int srid, const char *geo_column, const char *gtype, const char *pk_column, int coerce2d, int compressed, int verbose, int spatial_index, int text_date, int *rows, int colname_case, char *err_msg)
Loads an external Shapefile (from Zipfile) into a newly created table.
SPATIALITE_DECLARE int insert_epsg_srid(sqlite3 *sqlite, int srid)
Inserts some inlined EPSG definition into the "spatial_ref_sys" table.
SPATIALITE_DECLARE int sanitize_geometry_column_r(const void *p_cache, sqlite3 *sqlite, const char *table, const char *geom, const char *tmp_table, const char *report_path, int *n_invalids, int *n_repaired, int *n_discarded, int *n_failures, char **err_msg)
Sanitizes a Geometry Column making all invalid geometries to be valid.
SPATIALITE_DECLARE void elementary_geometries_ex2(sqlite3 *sqlite, char *inTable, char *geometry, char *outTable, char *pKey, char *multiId, int *rows, int transaction)
Creates a derived table surely containing elementary Geometries.
SPATIALITE_DECLARE void spatialite_cleanup_ex(const void *ptr)
Cleanup a SpatiaLite connection.
SPATIALITE_DECLARE void spatialite_init_ex(sqlite3 *db_handle, const void *ptr, int verbose)
Initializes a SpatiaLite connection.
SPATIALITE_DECLARE int sanitize_geometry_column(sqlite3 *sqlite, const char *table, const char *geom, const char *tmp_table, const char *report_path, int *n_invalids, int *n_repaired, int *n_discarded, int *n_failures, char **err_msg)
Sanitizes a Geometry Column making all invalid geometries to be valid.
SPATIALITE_DECLARE void disable_tiny_point(const void *ptr)
Disables the BLOB-TinyPoint encoding.
SPATIALITE_DECLARE int srid_is_geographic(sqlite3 *sqlite, int srid, int *geographic)
checks a SRID definition from the "spatial_ref_sys" table determining if it is of the geographic type
SPATIALITE_DECLARE int spatial_ref_sys_init(sqlite3 *sqlite, int verbose)
Inserts the inlined EPSG dataset into the "spatial_ref_sys" table.
SPATIALITE_DECLARE void spatialite_shutdown(void)
Finalizes the library.
SPATIALITE_DECLARE void remove_duplicated_rows(sqlite3 *sqlite, char *table)
Remove duplicated rows from a table.
SPATIALITE_DECLARE void check_duplicated_rows(sqlite3 *sqlite, char *table, int *dupl_count)
Checks for duplicated rows into the same table.
SPATIALITE_DECLARE int spatial_ref_sys_init2(sqlite3 *sqlite, int mode, int verbose)
Inserts the inlined EPSG dataset into the "spatial_ref_sys" table.
SPATIALITE_DECLARE int load_shapefile(sqlite3 *sqlite, char *shp_path, char *table, char *charset, int srid, char *column, int coerce2d, int compressed, int verbose, int spatial_index, int *rows, char *err_msg)
Loads an external Shapefile into a newly created table.
SPATIALITE_DECLARE int gaiaDropTableEx2(sqlite3 *sqlite, const char *prefix, const char *table, int transaction)
Drops a layer-table, removing any related dependency.
SPATIALITE_DECLARE int gaiaDropTable5(sqlite3 *sqlite, const char *prefix, const char *table, char **error_message)
Drops a layer-table, removing any related dependency.
SPATIALITE_DECLARE int is_kml_constant(sqlite3 *sqlite, char *table, char *column)
Checks if a column is actually defined into the given table.
SPATIALITE_DECLARE int gaiaDropTable(sqlite3 *sqlite, const char *table)
Drops a layer-table, removing any related dependency.
SPATIALITE_DECLARE void remove_duplicated_rows_ex2(sqlite3 *sqlite, char *table, int *removed, int transaction)
Remove duplicated rows from a table.
SPATIALITE_DECLARE int srid_has_flipped_axes(sqlite3 *sqlite, int srid, int *flipped)
checks a SRID definition from the "spatial_ref_sys" table determining if the axes order is X-Y or Y-X
SPATIALITE_DECLARE char * srid_get_projection(sqlite3 *sqlite, int srid)
checks a SRID definition from the "spatial_ref_sys" table then returning the corresponding Projection...
SPATIALITE_DECLARE char * srid_get_axis(sqlite3 *sqlite, int srid, char axis, char mode)
checks a SRID definition from the "spatial_ref_sys" table then returning an Axis definition
SPATIALITE_DECLARE int load_dbf(sqlite3 *sqlite, char *dbf_path, char *table, char *charset, int verbose, int *rows, char *err_msg)
Loads an external DBF file into a newly created table.
SPATIALITE_DECLARE int load_XL(sqlite3 *sqlite, const char *path, const char *table, unsigned int worksheetIndex, int first_titles, unsigned int *rows, char *err_msg)
Loads an external spreadsheet (.xls) file into a newly created table.
SPATIALITE_DECLARE int gaiaUpdateMetaCatalogStatisticsFromMaster(sqlite3 *handle, const char *master_table, const char *table_name, const char *column_name)
Updates the "splite_metacatalog_statistics" table (using a Master Table).
SPATIALITE_DECLARE int load_dbf_ex(sqlite3 *sqlite, char *dbf_path, char *table, char *pk_column, char *charset, int verbose, int *rows, char *err_msg)
Loads an external DBF file into a newly created table.
SPATIALITE_DECLARE int gaia_create_routing(sqlite3 *db_handle, const void *cache, const char *routing_data_table, const char *virtual_routing_table, const char *input_table, const char *from_column, const char *to_column, const char *geom_column, const char *cost_column, const char *name_column, int a_star_enabled, int bidirectional, const char *oneway_from, const char *oneway_to, int overwrite)
Will attempt to create a VirtualRouting from an input table.
SPATIALITE_DECLARE void * spatialite_alloc_connection(void)
Initializes the internal memory block supporting each connection.
SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetGpkgRTreeFullExtent(sqlite3 *db_handle, const char *db_prefix, const char *name, int srid)
Will attempt to retrieve the Full Extent from an R*Tree (GeoPackage)
SPATIALITE_DECLARE void spatialite_cleanup(void)
Cleanup a SpatiaLite connection.
SPATIALITE_DECLARE int load_zip_dbf(sqlite3 *sqlite, const char *zip_file, const char *dbf_path, const char *table, const char *pk_column, const char *charset, int verbose, int text_date, int *rows, int colname_case, char *err_msg)
Loads an external DBF file (from Zipfile) into a newly created table.
SPATIALITE_DECLARE int dump_shapefile(sqlite3 *sqlite, char *table, char *column, char *shp_path, char *charset, char *geom_type, int verbose, int *rows, char *err_msg)
Dumps a full geometry-table into an external Shapefile.
SPATIALITE_DECLARE int load_dbf_ex2(sqlite3 *sqlite, char *dbf_path, char *table, char *pk_column, char *charset, int verbose, int text_date, int *rows, char *err_msg)
Loads an external DBF file into a newly created table.
SPATIALITE_DECLARE int check_geometry_column(sqlite3 *sqlite, const char *table, const char *geom, const char *report_path, int *n_rows, int *n_invalids, char **err_msg)
Checks a Geometry Column for validity.
SPATIALITE_DECLARE int dump_dbf_ex(sqlite3 *sqlite, char *table, char *dbf_path, char *charset, int *rows, char *err_msg)
Dumps a full table into an external DBF file.
SPATIALITE_DECLARE int dump_shapefile_ex(sqlite3 *sqlite, char *table, char *column, char *shp_path, char *charset, char *geom_type, int verbose, int *rows, int colcase_name, char *err_msg)
Dumps a full geometry-table into an external Shapefile.
SPATIALITE_DECLARE void spatialite_set_verbode_mode(const void *ptr)
Enables reporting GEOS/RTTOPO error and warnings on stderr.
SPATIALITE_DECLARE const char * spatialite_target_cpu(void)
Return the target CPU name.
SPATIALITE_DECLARE void spatialite_set_silent_mode(const void *ptr)
Disables reporting GEOS/RTTOPO error and warnings on stderr.
SPATIALITE_DECLARE void enable_tiny_point(const void *ptr)
Enables the BLOB-TinyPoint encoding.
SPATIALITE_DECLARE sqlite3_int64 math_llabs(sqlite3_int64 value)
A portable replacement for C99 llabs()
SPATIALITE_DECLARE int sanitize_all_geometry_columns_r(const void *p_cache, sqlite3 *sqlite, const char *tmp_prefix, const char *output_dir, int *not_repaired, char **err_msg)
Sanitizes all Geometry Columns making all invalid geometries to be valid.
SPATIALITE_DECLARE int dump_geojson2(sqlite3 *sqlite, char *table, char *geom_col, char *outfile_path, int precision, int lon_lat, int m_coords, int indented, int colname_case, int *rows, char **error_message)
Dumps a full geometry-table into an external GeoJSON file (RFC 7946)
SPATIALITE_DECLARE void remove_duplicated_rows_ex(sqlite3 *sqlite, char *table, int *removed)
Remove duplicated rows from a table.
SPATIALITE_DECLARE int check_geometry_column_r(const void *p_cache, sqlite3 *sqlite, const char *table, const char *geom, const char *report_path, int *n_rows, int *n_invalids, char **err_msg)
Checks a Geometry Column for validity.
SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetRTreeFullExtent(sqlite3 *db_handle, const char *db_prefix, const char *name, int srid)
Will attempt to retrieve the Full Extent from an R*Tree (SpatiaLite)
SPATIALITE_DECLARE int dump_dbf_ex2(sqlite3 *sqlite, char *table, char *dbf_path, char *charset, int *rows, int colname_case, char *err_msg)
Dumps a full table into an external DBF file.
SPATIALITE_DECLARE int load_dbf_ex3(sqlite3 *sqlite, const char *dbf_path, const char *table, const char *pk_column, const char *charset, int verbose, int text_date, int *rows, int colname_case, char *err_msg)
Loads an external DBF file into a newly created table.
SPATIALITE_DECLARE int dump_kml(sqlite3 *sqlite, char *table, char *geom_col, char *kml_path, char *name_col, char *desc_col, int precision)
Dumps a full geometry-table into an external KML file.
SPATIALITE_DECLARE int gaiaDropTableEx3(sqlite3 *sqlite, const char *prefix, const char *table, int transaction, char **error_message)
Drops a layer-table, removing any related dependency.
SPATIALITE_DECLARE void elementary_geometries(sqlite3 *sqlite, char *inTable, char *geometry, char *outTable, char *pKey, char *multiId)
Creates a derived table surely containing elementary Geometries.
SPATIALITE_DECLARE char * srid_get_prime_meridian(sqlite3 *sqlite, int srid)
checks a SRID definition from the "spatial_ref_sys" table then returning the corresponding Prime Meri...
SPATIALITE_DECLARE void gaiaFreeVectorLayersList(gaiaVectorLayersListPtr ptr)
Destroys a VectorLayersList object.
SPATIALITE_DECLARE int check_all_geometry_columns(sqlite3 *sqlite, const char *output_dir, int *n_invalids, char **err_msg)
Checks all Geometry Columns for validity.
SPATIALITE_DECLARE int sanitize_all_geometry_columns(sqlite3 *sqlite, const char *tmp_prefix, const char *output_dir, int *not_repaired, char **err_msg)
Sanitizes all Geometry Columns making all invalid geometries to be valid.
SPATIALITE_DECLARE int load_shapefile_ex2(sqlite3 *sqlite, char *shp_path, char *table, char *charset, int srid, char *geo_column, char *gtype, char *pk_column, int coerce2d, int compressed, int verbose, int spatial_index, int text_date, int *rows, char *err_msg)
Loads an external Shapefile into a newly created table.
SPATIALITE_DECLARE int is_tiny_point_enabled(const void *ptr)
Checks if the BLOB-TinyPoint encoding is enabled or not.
SPATIALITE_DECLARE int dump_geojson_ex(sqlite3 *sqlite, char *table, char *geom_col, char *outfile_path, int precision, int option, int *rows)
Dumps a full geometry-table into an external GeoJSON file (old specification)
SPATIALITE_DECLARE void spatialite_finalize_topologies(const void *ptr)
Partially Cleaning-up a SpatiaLite connection.
SPATIALITE_DECLARE int gaiaCutter(sqlite3 *db_handle, const void *cache, const char *in_db_prefix, const char *input_table, const char *input_geom, const char *blade_db_prefix, const char *blade_table, const char *blade_geom, const char *output_table, int transaction, int ram_tmp_store, char **message)
Will precisely cut the input dataset against polygonal blade(s) and will consequently create and popu...
SPATIALITE_DECLARE int dump_kml_ex(sqlite3 *sqlite, char *table, char *geom_col, char *kml_path, char *name_col, char *desc_col, int precision, int *rows)
Dumps a full geometry-table into an external KML file.
SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetLayerExtent(sqlite3 *handle, const char *table, const char *geometry, int mode)
Queries the Metadata tables returning the Layer Full Extent.
SPATIALITE_DECLARE int load_shapefile_ex3(sqlite3 *sqlite, const char *shp_path, const char *table, const char *charset, int srid, const char *geo_column, const char *gtype, const char *pk_column, int coerce2d, int compressed, int verbose, int spatial_index, int text_date, int *rows, int colname_case, char *err_msg)
Loads an external Shapefile into a newly created table.
SPATIALITE_DECLARE int check_all_geometry_columns_r(const void *p_cache, sqlite3 *sqlite, const char *output_dir, int *n_invalids, char **err_msg)
Checks all Geometry Columns for validity.
Container for Vector Layers List.
Definition: gg_structs.h:841
SPATIALITE_DECLARE int gaiaDropTableEx(sqlite3 *sqlite, const char *prefix, const char *table)
Drops a layer-table, removing any related dependency.
SPATIALITE_DECLARE char * srid_get_datum(sqlite3 *sqlite, int srid)
checks a SRID definition from the "spatial_ref_sys" table then returning the corresponding Datum name
SPATIALITE_DECLARE void spatialite_init(int verbose)
Initializes a SpatiaLite connection.
SPATIALITE_DECLARE int gaiaRenameTable(sqlite3 *sqlite, const char *prefix, const char *old_name, const char *new_name, char **error_message)
Renames a Table.
SPATIALITE_DECLARE int gaiaStatisticsInvalidate(sqlite3 *handle, const char *table, const char *geometry)
Immediately and unconditionally invalidates the already existing Statistics.
SPATIALITE_DECLARE int dump_shapefile_ex2(sqlite3 *sqlite, void *proj_ctx, char *table, char *column, char *shp_path, char *charset, char *geom_type, int verbose, int *rows, int colcase_name, char *err_msg)
Dumps a full geometry-table into an external Shapefile.
SPATIALITE_DECLARE int gaiaUpdateMetaCatalogStatistics(sqlite3 *handle, const char *table, const char *column)
Updates the "splite_metacatalog_statistics" table.
SPATIALITE_DECLARE char * srid_get_spheroid(sqlite3 *sqlite, int srid)
checks a SRID definition from the "spatial_ref_sys" table then returning the corresponding Spheroid n...
SPATIALITE_DECLARE int load_shapefile_ex(sqlite3 *sqlite, char *shp_path, char *table, char *charset, int srid, char *geo_column, char *gtype, char *pk_column, int coerce2d, int compressed, int verbose, int spatial_index, int *rows, char *err_msg)
Loads an external Shapefile into a newly created table.
SPATIALITE_DECLARE const char * spatialite_version(void)
Return the current library version.
SPATIALITE_DECLARE int update_layer_statistics(sqlite3 *sqlite, const char *table, const char *column)
Updates the LAYER_STATICS metadata table.
SPATIALITE_DECLARE int load_geojson(sqlite3 *sqlite, char *path, char *table, char *column, int spatial_index, int srid, int colname_case, int *rows, char **error_message)
Loads an external GeoJSON file into a newly created table.
SPATIALITE_DECLARE int gaia_create_routing_nodes(sqlite3 *db_handle, const void *cache, const char *prefix, const char *table, const char *geom_column, const char *from_column, const char *to_column)
Will attempt to create the Routing Nodes columns for a spatial table.
SPATIALITE_DECLARE double math_round(double value)
A portable replacement for C99 round()
SPATIALITE_DECLARE int srid_is_projected(sqlite3 *sqlite, int srid, int *projected)
checks a SRID definition from the "spatial_ref_sys" table determining if it is of the projected type
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:226
SPATIALITE_DECLARE gaiaVectorLayersListPtr gaiaGetVectorLayersList(sqlite3 *handle, const char *table, const char *geometry, int mode)
Queries the Metadata tables supporting Vector Layers.
SPATIALITE_DECLARE void elementary_geometries_ex(sqlite3 *sqlite, char *inTable, char *geometry, char *outTable, char *pKey, char *multiId, int *rows)
Creates a derived table surely containing elementary Geometries.
SPATIALITE_DECLARE void spatialite_initialize(void)
Initializes the library.
SPATIALITE_DECLARE int dump_dbf(sqlite3 *sqlite, char *table, char *dbf_path, char *charset, char *err_msg)
Dumps a full table into an external DBF file.
SPATIALITE_DECLARE char * srid_get_unit(sqlite3 *sqlite, int srid)
checks a SRID definition from the "spatial_ref_sys" table then returning the corresponding Unit name
SPATIALITE_DECLARE int gaiaCreateMetaCatalogTables(sqlite3 *handle)
Creates (or re-creates) the "splite_metacatalog" and "splite_metacalog_statistics" tables.
SPATIALITE_DECLARE int dump_geojson(sqlite3 *sqlite, char *table, char *geom_col, char *outfile_path, int precision, int option)
Dumps a full geometry-table into an external GeoJSON file (old specification)
SPATIALITE_DECLARE void spatialite_init_geos(void)
Initializes the GEOS library.