SpatiaLite  5.0.1
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.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-2021
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 
1178  GAIAGEO_DECLARE void gaiaOutGml (gaiaOutBufferPtr out_buf, int version,
1179  int precision, gaiaGeomCollPtr geom);
1180 
1195  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGeoJSON (const unsigned char
1196  *in_buffer);
1197 
1216  GAIAGEO_DECLARE void gaiaOutGeoJSON (gaiaOutBufferPtr out_buf,
1217  gaiaGeomCollPtr geom, int precision,
1218  int options);
1230  GAIAGEO_DECLARE void gaiaOutSvg (gaiaOutBufferPtr out_buf,
1231  gaiaGeomCollPtr geom, int relative,
1232  int precision);
1233 
1248 
1258  GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p);
1259 
1283  GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField (char *name,
1284  unsigned char type,
1285  int offset,
1286  unsigned char length,
1287  unsigned char decimals);
1288 
1298  GAIAGEO_DECLARE void gaiaFreeDbfField (gaiaDbfFieldPtr p);
1299 
1315 
1325  GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field);
1326 
1337  GAIAGEO_DECLARE void gaiaSetIntValue (gaiaDbfFieldPtr field,
1338  sqlite3_int64 value);
1339 
1349  GAIAGEO_DECLARE void gaiaSetDoubleValue (gaiaDbfFieldPtr field,
1350  double value);
1351 
1361  GAIAGEO_DECLARE void gaiaSetStrValue (gaiaDbfFieldPtr field, char *str);
1362 
1375  GAIAGEO_DECLARE gaiaDbfListPtr gaiaAllocDbfList (void);
1376 
1389  GAIAGEO_DECLARE void gaiaFreeDbfList (gaiaDbfListPtr list);
1390 
1401  GAIAGEO_DECLARE int gaiaIsValidDbfList (gaiaDbfListPtr list);
1402 
1424  char *name,
1425  unsigned char type,
1426  int offset,
1427  unsigned char length,
1428  unsigned char decimals);
1429 
1440  GAIAGEO_DECLARE void gaiaResetDbfEntity (gaiaDbfListPtr list);
1441 
1455 
1468  GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile (void);
1469 
1482  GAIAGEO_DECLARE void gaiaFreeShapefile (gaiaShapefilePtr shp);
1483 
1499  GAIAGEO_DECLARE void gaiaOpenShpRead (gaiaShapefilePtr shp,
1500  const char *path,
1501  const char *charFrom,
1502  const char *charTo);
1503 
1528  GAIAGEO_DECLARE void gaiaOpenShpWriteEx (gaiaShapefilePtr shp,
1529  const char *path, int shape,
1530  gaiaDbfListPtr list,
1531  const char *charFrom,
1532  const char *charTo,
1533  int colname_case);
1534 
1555  GAIAGEO_DECLARE void gaiaOpenShpWrite (gaiaShapefilePtr shp,
1556  const char *path, int shape,
1557  gaiaDbfListPtr list,
1558  const char *charFrom,
1559  const char *charTo);
1560 
1582  GAIAGEO_DECLARE int gaiaReadShpEntity (gaiaShapefilePtr shp,
1583  int current_row, int srid);
1584 
1606  GAIAGEO_DECLARE int gaiaReadShpEntity_ex (gaiaShapefilePtr shp,
1607  int current_row, int srid,
1608  int text_dates);
1609 
1623  GAIAGEO_DECLARE void gaiaShpAnalyze (gaiaShapefilePtr shp);
1624 
1639  GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp,
1640  gaiaDbfListPtr entity);
1641 
1654  GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp);
1655 
1668  GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf (void);
1669 
1682  GAIAGEO_DECLARE void gaiaFreeDbf (gaiaDbfPtr dbf);
1683 
1698  GAIAGEO_DECLARE void gaiaOpenDbfRead (gaiaDbfPtr dbf,
1699  const char *path,
1700  const char *charFrom,
1701  const char *charTo);
1702 
1720  GAIAGEO_DECLARE gaiaDbfPtr gaiaOpenZipDbf (const char *zip_path,
1721  const char *filename,
1722  const char *charFrom,
1723  const char *charTo);
1724 
1742  GAIAGEO_DECLARE void gaiaOpenDbfWriteEx (gaiaDbfPtr dbf,
1743  const char *path,
1744  const char *charFrom,
1745  const char *charTo,
1746  int colname_case);
1747 
1763  GAIAGEO_DECLARE void gaiaOpenDbfWrite (gaiaDbfPtr dbf,
1764  const char *path,
1765  const char *charFrom,
1766  const char *charTo);
1767 
1788  GAIAGEO_DECLARE int gaiaReadDbfEntity (gaiaDbfPtr dbf, int current_row,
1789  int *deleted);
1790 
1812  GAIAGEO_DECLARE int gaiaReadDbfEntity_ex (gaiaDbfPtr dbf, int current_row,
1813  int *deleted, int text_dates);
1814 
1829  GAIAGEO_DECLARE int gaiaWriteDbfEntity (gaiaDbfPtr dbf,
1830  gaiaDbfListPtr entity);
1831 
1844  GAIAGEO_DECLARE void gaiaFlushDbfHeader (gaiaDbfPtr dbf);
1845 
1857  GAIAGEO_DECLARE size_t gaiaMemRead (void *ptr, size_t bytes,
1858  gaiaMemFilePtr mem);
1859 
1870  GAIAGEO_DECLARE int gaiaMemFseek (gaiaMemFilePtr mem, off_t offset);
1871 
1884  GAIAGEO_DECLARE char *gaiaReadWktFromZipShp (const char *zip_path,
1885  const char *basename);
1886 
1895  GAIAGEO_DECLARE int gaiaZipfileNumSHP (const char *zip_path, int *count);
1896 
1909  GAIAGEO_DECLARE char *gaiaZipfileShpN (const char *zip_path, int idx);
1910 
1919  GAIAGEO_DECLARE int gaiaZipfileNumDBF (const char *zip_path, int *count);
1920 
1933  GAIAGEO_DECLARE char *gaiaZipfileDbfN (const char *zip_path, int idx);
1934 
1935 
1936 #ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */
1937 
1959  GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc (const char *path,
1960  char
1961  field_separator,
1962  char
1963  text_separator,
1964  char
1965  decimal_separator,
1966  int
1967  first_line_titles,
1968  const char
1969  *encoding);
1970 
1979  GAIAGEO_DECLARE void gaiaTextReaderDestroy (gaiaTextReaderPtr reader);
1980 
1996  GAIAGEO_DECLARE int gaiaTextReaderParse (gaiaTextReaderPtr reader);
1997 
2013  GAIAGEO_DECLARE int gaiaTextReaderGetRow (gaiaTextReaderPtr reader,
2014  int row_num);
2015 
2029  GAIAGEO_DECLARE int gaiaTextReaderFetchField (gaiaTextReaderPtr reader,
2030  int field_num, int *type,
2031  const char **value);
2032 
2033 #endif /* end ICONV (text reader) */
2034 
2035 #ifdef __cplusplus
2036 }
2037 #endif
2038 
2039 #endif /* _GG_FORMATS_H */
gaiaMakePointZEx
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)
gaiaReadDbfEntity
GAIAGEO_DECLARE int gaiaReadDbfEntity(gaiaDbfPtr dbf, int current_row, int *deleted)
Reads a record from a DBF File object.
gaiaWriteDbfEntity
GAIAGEO_DECLARE int gaiaWriteDbfEntity(gaiaDbfPtr dbf, gaiaDbfListPtr entity)
Writes a record into a DBF File object.
gaiaOpenDbfWrite
GAIAGEO_DECLARE void gaiaOpenDbfWrite(gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo)
Open a DBF File in write mode.
gaiaReadShpEntity
GAIAGEO_DECLARE int gaiaReadShpEntity(gaiaShapefilePtr shp, int current_row, int srid)
Reads a feature from a Shapefile object.
gaiaIsValidDbfList
GAIAGEO_DECLARE int gaiaIsValidDbfList(gaiaDbfListPtr list)
Checks a DBF List object for validity.
gaiaPolygonStruct
Container for OGC POLYGON Geometry.
Definition: gg_structs.h:193
gaiaOutPointZ
GAIAGEO_DECLARE void gaiaOutPointZ(gaiaOutBufferPtr out_buf, gaiaPointPtr point)
Encodes a WKT 3D Point [XYZ].
gaiaToSpatiaLiteBlobWkbEx
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkbEx(gaiaGeomCollPtr geom, unsigned char **result, int *size, int gpkg_mode)
Creates a BLOB-Geometry corresponding to a Geometry object.
gaiaAddDbfField
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.
gaiaMemRead
GAIAGEO_DECLARE size_t gaiaMemRead(void *ptr, size_t bytes, gaiaMemFilePtr mem)
Reads from a Memory File.
gaiaImportI64
GAIAGEO_DECLARE sqlite3_int64 gaiaImportI64(const unsigned char *p, int little_endian, int little_endian_arch)
Import an INT-64 in endian-aware fashion.
gaiaZipfileNumSHP
GAIAGEO_DECLARE int gaiaZipfileNumSHP(const char *zip_path, int *count)
Will return the number of Shapefiles from within a given Zipfile.
gaiaMakePointZM
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)
gaiaOpenShpWrite
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.
gaiaMemFseek
GAIAGEO_DECLARE int gaiaMemFseek(gaiaMemFilePtr mem, off_t offset)
Repositioning a Memory File.
gaiaOutBufferStruct
Container for dynamically growing output buffer.
Definition: gg_structs.h:497
gaiaToHexWkb
GAIAGEO_DECLARE char * gaiaToHexWkb(gaiaGeomCollPtr geom)
Encodes a Geometry object into (hex) WKB notation.
gaiaSetIntValue
GAIAGEO_DECLARE void gaiaSetIntValue(gaiaDbfFieldPtr field, sqlite3_int64 value)
Sets an INTEGER current value for a DBF Field object.
gaiaOutPointZex
GAIAGEO_DECLARE void gaiaOutPointZex(gaiaOutBufferPtr out_buf, gaiaPointPtr point, int precision)
Encodes a WKT 3D Point [XYZ].
gaiaZipfileShpN
GAIAGEO_DECLARE char * gaiaZipfileShpN(const char *zip_path, int idx)
Will return the basename of the Nth Shapefile from within a given Zipfile.
gaiaTextReaderParse
GAIAGEO_DECLARE int gaiaTextReaderParse(gaiaTextReaderPtr reader)
Prescans the external file associated to a Text Reade object.
gaiaFreeShapefile
GAIAGEO_DECLARE void gaiaFreeShapefile(gaiaShapefilePtr shp)
Destroys a Shapefile object.
gaiaTextReaderFetchField
GAIAGEO_DECLARE int gaiaTextReaderFetchField(gaiaTextReaderPtr reader, int field_num, int *type, const char **value)
Retrieves an individual field value from the current Line.
gaiaParseHexEWKB
GAIAGEO_DECLARE unsigned char * gaiaParseHexEWKB(const unsigned char *blob_hex, int *blob_size)
Translates an EWKB notation from hexadecimal into binary.
gaiaOutBufferReset
GAIAGEO_DECLARE void gaiaOutBufferReset(gaiaOutBufferPtr buf)
Resets a dynamically growing Text output buffer to its initial (empty) state.
gaiaExportF32
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.
gaiaEndianArch
GAIAGEO_DECLARE int gaiaEndianArch(void)
Test CPU endianness.
gaiaEwkbGetMultiGeometry
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.
gaiaCloneValue
GAIAGEO_DECLARE gaiaValuePtr gaiaCloneValue(gaiaValuePtr org)
Allocates a new DBF Field Value object [duplicating an existing one].
gaiaReadDbfEntity_ex
GAIAGEO_DECLARE int gaiaReadDbfEntity_ex(gaiaDbfPtr dbf, int current_row, int *deleted, int text_dates)
Reads a record from a DBF File object.
gaiaDbfFieldStruct
Container for DBF field.
Definition: gg_structs.h:319
gaiaDbfListStruct
Container for a list of DBF fields.
Definition: gg_structs.h:345
gaiaOutLinestringZex
GAIAGEO_DECLARE void gaiaOutLinestringZex(gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring, int precision)
Encodes a WKT 3D Linestring [XYZ].
gaiaOutBufferInitialize
GAIAGEO_DECLARE void gaiaOutBufferInitialize(gaiaOutBufferPtr buf)
Initializes a dynamically growing Text output buffer.
gaiaFreeValue
GAIAGEO_DECLARE void gaiaFreeValue(gaiaValuePtr p)
Resets a DBF Field Value object to its initial empty state.
gaiaAllocShapefile
GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile(void)
Allocates a new Shapefile object.
gaiaOpenDbfRead
GAIAGEO_DECLARE void gaiaOpenDbfRead(gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo)
Open a DBF File in read mode.
gaiaFromEWKB
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromEWKB(const unsigned char *in_buffer)
Creates a Geometry object from EWKB notation.
gaiaMakePointZ
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)
gaiaMakePointM
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)
gaiaFromSpatiaLiteBlobWkb
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb(const unsigned char *blob, unsigned int size)
Creates a Geometry object from the corresponding BLOB-Geometry.
gaiaEwkbGetLinestring
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.
gaiaShpAnalyze
GAIAGEO_DECLARE void gaiaShpAnalyze(gaiaShapefilePtr shp)
Prescans a Shapefile object gathering informations.
gaiaFlushShpHeaders
GAIAGEO_DECLARE void gaiaFlushShpHeaders(gaiaShapefilePtr shp)
Writes into an output Shapefile any required header / footer.
gaiaToSpatiaLiteBlobWkb
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Creates a BLOB-Geometry corresponding to a Geometry object.
gaiaImportF32
GAIAGEO_DECLARE float gaiaImportF32(const unsigned char *p, int little_endian, int little_endian_arch)
Import a FLOAT-32 value in endian-aware fashion.
gaiaParseWkt
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt(const unsigned char *in_buffer, short type)
Creates a Geometry object from WKT notation.
gaiaToCompressedBlobWkb
GAIAGEO_DECLARE void gaiaToCompressedBlobWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Creates a Compressed BLOB-Geometry corresponding to a Geometry object.
gaiaFreeDbf
GAIAGEO_DECLARE void gaiaFreeDbf(gaiaDbfPtr dbf)
Destroys a DBF File object.
gaiaOutFullKml
GAIAGEO_DECLARE void gaiaOutFullKml(gaiaOutBufferPtr out_buf, const char *name, const char *desc, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into KML notation.
gaiaFlushDbfHeader
GAIAGEO_DECLARE void gaiaFlushDbfHeader(gaiaDbfPtr dbf)
Writes into an output DBF File any required header / footer.
gaiaPointStruct
Container for OGC POINT Geometry.
Definition: gg_structs.h:79
gaiaOpenZipDbf
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)
gaiaAllocDbfList
GAIAGEO_DECLARE gaiaDbfListPtr gaiaAllocDbfList(void)
Creates an initially empty DBF List object.
gaiaParseGeoJSON
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGeoJSON(const unsigned char *in_buffer)
Creates a Geometry object from GeoJSON notation.
gaiaFreeDbfField
GAIAGEO_DECLARE void gaiaFreeDbfField(gaiaDbfFieldPtr p)
Destroys a DBF Field object.
gaiaMakePointMEx
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)
gaiaDbfStruct
Container for DBF file handling.
Definition: gg_structs.h:385
gaiaMakeLine
GAIAGEO_DECLARE void gaiaMakeLine(gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Segment (2-Points Linestring)
gaiaMakePointEx
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)
gaiaOutBareKml
GAIAGEO_DECLARE void gaiaOutBareKml(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into KML notation.
gaiaParseKml
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseKml(const unsigned char *in_buffer)
Creates a Geometry object from KML notation.
gaiaToEWKB
GAIAGEO_DECLARE void gaiaToEWKB(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into EWKB notation.
gaiaToSpatiaLiteBlobWkbEx2
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.
gaiaSetStrValue
GAIAGEO_DECLARE void gaiaSetStrValue(gaiaDbfFieldPtr field, char *str)
Sets a TEXT current value for a DBF Field object.
gaiaTextReaderDestroy
GAIAGEO_DECLARE void gaiaTextReaderDestroy(gaiaTextReaderPtr reader)
Destroys a Text Reader object.
gaiaCloneDbfEntity
GAIAGEO_DECLARE gaiaDbfListPtr gaiaCloneDbfEntity(gaiaDbfListPtr org)
Allocates a new DBF List object [duplicating an existing one].
gaiaExportI64
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.
gaiaOutGeoJSON
GAIAGEO_DECLARE void gaiaOutGeoJSON(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision, int options)
Encodes a Geometry object into GeoJSON notation.
gaiaLinestringStruct
Container for OGC LINESTRING Geometry.
Definition: gg_structs.h:129
gaiaZipfileDbfN
GAIAGEO_DECLARE char * gaiaZipfileDbfN(const char *zip_path, int idx)
Will return the filename of the Nth DBF file from within a given Zipfile.
gaiaImport16
GAIAGEO_DECLARE short gaiaImport16(const unsigned char *p, int little_endian, int little_endian_arch)
Import an INT-16 value in endian-aware fashion.
gaiaTextReaderAlloc
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.
gaiaReadWktFromZipShp
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.
gaiaFromFgf
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf(const unsigned char *blob, unsigned int size)
Creates a Geometry object from FGF notation.
gaiaOpenShpWriteEx
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.
gaiaParseEWKT
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseEWKT(const unsigned char *in_buffer)
Creates a Geometry object from EWKT notation.
gaiaTextReaderGetRow
GAIAGEO_DECLARE int gaiaTextReaderGetRow(gaiaTextReaderPtr reader, int row_num)
Reads a line from a Text Reader object.
gaiaFromSpatiaLiteBlobWkbEx
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.
gaiaOutSvg
GAIAGEO_DECLARE void gaiaOutSvg(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int relative, int precision)
Encodes a Geometry object into SVG notation.
gaiaCloneDbfField
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaCloneDbfField(gaiaDbfFieldPtr org)
Allocates a new DBF Field object [duplicating an existing one].
gaiaFromWkb
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb(const unsigned char *blob, unsigned int size)
Creates a Geometry object from WKB notation.
gaiaOpenDbfWriteEx
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.
gaiaOutWktStrict
GAIAGEO_DECLARE void gaiaOutWktStrict(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into strict 2D WKT notation.
gaiaWriteShpEntity
GAIAGEO_DECLARE int gaiaWriteShpEntity(gaiaShapefilePtr shp, gaiaDbfListPtr entity)
Writes a feature into a Shapefile object.
gaiaMemFileStruct
A Memory based File.
Definition: gg_structs.h:367
gaiaOutWkt
GAIAGEO_DECLARE void gaiaOutWkt(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into WKT notation.
gaiaParseGml
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml(const unsigned char *in_buffer, sqlite3 *sqlite_handle)
Creates a Geometry object from GML notation.
gaiaMakePoint
GAIAGEO_DECLARE void gaiaMakePoint(double x, double y, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Point (BLOB-Geometry)
gaiaImportU32
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.
gaiaOutPolygonZ
GAIAGEO_DECLARE void gaiaOutPolygonZ(gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon)
Encodes a WKT 3D Polygon [XYZ].
gaiaFreeDbfList
GAIAGEO_DECLARE void gaiaFreeDbfList(gaiaDbfListPtr list)
Destroys a DBF List object.
gaiaSetDoubleValue
GAIAGEO_DECLARE void gaiaSetDoubleValue(gaiaDbfFieldPtr field, double value)
Sets a DOUBLE current value for a DBF Field object.
gaiaValueStruct
Container for variant (multi-type) value.
Definition: gg_structs.h:299
gaiaExport64
GAIAGEO_DECLARE void gaiaExport64(unsigned char *p, double value, int little_endian, int little_endian_arch)
Export a DOUBLE value in endian-aware fashion.
gaiaParseGml_r
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml_r(const void *p_cache, const unsigned char *in_buffer, sqlite3 *sqlite_handle)
Creates a Geometry object from GML notation.
gaiaExport16
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.
gaiaImport32
GAIAGEO_DECLARE int gaiaImport32(const unsigned char *p, int little_endian, int little_endian_arch)
Import an INT-32 value in endian-aware fashion.
gaiaToWkb
GAIAGEO_DECLARE void gaiaToWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Encodes a Geometry object into WKB notation.
vrttxt_reader
Container for Virtual Text file handling.
Definition: gg_structs.h:602
gaiaToFgf
GAIAGEO_DECLARE void gaiaToFgf(gaiaGeomCollPtr geom, unsigned char **result, int *size, int coord_dims)
Encodes a Geometry object into FGF notation.
gaiaOutLinestringZ
GAIAGEO_DECLARE void gaiaOutLinestringZ(gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring)
Encodes a WKT 3D Linestring [XYZ].
gaiaResetDbfEntity
GAIAGEO_DECLARE void gaiaResetDbfEntity(gaiaDbfListPtr list)
Resets a DBF List object to its initial empty state.
gaiaOutPolygonZex
GAIAGEO_DECLARE void gaiaOutPolygonZex(gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon, int precision)
Encodes a WKT 3D Polygon [XYZ].
gaiaEwkbGetPolygon
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.
gaiaGeomCollStruct
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:227
gaiaExportU32
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.
gaiaAppendToOutBuffer
GAIAGEO_DECLARE void gaiaAppendToOutBuffer(gaiaOutBufferPtr buf, const char *text)
Appends a text string at the end of Text output buffer.
gaiaAllocDbfField
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField(char *name, unsigned char type, int offset, unsigned char length, unsigned char decimals)
Allocates a new DBF Field object.
gaiaOutWktEx
GAIAGEO_DECLARE void gaiaOutWktEx(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into WKT notation.
gaiaToEWKT
GAIAGEO_DECLARE void gaiaToEWKT(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into EWKT notation.
gaiaReadShpEntity_ex
GAIAGEO_DECLARE int gaiaReadShpEntity_ex(gaiaShapefilePtr shp, int current_row, int srid, int text_dates)
Reads a feature from a Shapefile object.
gaiaImport64
GAIAGEO_DECLARE double gaiaImport64(const unsigned char *p, int little_endian, int little_endian_arch)
Import an DOUBLE-64 in endian-aware fashion.
gaiaAllocDbf
GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf(void)
Allocates a new DBF File object.
gaiaShapefileStruct
Container for SHP file handling.
Definition: gg_structs.h:425
gaiaOpenShpRead
GAIAGEO_DECLARE void gaiaOpenShpRead(gaiaShapefilePtr shp, const char *path, const char *charFrom, const char *charTo)
Open a Shapefile in read mode.
gaiaZipfileNumDBF
GAIAGEO_DECLARE int gaiaZipfileNumDBF(const char *zip_path, int *count)
Will return the number of DBF files from within a given Zipfile.
gaiaExport32
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.
gaiaEwkbGetPoint
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.
gaiaMakePointZMEx
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)
gaiaSetNullValue
GAIAGEO_DECLARE void gaiaSetNullValue(gaiaDbfFieldPtr field)
Sets a NULL current value for a DBF Field object.
gaiaOutGml
GAIAGEO_DECLARE void gaiaOutGml(gaiaOutBufferPtr out_buf, int version, int precision, gaiaGeomCollPtr geom)
Encodes a Geometry object into GML notation.