SpatiaLite  5.1.0
gg_formats.h
Go to the documentation of this file.
1 /*
2  gg_formats.h -- Gaia common support for geometries: formats
3 
4  version 5.1.0, 2023 August 4
5 
6  Author: Sandro Furieri a.furieri@lqt.it
7 
8  ------------------------------------------------------------------------------
9 
10  Version: MPL 1.1/GPL 2.0/LGPL 2.1
11 
12  The contents of this file are subject to the Mozilla Public License Version
13  1.1 (the "License"); you may not use this file except in compliance with
14  the License. You may obtain a copy of the License at
15  http://www.mozilla.org/MPL/
16 
17 Software distributed under the License is distributed on an "AS IS" basis,
18 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 for the specific language governing rights and limitations under the
20 License.
21 
22 The Original Code is the SpatiaLite library
23 
24 The Initial Developer of the Original Code is Alessandro Furieri
25 
26 Portions created by the Initial Developer are Copyright (C) 2008-2023
27 the Initial Developer. All Rights Reserved.
28 
29 Contributor(s):
30 Klaus Foerster klaus.foerster@svg.cc
31 
32 Alternatively, the contents of this file may be used under the terms of
33 either the GNU General Public License Version 2 or later (the "GPL"), or
34 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
35 in which case the provisions of the GPL or the LGPL are applicable instead
36 of those above. If you wish to allow use of your version of this file only
37 under the terms of either the GPL or the LGPL, and not to allow others to
38 use your version of this file under the terms of the MPL, indicate your
39 decision by deleting the provisions above and replace them with the notice
40 and other provisions required by the GPL or the LGPL. If you do not delete
41 the provisions above, a recipient may use your version of this file under
42 the terms of any one of the MPL, the GPL or the LGPL.
43 
44 */
45 
46 
53 #ifndef _GG_FORMATS_H
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 #define _GG_FORMATS_H
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 /* function prototypes */
64 
70  GAIAGEO_DECLARE int gaiaEndianArch (void);
71 
87  GAIAGEO_DECLARE short gaiaImport16 (const unsigned char *p,
88  int little_endian,
89  int little_endian_arch);
90 
106  GAIAGEO_DECLARE int gaiaImport32 (const unsigned char *p,
107  int little_endian,
108  int little_endian_arch);
109 
125  GAIAGEO_DECLARE unsigned int gaiaImportU32 (const unsigned char *p,
126  int little_endian,
127  int little_endian_arch);
128 
144  GAIAGEO_DECLARE float gaiaImportF32 (const unsigned char *p,
145  int little_endian,
146  int little_endian_arch);
147 
163  GAIAGEO_DECLARE double gaiaImport64 (const unsigned char *p,
164  int little_endian,
165  int little_endian_arch);
166 
182  GAIAGEO_DECLARE sqlite3_int64 gaiaImportI64 (const unsigned char *p,
183  int little_endian,
184  int little_endian_arch);
185 
200  GAIAGEO_DECLARE void gaiaExport16 (unsigned char *p, short value,
201  int little_endian,
202  int little_endian_arch);
203 
218  GAIAGEO_DECLARE void gaiaExport32 (unsigned char *p, int value,
219  int little_endian,
220  int little_endian_arch);
221 
236  GAIAGEO_DECLARE void gaiaExportU32 (unsigned char *p, unsigned int value,
237  int little_endian,
238  int little_endian_arch);
239 
254  GAIAGEO_DECLARE void gaiaExportF32 (unsigned char *p, float value,
255  int little_endian,
256  int little_endian_arch);
257 
272  GAIAGEO_DECLARE void gaiaExport64 (unsigned char *p, double value,
273  int little_endian,
274  int little_endian_arch);
275 
290  GAIAGEO_DECLARE void gaiaExportI64 (unsigned char *p, sqlite3_int64 value,
291  int little_endian,
292  int little_endian_arch);
293 
309  GAIAGEO_DECLARE void gaiaOutBufferInitialize (gaiaOutBufferPtr buf);
310 
322  GAIAGEO_DECLARE void gaiaOutBufferReset (gaiaOutBufferPtr buf);
323 
337  GAIAGEO_DECLARE void gaiaAppendToOutBuffer (gaiaOutBufferPtr buf,
338  const char *text);
339 
356  GAIAGEO_DECLARE void gaiaMakePoint (double x, double y, int srid,
357  unsigned char **result, int *size);
358 
376  GAIAGEO_DECLARE void gaiaMakePointZ (double x, double y, double z,
377  int srid, unsigned char **result,
378  int *size);
379 
397  GAIAGEO_DECLARE void gaiaMakePointM (double x, double y, double m,
398  int srid, unsigned char **result,
399  int *size);
400 
419  GAIAGEO_DECLARE void gaiaMakePointZM (double x, double y, double z,
420  double m, int srid,
421  unsigned char **result, int *size);
422 
441  GAIAGEO_DECLARE void gaiaMakePointEx (int tiny_point, double x, double y,
442  int srid, unsigned char **result,
443  int *size);
444 
464  GAIAGEO_DECLARE void gaiaMakePointZEx (int tiny_point, double x, double y,
465  double z, int srid,
466  unsigned char **result, int *size);
467 
487  GAIAGEO_DECLARE void gaiaMakePointMEx (int tiny_point, double x, double y,
488  double m, int srid,
489  unsigned char **result, int *size);
490 
511  GAIAGEO_DECLARE void gaiaMakePointZMEx (int tiny_point, double x, double y,
512  double z, double m, int srid,
513  unsigned char **result, int *size);
514 
530  GAIAGEO_DECLARE void gaiaMakeLine (gaiaGeomCollPtr geom1,
531  gaiaGeomCollPtr geom2,
532  unsigned char **result, int *size);
533 
550  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb (const unsigned
551  char *blob,
552  unsigned int
553  size);
554 
574  unsigned char
575  *blob,
576  unsigned int
577  size,
578  int
579  gpkg_mode,
580  int
581  gpkg_amphibious);
582 
597  GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb (gaiaGeomCollPtr geom,
598  unsigned char **result,
599  int *size);
600 
617  GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkbEx (gaiaGeomCollPtr geom,
618  unsigned char **result,
619  int *size, int gpkg_mode);
620 
639  GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkbEx2 (gaiaGeomCollPtr geom,
640  unsigned char **result,
641  int *size, int gpkg_mode,
642  int tiny_point);
643 
660  GAIAGEO_DECLARE void gaiaToCompressedBlobWkb (gaiaGeomCollPtr geom,
661  unsigned char **result,
662  int *size);
663 
679  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb (const unsigned char *blob,
680  unsigned int size);
681 
699  GAIAGEO_DECLARE void gaiaToWkb (gaiaGeomCollPtr geom,
700  unsigned char **result, int *size);
701 
716  GAIAGEO_DECLARE char *gaiaToHexWkb (gaiaGeomCollPtr geom);
717 
729  GAIAGEO_DECLARE void gaiaToEWKB (gaiaOutBufferPtr out_buf,
730  gaiaGeomCollPtr geom);
731 
747  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromEWKB (const unsigned char
748  *in_buffer);
749 
764  GAIAGEO_DECLARE unsigned char *gaiaParseHexEWKB (const unsigned char
765  *blob_hex, int *blob_size);
766 
785  GAIAGEO_DECLARE int
786  gaiaEwkbGetPoint (gaiaGeomCollPtr geom, unsigned char *blob,
787  int offset, int blob_size, int endian,
788  int endian_arch, int dims);
789 
808  GAIAGEO_DECLARE int
809  gaiaEwkbGetLinestring (gaiaGeomCollPtr geom, unsigned char *blob,
810  int offset, int blob_size, int endian,
811  int endian_arch, int dims);
812 
829  GAIAGEO_DECLARE int
830  gaiaEwkbGetPolygon (gaiaGeomCollPtr geom, unsigned char *blob,
831  int offset, int blob_size, int endian,
832  int endian_arch, int dims);
833 
852  GAIAGEO_DECLARE int
853  gaiaEwkbGetMultiGeometry (gaiaGeomCollPtr geom, unsigned char *blob,
854  int offset, int blob_size, int endian,
855  int endian_arch, int dims);
856 
872  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf (const unsigned char *blob,
873  unsigned int size);
874 
890  GAIAGEO_DECLARE void gaiaToFgf (gaiaGeomCollPtr geom,
891  unsigned char **result, int *size,
892  int coord_dims);
893 
911  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt (const unsigned char
912  *in_buffer, short type);
913 
927  GAIAGEO_DECLARE void gaiaOutWkt (gaiaOutBufferPtr out_buf,
928  gaiaGeomCollPtr geom);
929 
943  GAIAGEO_DECLARE void gaiaOutWktEx (gaiaOutBufferPtr out_buf,
944  gaiaGeomCollPtr geom, int precision);
945 
959  GAIAGEO_DECLARE void gaiaOutWktStrict (gaiaOutBufferPtr out_buf,
960  gaiaGeomCollPtr geom, int precision);
961 
976  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseEWKT (const unsigned char
977  *in_buffer);
978 
989  GAIAGEO_DECLARE void gaiaToEWKT (gaiaOutBufferPtr out_buf,
990  gaiaGeomCollPtr geom);
991 
1002  GAIAGEO_DECLARE void gaiaOutPointZ (gaiaOutBufferPtr out_buf,
1003  gaiaPointPtr point);
1004 
1016  GAIAGEO_DECLARE void gaiaOutPointZex (gaiaOutBufferPtr out_buf,
1017  gaiaPointPtr point, int precision);
1018 
1029  GAIAGEO_DECLARE void gaiaOutLinestringZ (gaiaOutBufferPtr out_buf,
1030  gaiaLinestringPtr linestring);
1031 
1043  GAIAGEO_DECLARE void gaiaOutLinestringZex (gaiaOutBufferPtr out_buf,
1044  gaiaLinestringPtr linestring,
1045  int precision);
1046 
1057  GAIAGEO_DECLARE void gaiaOutPolygonZ (gaiaOutBufferPtr out_buf,
1058  gaiaPolygonPtr polygon);
1059 
1071  GAIAGEO_DECLARE void gaiaOutPolygonZex (gaiaOutBufferPtr out_buf,
1072  gaiaPolygonPtr polygon,
1073  int precision);
1074 
1089  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseKml (const unsigned char
1090  *in_buffer);
1091 
1103  GAIAGEO_DECLARE void gaiaOutBareKml (gaiaOutBufferPtr out_buf,
1104  gaiaGeomCollPtr geom, int precision);
1105 
1119  GAIAGEO_DECLARE void gaiaOutFullKml (gaiaOutBufferPtr out_buf,
1120  const char *name, const char *desc,
1121  gaiaGeomCollPtr geom, int precision);
1122 
1139  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml (const unsigned char
1140  *in_buffer,
1141  sqlite3 * sqlite_handle);
1142 
1160  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml_r (const void *p_cache,
1161  const unsigned char
1162  *in_buffer,
1163  sqlite3 * sqlite_handle);
1164 
1179  GAIAGEO_DECLARE void gaiaOutGml_ex (gaiaOutBufferPtr out_buf, int version,
1180  int flipped, int precision,
1181  gaiaGeomCollPtr geom);
1182 
1195  GAIAGEO_DECLARE void gaiaOutGml (gaiaOutBufferPtr out_buf, int version,
1196  int precision, gaiaGeomCollPtr geom);
1197 
1212  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGeoJSON (const unsigned char
1213  *in_buffer);
1214 
1233  GAIAGEO_DECLARE void gaiaOutGeoJSON (gaiaOutBufferPtr out_buf,
1234  gaiaGeomCollPtr geom, int precision,
1235  int options);
1247  GAIAGEO_DECLARE void gaiaOutSvg (gaiaOutBufferPtr out_buf,
1248  gaiaGeomCollPtr geom, int relative,
1249  int precision);
1250 
1265 
1275  GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p);
1276 
1300  GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField (char *name,
1301  unsigned char type,
1302  int offset,
1303  unsigned char length,
1304  unsigned char decimals);
1305 
1315  GAIAGEO_DECLARE void gaiaFreeDbfField (gaiaDbfFieldPtr p);
1316 
1332 
1342  GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field);
1343 
1354  GAIAGEO_DECLARE void gaiaSetIntValue (gaiaDbfFieldPtr field,
1355  sqlite3_int64 value);
1356 
1366  GAIAGEO_DECLARE void gaiaSetDoubleValue (gaiaDbfFieldPtr field,
1367  double value);
1368 
1378  GAIAGEO_DECLARE void gaiaSetStrValue (gaiaDbfFieldPtr field, char *str);
1379 
1392  GAIAGEO_DECLARE gaiaDbfListPtr gaiaAllocDbfList (void);
1393 
1406  GAIAGEO_DECLARE void gaiaFreeDbfList (gaiaDbfListPtr list);
1407 
1418  GAIAGEO_DECLARE int gaiaIsValidDbfList (gaiaDbfListPtr list);
1419 
1441  char *name,
1442  unsigned char type,
1443  int offset,
1444  unsigned char length,
1445  unsigned char decimals);
1446 
1457  GAIAGEO_DECLARE void gaiaResetDbfEntity (gaiaDbfListPtr list);
1458 
1472 
1485  GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile (void);
1486 
1499  GAIAGEO_DECLARE void gaiaFreeShapefile (gaiaShapefilePtr shp);
1500 
1516  GAIAGEO_DECLARE void gaiaOpenShpRead (gaiaShapefilePtr shp,
1517  const char *path,
1518  const char *charFrom,
1519  const char *charTo);
1520 
1545  GAIAGEO_DECLARE void gaiaOpenShpWriteEx (gaiaShapefilePtr shp,
1546  const char *path, int shape,
1547  gaiaDbfListPtr list,
1548  const char *charFrom,
1549  const char *charTo,
1550  int colname_case);
1551 
1572  GAIAGEO_DECLARE void gaiaOpenShpWrite (gaiaShapefilePtr shp,
1573  const char *path, int shape,
1574  gaiaDbfListPtr list,
1575  const char *charFrom,
1576  const char *charTo);
1577 
1599  GAIAGEO_DECLARE int gaiaReadShpEntity (gaiaShapefilePtr shp,
1600  int current_row, int srid);
1601 
1623  GAIAGEO_DECLARE int gaiaReadShpEntity_ex (gaiaShapefilePtr shp,
1624  int current_row, int srid,
1625  int text_dates);
1626 
1640  GAIAGEO_DECLARE void gaiaShpAnalyze (gaiaShapefilePtr shp);
1641 
1656  GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp,
1657  gaiaDbfListPtr entity);
1658 
1671  GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp);
1672 
1685  GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf (void);
1686 
1699  GAIAGEO_DECLARE void gaiaFreeDbf (gaiaDbfPtr dbf);
1700 
1715  GAIAGEO_DECLARE void gaiaOpenDbfRead (gaiaDbfPtr dbf,
1716  const char *path,
1717  const char *charFrom,
1718  const char *charTo);
1719 
1737  GAIAGEO_DECLARE gaiaDbfPtr gaiaOpenZipDbf (const char *zip_path,
1738  const char *filename,
1739  const char *charFrom,
1740  const char *charTo);
1741 
1759  GAIAGEO_DECLARE void gaiaOpenDbfWriteEx (gaiaDbfPtr dbf,
1760  const char *path,
1761  const char *charFrom,
1762  const char *charTo,
1763  int colname_case);
1764 
1780  GAIAGEO_DECLARE void gaiaOpenDbfWrite (gaiaDbfPtr dbf,
1781  const char *path,
1782  const char *charFrom,
1783  const char *charTo);
1784 
1805  GAIAGEO_DECLARE int gaiaReadDbfEntity (gaiaDbfPtr dbf, int current_row,
1806  int *deleted);
1807 
1829  GAIAGEO_DECLARE int gaiaReadDbfEntity_ex (gaiaDbfPtr dbf, int current_row,
1830  int *deleted, int text_dates);
1831 
1846  GAIAGEO_DECLARE int gaiaWriteDbfEntity (gaiaDbfPtr dbf,
1847  gaiaDbfListPtr entity);
1848 
1861  GAIAGEO_DECLARE void gaiaFlushDbfHeader (gaiaDbfPtr dbf);
1862 
1874  GAIAGEO_DECLARE size_t gaiaMemRead (void *ptr, size_t bytes,
1875  gaiaMemFilePtr mem);
1876 
1887  GAIAGEO_DECLARE int gaiaMemFseek (gaiaMemFilePtr mem, off_t offset);
1888 
1901  GAIAGEO_DECLARE char *gaiaReadWktFromZipShp (const char *zip_path,
1902  const char *basename);
1903 
1912  GAIAGEO_DECLARE int gaiaZipfileNumSHP (const char *zip_path, int *count);
1913 
1926  GAIAGEO_DECLARE char *gaiaZipfileShpN (const char *zip_path, int idx);
1927 
1936  GAIAGEO_DECLARE int gaiaZipfileNumDBF (const char *zip_path, int *count);
1937 
1950  GAIAGEO_DECLARE char *gaiaZipfileDbfN (const char *zip_path, int idx);
1951 
1952 
1953 #ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */
1954 
1976  GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc (const char *path,
1977  char
1978  field_separator,
1979  char
1980  text_separator,
1981  char
1982  decimal_separator,
1983  int
1984  first_line_titles,
1985  const char
1986  *encoding);
1987 
1996  GAIAGEO_DECLARE void gaiaTextReaderDestroy (gaiaTextReaderPtr reader);
1997 
2013  GAIAGEO_DECLARE int gaiaTextReaderParse (gaiaTextReaderPtr reader);
2014 
2030  GAIAGEO_DECLARE int gaiaTextReaderGetRow (gaiaTextReaderPtr reader,
2031  int row_num);
2032 
2046  GAIAGEO_DECLARE int gaiaTextReaderFetchField (gaiaTextReaderPtr reader,
2047  int field_num, int *type,
2048  const char **value);
2049 
2050 #endif /* end ICONV (text reader) */
2051 
2052 #ifdef __cplusplus
2053 }
2054 #endif
2055 
2056 #endif /* _GG_FORMATS_H */
GAIAGEO_DECLARE void gaiaOutGml_ex(gaiaOutBufferPtr out_buf, int version, int flipped, int precision, gaiaGeomCollPtr geom)
Encodes a Geometry object into GML notation.
GAIAGEO_DECLARE void gaiaOutWktStrict(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into strict 2D WKT notation.
GAIAGEO_DECLARE void gaiaSetIntValue(gaiaDbfFieldPtr field, sqlite3_int64 value)
Sets an INTEGER current value for a DBF Field object.
GAIAGEO_DECLARE char * gaiaZipfileShpN(const char *zip_path, int idx)
Will return the basename of the Nth Shapefile from within a given Zipfile.
GAIAGEO_DECLARE int gaiaEwkbGetMultiGeometry(gaiaGeomCollPtr geom, unsigned char *blob, int offset, int blob_size, int endian, int endian_arch, int dims)
Attempts to decode a MultiGeometry from within an EWKB binary buffer.
GAIAGEO_DECLARE void gaiaExportU32(unsigned char *p, unsigned int value, int little_endian, int little_endian_arch)
Export an UINT-32 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaMakePointMEx(int tiny_point, double x, double y, double m, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointM (BLOB-Geometry or BLOB-TinyPoint)
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField(char *name, unsigned char type, int offset, unsigned char length, unsigned char decimals)
Allocates a new DBF Field object.
GAIAGEO_DECLARE void gaiaSetStrValue(gaiaDbfFieldPtr field, char *str)
Sets a TEXT current value for a DBF Field object.
GAIAGEO_DECLARE size_t gaiaMemRead(void *ptr, size_t bytes, gaiaMemFilePtr mem)
Reads from a Memory File.
GAIAGEO_DECLARE void gaiaOutPolygonZ(gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon)
Encodes a WKT 3D Polygon [XYZ].
GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc(const char *path, char field_separator, char text_separator, char decimal_separator, int first_line_titles, const char *encoding)
Creates a Text Reader object.
GAIAGEO_DECLARE void gaiaResetDbfEntity(gaiaDbfListPtr list)
Resets a DBF List object to its initial empty state.
GAIAGEO_DECLARE unsigned int gaiaImportU32(const unsigned char *p, int little_endian, int little_endian_arch)
Import an UINT-32 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaOpenDbfRead(gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo)
Open a DBF File in read mode.
GAIAGEO_DECLARE void gaiaAppendToOutBuffer(gaiaOutBufferPtr buf, const char *text)
Appends a text string at the end of Text output buffer.
GAIAGEO_DECLARE char * gaiaZipfileDbfN(const char *zip_path, int idx)
Will return the filename of the Nth DBF file from within a given Zipfile.
GAIAGEO_DECLARE void gaiaFlushShpHeaders(gaiaShapefilePtr shp)
Writes into an output Shapefile any required header / footer.
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkbEx2(gaiaGeomCollPtr geom, unsigned char **result, int *size, int gpkg_mode, int tiny_point)
Creates a BLOB-Geometry corresponding to a Geometry object.
GAIAGEO_DECLARE int gaiaMemFseek(gaiaMemFilePtr mem, off_t offset)
Repositioning a Memory File.
GAIAGEO_DECLARE void gaiaMakeLine(gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Segment (2-Points Linestring)
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseKml(const unsigned char *in_buffer)
Creates a Geometry object from KML notation.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf(const unsigned char *blob, unsigned int size)
Creates a Geometry object from FGF notation.
GAIAGEO_DECLARE void gaiaMakePointZMEx(int tiny_point, double x, double y, double z, double m, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointZM (BLOB-Geometry or BLOB-TinyPoint)
GAIAGEO_DECLARE int gaiaZipfileNumDBF(const char *zip_path, int *count)
Will return the number of DBF files from within a given Zipfile.
GAIAGEO_DECLARE void gaiaFreeDbf(gaiaDbfPtr dbf)
Destroys a DBF File object.
GAIAGEO_DECLARE void gaiaFlushDbfHeader(gaiaDbfPtr dbf)
Writes into an output DBF File any required header / footer.
GAIAGEO_DECLARE void gaiaTextReaderDestroy(gaiaTextReaderPtr reader)
Destroys a Text Reader object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml_r(const void *p_cache, const unsigned char *in_buffer, sqlite3 *sqlite_handle)
Creates a Geometry object from GML notation.
GAIAGEO_DECLARE gaiaDbfListPtr gaiaCloneDbfEntity(gaiaDbfListPtr org)
Allocates a new DBF List object [duplicating an existing one].
GAIAGEO_DECLARE void gaiaToEWKT(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into EWKT notation.
GAIAGEO_DECLARE int gaiaReadShpEntity(gaiaShapefilePtr shp, int current_row, int srid)
Reads a feature from a Shapefile object.
GAIAGEO_DECLARE void gaiaFreeShapefile(gaiaShapefilePtr shp)
Destroys a Shapefile object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseEWKT(const unsigned char *in_buffer)
Creates a Geometry object from EWKT notation.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkbEx(const unsigned char *blob, unsigned int size, int gpkg_mode, int gpkg_amphibious)
Creates a Geometry object from the corresponding BLOB-Geometry.
GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf(void)
Allocates a new DBF File object.
GAIAGEO_DECLARE void gaiaMakePointZM(double x, double y, double z, double m, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointZM (BLOB-Geometry)
GAIAGEO_DECLARE double gaiaImport64(const unsigned char *p, int little_endian, int little_endian_arch)
Import an DOUBLE-64 in endian-aware fashion.
GAIAGEO_DECLARE void gaiaOutFullKml(gaiaOutBufferPtr out_buf, const char *name, const char *desc, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into KML notation.
GAIAGEO_DECLARE int gaiaImport32(const unsigned char *p, int little_endian, int little_endian_arch)
Import an INT-32 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaOutBareKml(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into KML notation.
GAIAGEO_DECLARE void gaiaOutGml(gaiaOutBufferPtr out_buf, int version, int precision, gaiaGeomCollPtr geom)
Encodes a Geometry object into GML notation.
GAIAGEO_DECLARE int gaiaWriteDbfEntity(gaiaDbfPtr dbf, gaiaDbfListPtr entity)
Writes a record into a DBF File object.
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkbEx(gaiaGeomCollPtr geom, unsigned char **result, int *size, int gpkg_mode)
Creates a BLOB-Geometry corresponding to a Geometry object.
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAddDbfField(gaiaDbfListPtr list, char *name, unsigned char type, int offset, unsigned char length, unsigned char decimals)
Inserts a further DBF Field object into a DBF List object.
GAIAGEO_DECLARE int gaiaReadShpEntity_ex(gaiaShapefilePtr shp, int current_row, int srid, int text_dates)
Reads a feature from a Shapefile object.
GAIAGEO_DECLARE int gaiaEwkbGetPolygon(gaiaGeomCollPtr geom, unsigned char *blob, int offset, int blob_size, int endian, int endian_arch, int dims)
Attempts to decode a Polygon from within an EWKB binary buffer.
GAIAGEO_DECLARE int gaiaTextReaderGetRow(gaiaTextReaderPtr reader, int row_num)
Reads a line from a Text Reader object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGeoJSON(const unsigned char *in_buffer)
Creates a Geometry object from GeoJSON notation.
GAIAGEO_DECLARE void gaiaOutPointZex(gaiaOutBufferPtr out_buf, gaiaPointPtr point, int precision)
Encodes a WKT 3D Point [XYZ].
GAIAGEO_DECLARE void gaiaMakePointZ(double x, double y, double z, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointZ (BLOB-Geometry)
GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile(void)
Allocates a new Shapefile object.
GAIAGEO_DECLARE gaiaDbfPtr gaiaOpenZipDbf(const char *zip_path, const char *filename, const char *charFrom, const char *charTo)
Open a DBF File contained within a Zipfile (just for checking its fields)
GAIAGEO_DECLARE int gaiaTextReaderParse(gaiaTextReaderPtr reader)
Prescans the external file associated to a Text Reade object.
GAIAGEO_DECLARE void gaiaOutSvg(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int relative, int precision)
Encodes a Geometry object into SVG notation.
GAIAGEO_DECLARE void gaiaOutWkt(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into WKT notation.
GAIAGEO_DECLARE void gaiaOutGeoJSON(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision, int options)
Encodes a Geometry object into GeoJSON notation.
GAIAGEO_DECLARE void gaiaToFgf(gaiaGeomCollPtr geom, unsigned char **result, int *size, int coord_dims)
Encodes a Geometry object into FGF notation.
GAIAGEO_DECLARE void gaiaExport16(unsigned char *p, short value, int little_endian, int little_endian_arch)
Export an INT-16 value in endian-aware fashion.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb(const unsigned char *blob, unsigned int size)
Creates a Geometry object from WKB notation.
GAIAGEO_DECLARE void gaiaExportF32(unsigned char *p, float value, int little_endian, int little_endian_arch)
Export a FLOAT-32 value in endian-aware fashion.
GAIAGEO_DECLARE int gaiaReadDbfEntity_ex(gaiaDbfPtr dbf, int current_row, int *deleted, int text_dates)
Reads a record from a DBF File object.
GAIAGEO_DECLARE void gaiaFreeDbfField(gaiaDbfFieldPtr p)
Destroys a DBF Field object.
GAIAGEO_DECLARE void gaiaExportI64(unsigned char *p, sqlite3_int64 value, int little_endian, int little_endian_arch)
Export an INT-64 value in endian-aware fashion.
GAIAGEO_DECLARE gaiaValuePtr gaiaCloneValue(gaiaValuePtr org)
Allocates a new DBF Field Value object [duplicating an existing one].
GAIAGEO_DECLARE void gaiaOpenShpWrite(gaiaShapefilePtr shp, const char *path, int shape, gaiaDbfListPtr list, const char *charFrom, const char *charTo)
Open a Shapefile in write mode.
GAIAGEO_DECLARE int gaiaTextReaderFetchField(gaiaTextReaderPtr reader, int field_num, int *type, const char **value)
Retrieves an individual field value from the current Line.
GAIAGEO_DECLARE int gaiaEwkbGetPoint(gaiaGeomCollPtr geom, unsigned char *blob, int offset, int blob_size, int endian, int endian_arch, int dims)
Attempts to decode a Point from within an EWKB binary buffer.
GAIAGEO_DECLARE char * gaiaToHexWkb(gaiaGeomCollPtr geom)
Encodes a Geometry object into (hex) WKB notation.
GAIAGEO_DECLARE void gaiaExport32(unsigned char *p, int value, int little_endian, int little_endian_arch)
Export an INT-32 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaShpAnalyze(gaiaShapefilePtr shp)
Prescans a Shapefile object gathering informations.
GAIAGEO_DECLARE int gaiaZipfileNumSHP(const char *zip_path, int *count)
Will return the number of Shapefiles from within a given Zipfile.
GAIAGEO_DECLARE sqlite3_int64 gaiaImportI64(const unsigned char *p, int little_endian, int little_endian_arch)
Import an INT-64 in endian-aware fashion.
GAIAGEO_DECLARE void gaiaFreeDbfList(gaiaDbfListPtr list)
Destroys a DBF List object.
GAIAGEO_DECLARE void gaiaToEWKB(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into EWKB notation.
GAIAGEO_DECLARE void gaiaOutLinestringZex(gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring, int precision)
Encodes a WKT 3D Linestring [XYZ].
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaCloneDbfField(gaiaDbfFieldPtr org)
Allocates a new DBF Field object [duplicating an existing one].
GAIAGEO_DECLARE float gaiaImportF32(const unsigned char *p, int little_endian, int little_endian_arch)
Import a FLOAT-32 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaExport64(unsigned char *p, double value, int little_endian, int little_endian_arch)
Export a DOUBLE value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaOutBufferReset(gaiaOutBufferPtr buf)
Resets a dynamically growing Text output buffer to its initial (empty) state.
GAIAGEO_DECLARE void gaiaFreeValue(gaiaValuePtr p)
Resets a DBF Field Value object to its initial empty state.
GAIAGEO_DECLARE short gaiaImport16(const unsigned char *p, int little_endian, int little_endian_arch)
Import an INT-16 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaMakePointZEx(int tiny_point, double x, double y, double z, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointZ (BLOB-Geometry or BLOB-TinyPoint)
GAIAGEO_DECLARE void gaiaSetDoubleValue(gaiaDbfFieldPtr field, double value)
Sets a DOUBLE current value for a DBF Field object.
GAIAGEO_DECLARE void gaiaMakePoint(double x, double y, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Point (BLOB-Geometry)
GAIAGEO_DECLARE void gaiaOpenDbfWrite(gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo)
Open a DBF File in write mode.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromEWKB(const unsigned char *in_buffer)
Creates a Geometry object from EWKB notation.
GAIAGEO_DECLARE unsigned char * gaiaParseHexEWKB(const unsigned char *blob_hex, int *blob_size)
Translates an EWKB notation from hexadecimal into binary.
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Creates a BLOB-Geometry corresponding to a Geometry object.
GAIAGEO_DECLARE void gaiaOutBufferInitialize(gaiaOutBufferPtr buf)
Initializes a dynamically growing Text output buffer.
GAIAGEO_DECLARE int gaiaEndianArch(void)
Test CPU endianness.
GAIAGEO_DECLARE gaiaDbfListPtr gaiaAllocDbfList(void)
Creates an initially empty DBF List object.
GAIAGEO_DECLARE int gaiaEwkbGetLinestring(gaiaGeomCollPtr geom, unsigned char *blob, int offset, int blob_size, int endian, int endian_arch, int dims)
Attempts to decode a Point from within an EWKB binary buffer.
GAIAGEO_DECLARE void gaiaToWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Encodes a Geometry object into WKB notation.
GAIAGEO_DECLARE void gaiaOutPolygonZex(gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon, int precision)
Encodes a WKT 3D Polygon [XYZ].
GAIAGEO_DECLARE void gaiaMakePointEx(int tiny_point, double x, double y, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Point (BLOB-Geometry or BLOB-TinyPoint)
GAIAGEO_DECLARE int gaiaReadDbfEntity(gaiaDbfPtr dbf, int current_row, int *deleted)
Reads a record from a DBF File object.
GAIAGEO_DECLARE void gaiaToCompressedBlobWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Creates a Compressed BLOB-Geometry corresponding to a Geometry object.
GAIAGEO_DECLARE void gaiaOutPointZ(gaiaOutBufferPtr out_buf, gaiaPointPtr point)
Encodes a WKT 3D Point [XYZ].
GAIAGEO_DECLARE void gaiaOpenShpWriteEx(gaiaShapefilePtr shp, const char *path, int shape, gaiaDbfListPtr list, const char *charFrom, const char *charTo, int colname_case)
Open a Shapefile in write mode - extended.
GAIAGEO_DECLARE void gaiaOpenDbfWriteEx(gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo, int colname_case)
Open a DBF File in write mode,- extended.
GAIAGEO_DECLARE void gaiaSetNullValue(gaiaDbfFieldPtr field)
Sets a NULL current value for a DBF Field object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml(const unsigned char *in_buffer, sqlite3 *sqlite_handle)
Creates a Geometry object from GML notation.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt(const unsigned char *in_buffer, short type)
Creates a Geometry object from WKT notation.
GAIAGEO_DECLARE char * gaiaReadWktFromZipShp(const char *zip_path, const char *basename)
Attempting to get a WKT from the .PRJ member of a given zipped Shapefile.
GAIAGEO_DECLARE void gaiaOpenShpRead(gaiaShapefilePtr shp, const char *path, const char *charFrom, const char *charTo)
Open a Shapefile in read mode.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb(const unsigned char *blob, unsigned int size)
Creates a Geometry object from the corresponding BLOB-Geometry.
GAIAGEO_DECLARE void gaiaMakePointM(double x, double y, double m, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointM (BLOB-Geometry)
GAIAGEO_DECLARE int gaiaIsValidDbfList(gaiaDbfListPtr list)
Checks a DBF List object for validity.
GAIAGEO_DECLARE void gaiaOutLinestringZ(gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring)
Encodes a WKT 3D Linestring [XYZ].
GAIAGEO_DECLARE void gaiaOutWktEx(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into WKT notation.
GAIAGEO_DECLARE int gaiaWriteShpEntity(gaiaShapefilePtr shp, gaiaDbfListPtr entity)
Writes a feature into a Shapefile object.
Container for DBF field.
Definition: gg_structs.h:319
Container for a list of DBF fields.
Definition: gg_structs.h:345
Container for DBF file handling.
Definition: gg_structs.h:385
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:227
Container for OGC LINESTRING Geometry.
Definition: gg_structs.h:129
A Memory based File.
Definition: gg_structs.h:367
Container for dynamically growing output buffer.
Definition: gg_structs.h:497
Container for OGC POINT Geometry.
Definition: gg_structs.h:79
Container for OGC POLYGON Geometry.
Definition: gg_structs.h:193
Container for SHP file handling.
Definition: gg_structs.h:425
Container for variant (multi-type) value.
Definition: gg_structs.h:299
Container for Virtual Text file handling.
Definition: gg_structs.h:602