SpatiaLite
4.3.0
|
Main SpatiaLite header file. More...
#include <spatialite/gaiageo.h>
Go to the source code of this file.
Macros | |
#define | SPLITE_AXIS_1 0x51 |
#define | SPLITE_AXIS_2 0x52 |
#define | SPLITE_AXIS_NAME 0x3e |
#define | SPLITE_AXIS_ORIENTATION 0x3f |
Functions | |
SPATIALITE_DECLARE void | spatialite_initialize (void) |
Initializes the library. More... | |
SPATIALITE_DECLARE void | spatialite_shutdown (void) |
Finalizes the library. More... | |
SPATIALITE_DECLARE const char * | spatialite_version (void) |
Return the current library version. More... | |
SPATIALITE_DECLARE const char * | spatialite_target_cpu (void) |
Return the target CPU name. More... | |
SPATIALITE_DECLARE void * | spatialite_alloc_connection (void) |
Initializes the internal memory block supporting each connection. More... | |
SPATIALITE_DECLARE void | spatialite_init (int verbose) |
Initializes a SpatiaLite connection. More... | |
SPATIALITE_DECLARE void | spatialite_init_ex (sqlite3 *db_handle, const void *ptr, int verbose) |
Initializes a SpatiaLite connection. More... | |
SPATIALITE_DECLARE void | spatialite_init_geos (void) |
Initializes the GEOS library. More... | |
SPATIALITE_DECLARE void | spatialite_cleanup (void) |
Cleanup a SpatiaLite connection. More... | |
SPATIALITE_DECLARE void | spatialite_cleanup_ex (const void *ptr) |
Cleanup a SpatiaLite connection. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
SPATIALITE_DECLARE double | math_round (double value) |
A portable replacement for C99 round() More... | |
SPATIALITE_DECLARE sqlite3_int64 | math_llabs (sqlite3_int64 value) |
A portable replacement for C99 llabs() More... | |
SPATIALITE_DECLARE int | spatial_ref_sys_init (sqlite3 *sqlite, int verbose) |
Inserts the inlined EPSG dataset into the "spatial_ref_sys" table. More... | |
SPATIALITE_DECLARE int | spatial_ref_sys_init2 (sqlite3 *sqlite, int mode, int verbose) |
Inserts the inlined EPSG dataset into the "spatial_ref_sys" table. More... | |
SPATIALITE_DECLARE int | insert_epsg_srid (sqlite3 *sqlite, int srid) |
Inserts some inlined EPSG definition into the "spatial_ref_sys" table. More... | |
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 More... | |
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 More... | |
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 More... | |
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 name More... | |
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 Meridian name More... | |
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 name More... | |
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 More... | |
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 More... | |
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 More... | |
SPATIALITE_DECLARE int | is_kml_constant (sqlite3 *sqlite, char *table, char *column) |
Checks if a column is actually defined into the given table. More... | |
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. More... | |
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. More... | |
SPATIALITE_DECLARE void | check_duplicated_rows (sqlite3 *sqlite, char *table, int *dupl_count) |
Checks for duplicated rows into the same table. More... | |
SPATIALITE_DECLARE void | remove_duplicated_rows (sqlite3 *sqlite, char *table) |
Remove duplicated rows from a table. More... | |
SPATIALITE_DECLARE void | remove_duplicated_rows_ex (sqlite3 *sqlite, char *table, int *removed) |
Remove duplicated rows from a table. More... | |
SPATIALITE_DECLARE void | remove_duplicated_rows_ex2 (sqlite3 *sqlite, char *table, int *removed, int transaction) |
Remove duplicated rows from a table. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
SPATIALITE_DECLARE int | update_layer_statistics (sqlite3 *sqlite, const char *table, const char *column) |
Updates the LAYER_STATICS metadata table. More... | |
SPATIALITE_DECLARE int | gaiaStatisticsInvalidate (sqlite3 *handle, const char *table, const char *geometry) |
Immediately and unconditionally invalidates the already existing Statistics. More... | |
SPATIALITE_DECLARE gaiaGeomCollPtr | gaiaGetLayerExtent (sqlite3 *handle, const char *table, const char *geometry, int mode) |
Queries the Metadata tables returning the Layer Full Extent. More... | |
SPATIALITE_DECLARE gaiaVectorLayersListPtr | gaiaGetVectorLayersList (sqlite3 *handle, const char *table, const char *geometry, int mode) |
Queries the Metadata tables supporting Vector Layers. More... | |
SPATIALITE_DECLARE int | gaiaCreateMetaCatalogTables (sqlite3 *handle) |
Creates (or re-creates) the "splite_metacatalog" and "splite_metacalog_statistics" tables. More... | |
SPATIALITE_DECLARE int | gaiaUpdateMetaCatalogStatistics (sqlite3 *handle, const char *table, const char *column) |
Updates the "splite_metacatalog_statistics" table. More... | |
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). More... | |
SPATIALITE_DECLARE void | gaiaFreeVectorLayersList (gaiaVectorLayersListPtr ptr) |
Destroys a VectorLayersList object. More... | |
SPATIALITE_DECLARE int | gaiaDropTable (sqlite3 *sqlite, const char *table) |
Drops a layer-table, removing any related dependency. More... | |
SPATIALITE_DECLARE int | gaiaDropTableEx (sqlite3 *sqlite, const char *prefix, const char *table) |
Drops a layer-table, removing any related dependency. More... | |
SPATIALITE_DECLARE int | gaiaDropTableEx2 (sqlite3 *sqlite, const char *prefix, const char *table, int transaction) |
Drops a layer-table, removing any related dependency. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
SPATIALITE_DECLARE int | gaiaGPKG2Spatialite (sqlite3 *handle_in, const char *gpkg_in_path, sqlite3 *handle_out, const char *splite_out_path) |
SPATIALITE_DECLARE int | gaiaSpatialite2GPKG (sqlite3 *handle_in, const char *splite_in_path, sqlite3 *handle_out, const char *gpkg_out_path) |
Main SpatiaLite header file.
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.
sqlite | handle to current DB connection |
output_dir | pathname of the directory to be created for report-files |
n_invalids | if this variable is not NULL on successful completion will contain the total number of invalid Geometries found |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
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.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
sqlite | handle to current DB connection |
output_dir | pathname of the directory to be created for report-files |
n_invalids | if this variable is not NULL on successful completion will contain the total number of invalid Geometries found |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
SPATIALITE_DECLARE void check_duplicated_rows | ( | sqlite3 * | sqlite, |
char * | table, | ||
int * | dupl_count | ||
) |
Checks for duplicated rows into the same table.
sqlite | handle to current DB connection |
table | name of the table to be checked |
dupl_count | on completion will contain the number of duplicated rows found |
value (excluding any Primary Key column) is exacly the same
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.
sqlite | handle to current DB connection |
table | name of the table |
geometry | name of the column to be checked |
report_path | pathname of the report-file |
n_rows | if this variable is not NULL on successful completion will contain the total number of rows found into the checkeck table |
n_invalids | if this variable is not NULL on successful completion will contain the total number of invalid Geometries found into the checkeck table |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
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.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
sqlite | handle to current DB connection |
table | name of the table |
geometry | name of the column to be checked |
report_path | pathname of the report-file |
n_rows | if this variable is not NULL on successful completion will contain the total number of rows found into the checkeck table |
n_invalids | if this variable is not NULL on successful completion will contain the total number of invalid Geometries found into the checkeck table |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
dbf_path | pathname of the DBF to be exported |
charset | a valid GNU ICONV charset to be used for DBF text strings |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
dbf_path | pathname of the DBF to be exported |
charset | a valid GNU ICONV charset to be used for DBF text strings |
rows | on completion will contain the total number of exported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
geom_col | the name of the geometry column |
outfile_path | pathname for the GeoJSON file to be written to |
precision | number of decimal digits for coordinates |
option | the format to use for output |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
geom_col | the name of the geometry column |
outfile_path | pathname for the GeoJSON file to be written to |
precision | number of decimal digits for coordinates |
option | the format to use for output |
rows | on completion will contain the total number of exported rows |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
geom_col | the name of the geometry column |
kml_path | pathname of the KML file to be exported |
name_col | column to be used for KML "name" (may be null) |
desc_col | column to be used for KML "description" (may be null) |
precision | number of decimal digits for coordinates |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
geom_col | the name of the geometry column |
kml_path | pathname of the KML file to be exported |
name_col | column to be used for KML "name" (may be null) |
desc_col | column to be used for KML "description" (may be null) |
precision | number of decimal digits for coordinates |
rows | on completion will contain the total number of exported rows |
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.
sqlite | handle to current DB connection |
table | the name of the table to be exported |
column | the name of the geometry column |
shp_path | pathname of the Shapefile to be exported (no suffix) |
charset | a valid GNU ICONV charset to be used for DBF text strings |
geom_type | "POINT", "LINESTRING", "POLYGON", "MULTIPOLYGON" or NULL |
verbose | if TRUE a short report is shown on stderr |
rows | on completion will contain the total number of exported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
inTable | name of the input table |
geometry | name of the Geometry column |
outTable | name of the output table to be created |
pKey | name of the Primary Key column in the output table |
multiId | name of the column identifying origins in the output table |
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.
sqlite | handle to current DB connection |
inTable | name of the input table |
geometry | name of the Geometry column |
outTable | name of the output table to be created |
pKey | name of the Primary Key column in the output table |
multiId | name of the column identifying origins in the output table |
rows | on completion will contain the total number of inserted rows |
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.
sqlite | handle to current DB connection |
inTable | name of the input table |
geometry | name of the Geometry column |
outTable | name of the output table to be created |
pKey | name of the Primary Key column in the output table |
multiId | name of the column identifying origins in the output table |
rows | on completion will contain the total number of inserted rows |
transaction | boolena; if set to TRUE will internally handle a SQL Transaction |
SPATIALITE_DECLARE int gaiaCreateMetaCatalogTables | ( | sqlite3 * | handle | ) |
Creates (or re-creates) the "splite_metacatalog" and "splite_metacalog_statistics" tables.
handle | SQLite handle to current DB connection. |
SPATIALITE_DECLARE int gaiaDropTable | ( | sqlite3 * | sqlite, |
const char * | table | ||
) |
Drops a layer-table, removing any related dependency.
sqlite | handle to current DB connection |
table | name of the table to be removed |
SPATIALITE_DECLARE int gaiaDropTableEx | ( | sqlite3 * | sqlite, |
const char * | prefix, | ||
const char * | table | ||
) |
Drops a layer-table, removing any related dependency.
sqlite | handle to current DB connection |
prefix | schema prefix identifying the target DB "main" always identifies the main DB (primary, not Attached). |
table | name of the table to be removed |
SPATIALITE_DECLARE int gaiaDropTableEx2 | ( | sqlite3 * | sqlite, |
const char * | prefix, | ||
const char * | table, | ||
int | transaction | ||
) |
Drops a layer-table, removing any related dependency.
sqlite | handle to current DB connection |
prefix | schema prefix identifying the target DB "main" always identifies the main DB (primary, not Attached). |
table | name of the table to be removed |
transaction | boolena; if set to TRUE will internally handle a SQL Transaction |
SPATIALITE_DECLARE void gaiaFreeVectorLayersList | ( | gaiaVectorLayersListPtr | ptr | ) |
Destroys a VectorLayersList object.
ptr | pointer to the VectorLayersList object to be destroyed |
SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetLayerExtent | ( | sqlite3 * | handle, |
const char * | table, | ||
const char * | geometry, | ||
int | mode | ||
) |
Queries the Metadata tables returning the Layer Full Extent.
handle | SQLite handle to current DB connection. |
table | VectorLayer Table (or View, or VirtualShape). |
geometry | Geometry Column name. |
mode | if TRUE a PESSIMISTIC statistics update will be implied, otherwise OPTIMISTIC. |
SPATIALITE_DECLARE gaiaVectorLayersListPtr gaiaGetVectorLayersList | ( | sqlite3 * | handle, |
const char * | table, | ||
const char * | geometry, | ||
int | mode | ||
) |
Queries the Metadata tables supporting Vector Layers.
handle | SQLite handle to current DB connection. |
table | VectorLayer Table (or View, or VirtualShape). |
geometry | Geometry Column name. |
mode | one of GAIA_VECTORS_LIST_OPTIMISTIC or GAIA_VECTORS_LIST_PESSIMISTIC. |
SPATIALITE_DECLARE int gaiaStatisticsInvalidate | ( | sqlite3 * | handle, |
const char * | table, | ||
const char * | geometry | ||
) |
Immediately and unconditionally invalidates the already existing Statistics.
handle | SQLite handle to current DB connection. |
table | VectorLayer Table (or View, or VirtualShape). |
geometry | Geometry Column name. |
SPATIALITE_DECLARE int gaiaUpdateMetaCatalogStatistics | ( | sqlite3 * | handle, |
const char * | table, | ||
const char * | column | ||
) |
Updates the "splite_metacatalog_statistics" table.
handle | SQLite handle to current DB connection. |
table | name of the table to be processed. |
column | name of the column to be processed. |
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).
handle | SQLite handle to current DB connection. |
master_table | name of the master-table controlling the whole process. |
table_name | name of the column into the master-table containing table-names. |
column_name | name of the column into the master-table containing column-names. |
SPATIALITE_DECLARE int insert_epsg_srid | ( | sqlite3 * | sqlite, |
int | srid | ||
) |
Inserts some inlined EPSG definition into the "spatial_ref_sys" table.
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
SPATIALITE_DECLARE int is_kml_constant | ( | sqlite3 * | sqlite, |
char * | table, | ||
char * | column | ||
) |
Checks if a column is actually defined into the given table.
sqlite | handle to current DB connection |
table | the table to be checked |
column | the column to be checked |
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.
sqlite | handle to current DB connection |
dbf_path | pathname of the DBF file to be imported |
table | the name of the table to be created |
charset | a valid GNU ICONV charset to be used for DBF text strings |
verbose | if TRUE a short report is shown on stderr |
rows | on completion will contain the total number of actually exported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
dbf_path | pathname of the DBF file to be imported |
table | the name of the table to be created |
pk_column | name of the Primary Key column; if NULL or mismatching then "PK_UID" will be assumed by default. |
charset | a valid GNU ICONV charset to be used for DBF text strings |
verbose | if TRUE a short report is shown on stderr |
rows | on completion will contain the total number of actually exported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
dbf_path | pathname of the DBF file to be imported |
table | the name of the table to be created |
pk_column | name of the Primary Key column; if NULL or mismatching then "PK_UID" will be assumed by default. |
charset | a valid GNU ICONV charset to be used for DBF text strings |
verbose | if TRUE a short report is shown on stderr |
text_dates | is TRUE all DBF dates will be considered as TEXT |
rows | on completion will contain the total number of imported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
shp_path | pathname of the Shapefile to be imported (no suffix) |
table | the name of the table to be created |
charset | a valid GNU ICONV charset to be used for DBF text strings |
srid | the SRID to be set for Geometries |
column | the name of the geometry column |
coerce2d | if TRUE any Geometry will be casted to 2D [XY] |
compressed | if TRUE compressed Geometries will be created |
verbose | if TRUE a short report is shown on stderr |
spatial_index | if TRUE an R*Tree Spatial Index will be created |
rows | on completion will contain the total number of imported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
shp_path | pathname of the Shapefile to be imported (no suffix) |
table | the name of the table to be created |
charset | a valid GNU ICONV charset to be used for DBF text strings |
srid | the SRID to be set for Geometries |
geo_column | the name of the geometry column |
gtype | expected to be one of: "LINESTRING", "LINESTRINGZ", "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ", "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM", "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM", "MULTIPOLYGONZM" or "AUTO". |
pk_column | name of the Primary Key column; if NULL or mismatching then "PK_UID" will be assumed by default. |
coerce2d | if TRUE any Geometry will be casted to 2D [XY] |
compressed | if TRUE compressed Geometries will be created |
verbose | if TRUE a short report is shown on stderr |
spatial_index | if TRUE an R*Tree Spatial Index will be created |
rows | on completion will contain the total number of imported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
shp_path | pathname of the Shapefile to be imported (no suffix) |
table | the name of the table to be created |
charset | a valid GNU ICONV charset to be used for DBF text strings |
srid | the SRID to be set for Geometries |
geo_column | the name of the geometry column |
gtype | expected to be one of: "LINESTRING", "LINESTRINGZ", "LINESTRINGM", "LINESTRINGZM", "MULTILINESTRING", "MULTILINESTRINGZ", "MULTILINESTRINGM", "MULTILINESTRINGZM", "POLYGON", "POLYGONZ", "POLYGONM", "POLYGONZM", "MULTIPOLYGON", "MULTIPOLYGONZ", "MULTIPOLYGONM", "MULTIPOLYGONZM" or "AUTO". |
pk_column | name of the Primary Key column; if NULL or mismatching then "PK_UID" will be assumed by default. |
coerce2d | if TRUE any Geometry will be casted to 2D [XY] |
compressed | if TRUE compressed Geometries will be created |
verbose | if TRUE a short report is shown on stderr |
spatial_index | if TRUE an R*Tree Spatial Index will be created |
text_dates | is TRUE all DBF dates will be considered as TEXT |
rows | on completion will contain the total number of imported rows |
err_msg | on completion will contain an error message (if any) |
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.
sqlite | handle to current DB connection |
path | pathname of the spreadsheet file to be imported |
table | the name of the table to be created |
worksheetIndex | the index identifying the worksheet to be imported |
first_titles | if TRUE the first line is assumed to contain column names |
rows | on completion will contain the total number of actually exported rows |
err_msg | on completion will contain an error message (if any) |
SPATIALITE_DECLARE sqlite3_int64 math_llabs | ( | sqlite3_int64 | value | ) |
A portable replacement for C99 llabs()
value | a 64 bit integer value |
SPATIALITE_DECLARE double math_round | ( | double | value | ) |
A portable replacement for C99 round()
value | a double value |
SPATIALITE_DECLARE void remove_duplicated_rows | ( | sqlite3 * | sqlite, |
char * | table | ||
) |
Remove duplicated rows from a table.
sqlite | handle to current DB connection |
table | name of the table to be cleaned |
SPATIALITE_DECLARE void remove_duplicated_rows_ex | ( | sqlite3 * | sqlite, |
char * | table, | ||
int * | removed | ||
) |
Remove duplicated rows from a table.
sqlite | handle to current DB connection |
table | name of the table to be cleaned |
removed | on successful completion will contain the total count of removed duplicate rows |
SPATIALITE_DECLARE void remove_duplicated_rows_ex2 | ( | sqlite3 * | sqlite, |
char * | table, | ||
int * | removed, | ||
int | transaction | ||
) |
Remove duplicated rows from a table.
sqlite | handle to current DB connection |
table | name of the table to be cleaned |
removed | on successful completion will contain the total count of removed duplicate rows |
transaction | boolena; if set to TRUE will internally handle a SQL Transaction |
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.
sqlite | handle to current DB connection |
tmp_prefix | name-prefix for temporary tables |
output_dir | pathname of the directory to be created for report-files |
not_repaired | if this variable is not NULL on successful completion will contain the total count of repair failures (i.e. Geometries beyond possible repair) |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
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.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
sqlite | handle to current DB connection |
tmp_prefix | name-prefix for temporary tables |
output_dir | pathname of the directory to be created for report-files |
not_repaired | if this variable is not NULL on successful completion will contain the total count of repair failures (i.e. Geometries beyond possible repair) |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
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.
sqlite | handle to current DB connection |
table | name of the table |
geometry | name of the column to be checked |
tmp_table | name of the temporary table |
report_path | pathname of the report-file |
n_invalids | if this variable is not NULL on successful completion will contain the total number of invalid Geometries found into the sanitize table |
n_repaired | if this variable is not NULL on successful completion will contain the total number of repaired Geometries |
n_discarded | if this variable is not NULL on successful completion will contain the total number of repaired Geometries (by discarding fragments) |
n_failures | if this variable is not NULL on successful completion will contain the total number of repair failures (i.e. Geometries beyond possible repair) |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
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.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
sqlite | handle to current DB connection |
table | name of the table |
geometry | name of the column to be checked |
tmp_table | name of the temporary table |
report_path | pathname of the report-file |
n_invalids | if this variable is not NULL on successful completion will contain the total number of invalid Geometries found into the sanitize table |
n_repaired | if this variable is not NULL on successful completion will contain the total number of repaired Geometries |
n_discarded | if this variable is not NULL on successful completion will contain the total number of repaired Geometries (by discarding fragments) |
n_failures | if this variable is not NULL on successful completion will contain the total number of repair failures (i.e. Geometries beyond possible repair) |
err_msg | if this variable is not NULL and the return status is ZERO (failure), an appropriate error message will be returned |
SPATIALITE_DECLARE int spatial_ref_sys_init | ( | sqlite3 * | sqlite, |
int | verbose | ||
) |
Inserts the inlined EPSG dataset into the "spatial_ref_sys" table.
sqlite | handle to current DB connection |
verbose | if TRUE a short report is shown on stderr |
SPATIALITE_DECLARE int spatial_ref_sys_init2 | ( | sqlite3 * | sqlite, |
int | mode, | ||
int | verbose | ||
) |
Inserts the inlined EPSG dataset into the "spatial_ref_sys" table.
sqlite | handle to current DB connection |
mode | can be one of GAIA_EPSG_ANY, GAIA_EPSG_NONE or GAIA_EPSG_WGS84_ONLY |
verbose | if TRUE a short report is shown on stderr |
SPATIALITE_DECLARE void* spatialite_alloc_connection | ( | void | ) |
Initializes the internal memory block supporting each connection.
SPATIALITE_DECLARE void spatialite_cleanup | ( | void | ) |
Cleanup a SpatiaLite connection.
This function is now DEPRECATED; use spatialite_cleanup_ex() for all new development.
This function performs general cleanup, essentially undoing the effect of spatialite_init().
SPATIALITE_DECLARE void spatialite_cleanup_ex | ( | const void * | ptr | ) |
Cleanup a SpatiaLite connection.
This function performs general cleanup, essentially undoing the effect of spatialite_init_ex().
ptr | the same memory pointer passed to the corresponding call to spatialite_init_ex() and returned by spatialite_alloc_connection() |
SPATIALITE_DECLARE void spatialite_init | ( | int | verbose | ) |
Initializes a SpatiaLite connection.
This function is now DEPRECATED because is not reentrant (not thread safe); use spatialite_init_ex() for all new development.
verbose | if TRUE a short start-up message is shown on stderr |
SPATIALITE_DECLARE void spatialite_init_ex | ( | sqlite3 * | db_handle, |
const void * | ptr, | ||
int | verbose | ||
) |
Initializes a SpatiaLite connection.
db_handle | handle to the current SQLite connection |
ptr | a memory pointer returned by spatialite_alloc_connection() |
verbose | if TRUE a short start-up message is shown on stderr |
SPATIALITE_DECLARE void spatialite_init_geos | ( | void | ) |
Initializes the GEOS library.
SPATIALITE_DECLARE void spatialite_initialize | ( | void | ) |
Initializes the library.
SPATIALITE_DECLARE void spatialite_shutdown | ( | void | ) |
Finalizes the library.
SPATIALITE_DECLARE const char* spatialite_target_cpu | ( | void | ) |
Return the target CPU name.
SPATIALITE_DECLARE const char* spatialite_version | ( | void | ) |
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
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
axis | should be one of SPLITE_AXIS_1 or SPLITE_AXIS_2 |
mode | should be one of SPLITE_AXIS_NAME or SPLITE_AXIS_ORIENTATION |
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
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
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 Meridian name
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
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 name
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
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 name
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
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
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
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
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
flipped | on successful completion will contain 0 (FALSE) if axes order is X-Y, any other value (TRUE) if axes order is Y-X. |
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
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
geographic | on successful completion will contain TRUE or FALSE |
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
sqlite | handle to current DB connection |
srid | the SRID value uniquely identifying the required EPSG definition |
projected | on successful completion will contain TRUE or FALSE |
SPATIALITE_DECLARE int update_layer_statistics | ( | sqlite3 * | sqlite, |
const char * | table, | ||
const char * | column | ||
) |
Updates the LAYER_STATICS metadata table.
sqlite | handle to current DB connection |
table | name of the table to be processed |
column | name of the geometry to be processed |