SpatiaLite  4.0.0-RC1
 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 
75  SPATIALITE_DECLARE const char *spatialite_version (void);
76 
86  SPATIALITE_DECLARE void spatialite_init (int verbose);
87 
94  SPATIALITE_DECLARE void spatialite_init_geos (void);
95 
104  SPATIALITE_DECLARE void spatialite_cleanup (void);
105 
121  SPATIALITE_DECLARE int dump_shapefile (sqlite3 * sqlite, char *table,
122  char *column, char *shp_path,
123  char *charset, char *geom_type,
124  int verbose, int *rows,
125  char *err_msg);
126 
150  SPATIALITE_DECLARE int load_shapefile (sqlite3 * sqlite, char *shp_path,
151  char *table, char *charset, int srid,
152  char *column, int coerce2d,
153  int compressed, int verbose,
154  int spatial_index, int *rows,
155  char *err_msg);
156 
193  SPATIALITE_DECLARE int load_shapefile_ex (sqlite3 * sqlite, char *shp_path,
194  char *table, char *charset,
195  int srid, char *geo_column,
196  char *gtype, char *pk_column,
197  int coerce2d, int compressed,
198  int verbose, int spatial_index,
199  int *rows, char *err_msg);
200 
219  SPATIALITE_DECLARE int load_dbf (sqlite3 * sqlite, char *dbf_path,
220  char *table, char *charset, int verbose,
221  int *rows, char *err_msg);
222 
240  SPATIALITE_DECLARE int load_dbf_ex (sqlite3 * sqlite, char *dbf_path,
241  char *table, char *pk_column,
242  char *charset, int verbose, int *rows,
243  char *err_msg);
244 
245 
257  SPATIALITE_DECLARE int dump_dbf (sqlite3 * sqlite, char *table,
258  char *dbf_path, char *charset,
259  char *err_msg);
260 
274  SPATIALITE_DECLARE int load_XL (sqlite3 * sqlite, const char *path,
275  const char *table,
276  unsigned int worksheetIndex,
277  int first_titles, unsigned int *rows,
278  char *err_msg);
279 
287  SPATIALITE_DECLARE double math_round (double value);
288 
296  SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value);
297 
313  SPATIALITE_DECLARE int spatial_ref_sys_init (sqlite3 * sqlite, int verbose);
314 
327  SPATIALITE_DECLARE int spatial_ref_sys_init2 (sqlite3 * sqlite, int mode,
328  int verbose);
329 
338  SPATIALITE_DECLARE int insert_epsg_srid (sqlite3 * sqlite, int srid);
339 
351  SPATIALITE_DECLARE int
352  is_kml_constant (sqlite3 * sqlite, char *table, char *column);
353 
367  SPATIALITE_DECLARE int dump_kml (sqlite3 * sqlite, char *table,
368  char *geom_col, char *kml_path,
369  char *name_col, char *desc_col,
370  int precision);
371 
384  SPATIALITE_DECLARE void check_duplicated_rows (sqlite3 * sqlite,
385  char *table,
386  int *dupl_count);
387 
399  SPATIALITE_DECLARE void remove_duplicated_rows (sqlite3 * sqlite,
400  char *table);
401 
419  SPATIALITE_DECLARE void elementary_geometries (sqlite3 * sqlite,
420  char *inTable,
421  char *geometry,
422  char *outTable, char *pKey,
423  char *multiId);
424 
445  SPATIALITE_DECLARE int dump_geojson (sqlite3 * sqlite, char *table,
446  char *geom_col, char *outfile_path,
447  int precision, int option);
448 
470  SPATIALITE_DECLARE int update_layer_statistics (sqlite3 * sqlite,
471  const char *table,
472  const char *column);
473 
474 #ifdef __cplusplus
475 }
476 #endif
477 
478 #endif /* _SPATIALITE_H */