SpatiaLite  4.0.0
 All Data Structures Files Functions Variables Typedefs Macros Pages
spatialite.h
Go to the documentation of this file.
1 /*
2  spatialite.h -- Gaia spatial support for SQLite
3 
4  version 4.0, 2012 August 6
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-2012
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 #ifdef __cplusplus
68 extern "C"
69 {
70 #endif
71 
72 #include <spatialite/gaiageo.h>
73 
77  SPATIALITE_DECLARE const char *spatialite_version (void);
78 
88  SPATIALITE_DECLARE void spatialite_init (int verbose);
89 
96  SPATIALITE_DECLARE void spatialite_init_geos (void);
97 
106  SPATIALITE_DECLARE void spatialite_cleanup (void);
107 
123  SPATIALITE_DECLARE int dump_shapefile (sqlite3 * sqlite, char *table,
124  char *column, char *shp_path,
125  char *charset, char *geom_type,
126  int verbose, int *rows,
127  char *err_msg);
128 
152  SPATIALITE_DECLARE int load_shapefile (sqlite3 * sqlite, char *shp_path,
153  char *table, char *charset, int srid,
154  char *column, int coerce2d,
155  int compressed, int verbose,
156  int spatial_index, int *rows,
157  char *err_msg);
158 
195  SPATIALITE_DECLARE int load_shapefile_ex (sqlite3 * sqlite, char *shp_path,
196  char *table, char *charset,
197  int srid, char *geo_column,
198  char *gtype, char *pk_column,
199  int coerce2d, int compressed,
200  int verbose, int spatial_index,
201  int *rows, char *err_msg);
202 
221  SPATIALITE_DECLARE int load_dbf (sqlite3 * sqlite, char *dbf_path,
222  char *table, char *charset, int verbose,
223  int *rows, char *err_msg);
224 
242  SPATIALITE_DECLARE int load_dbf_ex (sqlite3 * sqlite, char *dbf_path,
243  char *table, char *pk_column,
244  char *charset, int verbose, int *rows,
245  char *err_msg);
246 
247 
259  SPATIALITE_DECLARE int dump_dbf (sqlite3 * sqlite, char *table,
260  char *dbf_path, char *charset,
261  char *err_msg);
262 
276  SPATIALITE_DECLARE int load_XL (sqlite3 * sqlite, const char *path,
277  const char *table,
278  unsigned int worksheetIndex,
279  int first_titles, unsigned int *rows,
280  char *err_msg);
281 
289  SPATIALITE_DECLARE double math_round (double value);
290 
298  SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value);
299 
315  SPATIALITE_DECLARE int spatial_ref_sys_init (sqlite3 * sqlite, int verbose);
316 
329  SPATIALITE_DECLARE int spatial_ref_sys_init2 (sqlite3 * sqlite, int mode,
330  int verbose);
331 
340  SPATIALITE_DECLARE int insert_epsg_srid (sqlite3 * sqlite, int srid);
341 
353  SPATIALITE_DECLARE int
354  is_kml_constant (sqlite3 * sqlite, char *table, char *column);
355 
369  SPATIALITE_DECLARE int dump_kml (sqlite3 * sqlite, char *table,
370  char *geom_col, char *kml_path,
371  char *name_col, char *desc_col,
372  int precision);
373 
386  SPATIALITE_DECLARE void check_duplicated_rows (sqlite3 * sqlite,
387  char *table,
388  int *dupl_count);
389 
401  SPATIALITE_DECLARE void remove_duplicated_rows (sqlite3 * sqlite,
402  char *table);
403 
421  SPATIALITE_DECLARE void elementary_geometries (sqlite3 * sqlite,
422  char *inTable,
423  char *geometry,
424  char *outTable, char *pKey,
425  char *multiId);
426 
447  SPATIALITE_DECLARE int dump_geojson (sqlite3 * sqlite, char *table,
448  char *geom_col, char *outfile_path,
449  int precision, int option);
450 
472  SPATIALITE_DECLARE int update_layer_statistics (sqlite3 * sqlite,
473  const char *table,
474  const char *column);
475 
498  SPATIALITE_DECLARE gaiaVectorLayersListPtr gaiaGetVectorLayersList (sqlite3 *
499  handle, const char *table, const char *geometry, int mode);
500 
508  SPATIALITE_DECLARE void gaiaFreeVectorLayersList (gaiaVectorLayersListPtr ptr);
509 
523  SPATIALITE_DECLARE int gaiaDropTable (sqlite3 * sqlite, const char *table);
524 
525 #ifdef __cplusplus
526 }
527 #endif
528 
529 #endif /* _SPATIALITE_H */