SpatiaLite  4.3.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 4.3, 2015 June 29
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-2015
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, int little_endian,
107  int little_endian_arch);
108 
124  GAIAGEO_DECLARE unsigned int gaiaImportU32 (const unsigned char *p,
125  int little_endian,
126  int little_endian_arch);
127 
143  GAIAGEO_DECLARE float gaiaImportF32 (const unsigned char *p,
144  int little_endian,
145  int little_endian_arch);
146 
162  GAIAGEO_DECLARE double gaiaImport64 (const unsigned char *p,
163  int little_endian,
164  int little_endian_arch);
165 
181  GAIAGEO_DECLARE sqlite3_int64 gaiaImportI64 (const unsigned char *p,
182  int little_endian,
183  int little_endian_arch);
184 
199  GAIAGEO_DECLARE void gaiaExport16 (unsigned char *p, short value,
200  int little_endian,
201  int little_endian_arch);
202 
217  GAIAGEO_DECLARE void gaiaExport32 (unsigned char *p, int value,
218  int little_endian,
219  int little_endian_arch);
220 
235  GAIAGEO_DECLARE void gaiaExportU32 (unsigned char *p, unsigned int value,
236  int little_endian,
237  int little_endian_arch);
238 
253  GAIAGEO_DECLARE void gaiaExportF32 (unsigned char *p, float value,
254  int little_endian,
255  int little_endian_arch);
256 
271  GAIAGEO_DECLARE void gaiaExport64 (unsigned char *p, double value,
272  int little_endian,
273  int little_endian_arch);
274 
289  GAIAGEO_DECLARE void gaiaExportI64 (unsigned char *p, sqlite3_int64 value,
290  int little_endian,
291  int little_endian_arch);
292 
308  GAIAGEO_DECLARE void gaiaOutBufferInitialize (gaiaOutBufferPtr buf);
309 
321  GAIAGEO_DECLARE void gaiaOutBufferReset (gaiaOutBufferPtr buf);
322 
336  GAIAGEO_DECLARE void gaiaAppendToOutBuffer (gaiaOutBufferPtr buf,
337  const char *text);
338 
355  GAIAGEO_DECLARE void gaiaMakePoint (double x, double y, int srid,
356  unsigned char **result, int *size);
357 
375  GAIAGEO_DECLARE void gaiaMakePointZ (double x, double y, double z, int srid,
376  unsigned char **result, int *size);
377 
395  GAIAGEO_DECLARE void gaiaMakePointM (double x, double y, double m, int srid,
396  unsigned char **result, int *size);
397 
416  GAIAGEO_DECLARE void gaiaMakePointZM (double x, double y, double z,
417  double m, int srid,
418  unsigned char **result, int *size);
419 
435  GAIAGEO_DECLARE void gaiaMakeLine (gaiaGeomCollPtr geom1,
436  gaiaGeomCollPtr geom2,
437  unsigned char **result, int *size);
438 
455  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb (const unsigned
456  char *blob,
457  unsigned int
458  size);
459 
478  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkbEx (const unsigned
479  char *blob,
480  unsigned int
481  size,
482  int gpkg_mode,
483  int
484  gpkg_amphibious);
485 
500  GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb (gaiaGeomCollPtr geom,
501  unsigned char **result,
502  int *size);
503 
519  GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkbEx (gaiaGeomCollPtr geom,
520  unsigned char **result,
521  int *size, int gpkg_mode);
522 
539  GAIAGEO_DECLARE void gaiaToCompressedBlobWkb (gaiaGeomCollPtr geom,
540  unsigned char **result,
541  int *size);
542 
558  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb (const unsigned char *blob,
559  unsigned int size);
560 
578  GAIAGEO_DECLARE void gaiaToWkb (gaiaGeomCollPtr geom,
579  unsigned char **result, int *size);
580 
595  GAIAGEO_DECLARE char *gaiaToHexWkb (gaiaGeomCollPtr geom);
596 
608  GAIAGEO_DECLARE void gaiaToEWKB (gaiaOutBufferPtr out_buf,
609  gaiaGeomCollPtr geom);
610 
626  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromEWKB (const unsigned char
627  *in_buffer);
628 
643  GAIAGEO_DECLARE unsigned char *gaiaParseHexEWKB (const unsigned char
644  *blob_hex, int *blob_size);
645 
664  GAIAGEO_DECLARE int
665  gaiaEwkbGetPoint (gaiaGeomCollPtr geom, unsigned char *blob,
666  int offset, int blob_size, int endian,
667  int endian_arch, int dims);
668 
687  GAIAGEO_DECLARE int
688  gaiaEwkbGetLinestring (gaiaGeomCollPtr geom, unsigned char *blob,
689  int offset, int blob_size, int endian,
690  int endian_arch, int dims);
691 
708  GAIAGEO_DECLARE int
709  gaiaEwkbGetPolygon (gaiaGeomCollPtr geom, unsigned char *blob,
710  int offset, int blob_size, int endian,
711  int endian_arch, int dims);
712 
731  GAIAGEO_DECLARE int
732  gaiaEwkbGetMultiGeometry (gaiaGeomCollPtr geom, unsigned char *blob,
733  int offset, int blob_size, int endian,
734  int endian_arch, int dims);
735 
751  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf (const unsigned char *blob,
752  unsigned int size);
753 
769  GAIAGEO_DECLARE void gaiaToFgf (gaiaGeomCollPtr geom,
770  unsigned char **result, int *size,
771  int coord_dims);
772 
790  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt (const unsigned char
791  *in_buffer, short type);
792 
806  GAIAGEO_DECLARE void gaiaOutWkt (gaiaOutBufferPtr out_buf,
807  gaiaGeomCollPtr geom);
808 
822  GAIAGEO_DECLARE void gaiaOutWktEx (gaiaOutBufferPtr out_buf,
823  gaiaGeomCollPtr geom, int precision);
824 
838  GAIAGEO_DECLARE void gaiaOutWktStrict (gaiaOutBufferPtr out_buf,
839  gaiaGeomCollPtr geom, int precision);
840 
855  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseEWKT (const unsigned char
856  *in_buffer);
857 
868  GAIAGEO_DECLARE void gaiaToEWKT (gaiaOutBufferPtr out_buf,
869  gaiaGeomCollPtr geom);
870 
881  GAIAGEO_DECLARE void gaiaOutPointZ (gaiaOutBufferPtr out_buf,
882  gaiaPointPtr point);
883 
895  GAIAGEO_DECLARE void gaiaOutPointZex (gaiaOutBufferPtr out_buf,
896  gaiaPointPtr point, int precision);
897 
908  GAIAGEO_DECLARE void gaiaOutLinestringZ (gaiaOutBufferPtr out_buf,
909  gaiaLinestringPtr linestring);
910 
922  GAIAGEO_DECLARE void gaiaOutLinestringZex (gaiaOutBufferPtr out_buf,
923  gaiaLinestringPtr linestring,
924  int precision);
925 
936  GAIAGEO_DECLARE void gaiaOutPolygonZ (gaiaOutBufferPtr out_buf,
937  gaiaPolygonPtr polygon);
938 
950  GAIAGEO_DECLARE void gaiaOutPolygonZex (gaiaOutBufferPtr out_buf,
951  gaiaPolygonPtr polygon,
952  int precision);
953 
968  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseKml (const unsigned char
969  *in_buffer);
970 
982  GAIAGEO_DECLARE void gaiaOutBareKml (gaiaOutBufferPtr out_buf,
983  gaiaGeomCollPtr geom, int precision);
984 
998  GAIAGEO_DECLARE void gaiaOutFullKml (gaiaOutBufferPtr out_buf,
999  const char *name, const char *desc,
1000  gaiaGeomCollPtr geom, int precision);
1001 
1018  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml (const unsigned char
1019  *in_buffer,
1020  sqlite3 * sqlite_handle);
1021 
1039  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml_r (const void *p_cache,
1040  const unsigned char
1041  *in_buffer,
1042  sqlite3 * sqlite_handle);
1043 
1057  GAIAGEO_DECLARE void gaiaOutGml (gaiaOutBufferPtr out_buf, int version,
1058  int precision, gaiaGeomCollPtr geom);
1059 
1074  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGeoJSON (const unsigned char
1075  *in_buffer);
1076 
1095  GAIAGEO_DECLARE void gaiaOutGeoJSON (gaiaOutBufferPtr out_buf,
1096  gaiaGeomCollPtr geom, int precision,
1097  int options);
1109  GAIAGEO_DECLARE void gaiaOutSvg (gaiaOutBufferPtr out_buf,
1110  gaiaGeomCollPtr geom, int relative,
1111  int precision);
1112 
1126  GAIAGEO_DECLARE gaiaValuePtr gaiaCloneValue (gaiaValuePtr org);
1127 
1137  GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p);
1138 
1162  GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField (char *name,
1163  unsigned char type,
1164  int offset,
1165  unsigned char length,
1166  unsigned char decimals);
1167 
1177  GAIAGEO_DECLARE void gaiaFreeDbfField (gaiaDbfFieldPtr p);
1178 
1193  GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaCloneDbfField (gaiaDbfFieldPtr org);
1194 
1204  GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field);
1205 
1216  GAIAGEO_DECLARE void gaiaSetIntValue (gaiaDbfFieldPtr field,
1217  sqlite3_int64 value);
1218 
1228  GAIAGEO_DECLARE void gaiaSetDoubleValue (gaiaDbfFieldPtr field,
1229  double value);
1230 
1240  GAIAGEO_DECLARE void gaiaSetStrValue (gaiaDbfFieldPtr field, char *str);
1241 
1254  GAIAGEO_DECLARE gaiaDbfListPtr gaiaAllocDbfList (void);
1255 
1268  GAIAGEO_DECLARE void gaiaFreeDbfList (gaiaDbfListPtr list);
1269 
1280  GAIAGEO_DECLARE int gaiaIsValidDbfList (gaiaDbfListPtr list);
1281 
1302  GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAddDbfField (gaiaDbfListPtr list,
1303  char *name,
1304  unsigned char type,
1305  int offset,
1306  unsigned char length,
1307  unsigned char decimals);
1308 
1319  GAIAGEO_DECLARE void gaiaResetDbfEntity (gaiaDbfListPtr list);
1320 
1333  GAIAGEO_DECLARE gaiaDbfListPtr gaiaCloneDbfEntity (gaiaDbfListPtr org);
1334 
1347  GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile (void);
1348 
1361  GAIAGEO_DECLARE void gaiaFreeShapefile (gaiaShapefilePtr shp);
1362 
1378  GAIAGEO_DECLARE void gaiaOpenShpRead (gaiaShapefilePtr shp,
1379  const char *path,
1380  const char *charFrom,
1381  const char *charTo);
1382 
1404  GAIAGEO_DECLARE void gaiaOpenShpWrite (gaiaShapefilePtr shp,
1405  const char *path, int shape,
1406  gaiaDbfListPtr list,
1407  const char *charFrom,
1408  const char *charTo);
1409 
1430  GAIAGEO_DECLARE int gaiaReadShpEntity (gaiaShapefilePtr shp,
1431  int current_row, int srid);
1432 
1454  GAIAGEO_DECLARE int gaiaReadShpEntity_ex (gaiaShapefilePtr shp,
1455  int current_row, int srid,
1456  int text_dates);
1457 
1471  GAIAGEO_DECLARE void gaiaShpAnalyze (gaiaShapefilePtr shp);
1472 
1487  GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp,
1488  gaiaDbfListPtr entity);
1489 
1502  GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp);
1503 
1516  GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf (void);
1517 
1530  GAIAGEO_DECLARE void gaiaFreeDbf (gaiaDbfPtr dbf);
1531 
1546  GAIAGEO_DECLARE void gaiaOpenDbfRead (gaiaDbfPtr dbf,
1547  const char *path,
1548  const char *charFrom,
1549  const char *charTo);
1550 
1565  GAIAGEO_DECLARE void gaiaOpenDbfWrite (gaiaDbfPtr dbf,
1566  const char *path,
1567  const char *charFrom,
1568  const char *charTo);
1569 
1590  GAIAGEO_DECLARE int gaiaReadDbfEntity (gaiaDbfPtr dbf, int current_row,
1591  int *deleted);
1592 
1614  GAIAGEO_DECLARE int gaiaReadDbfEntity_ex (gaiaDbfPtr dbf, int current_row,
1615  int *deleted, int text_dates);
1616 
1631  GAIAGEO_DECLARE int gaiaWriteDbfEntity (gaiaDbfPtr dbf,
1632  gaiaDbfListPtr entity);
1633 
1646  GAIAGEO_DECLARE void gaiaFlushDbfHeader (gaiaDbfPtr dbf);
1647 
1648 
1649 
1650 #ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */
1651 
1673  GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc (const char *path,
1674  char field_separator,
1675  char text_separator,
1676  char
1677  decimal_separator,
1678  int
1679  first_line_titles,
1680  const char
1681  *encoding);
1682 
1691  GAIAGEO_DECLARE void gaiaTextReaderDestroy (gaiaTextReaderPtr reader);
1692 
1708  GAIAGEO_DECLARE int gaiaTextReaderParse (gaiaTextReaderPtr reader);
1709 
1725  GAIAGEO_DECLARE int gaiaTextReaderGetRow (gaiaTextReaderPtr reader,
1726  int row_num);
1727 
1741  GAIAGEO_DECLARE int gaiaTextReaderFetchField (gaiaTextReaderPtr reader,
1742  int field_num, int *type,
1743  const char **value);
1744 
1745 #endif /* end ICONV (text reader) */
1746 
1747 #ifdef __cplusplus
1748 }
1749 #endif
1750 
1751 #endif /* _GG_FORMATS_H */
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 void gaiaMakeLine(gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Segment (2-Points Linestring)
GAIAGEO_DECLARE void gaiaFreeDbf(gaiaDbfPtr dbf)
Destroys a DBF File object.
GAIAGEO_DECLARE int gaiaEndianArch(void)
Test CPU endianness.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseKml(const unsigned char *in_buffer)
Creates a Geometry object from KML notation.
GAIAGEO_DECLARE void gaiaResetDbfEntity(gaiaDbfListPtr list)
Resets a DBF List object to its initial empty state.
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 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 gaiaSetStrValue(gaiaDbfFieldPtr field, char *str)
Sets a TEXT current value for a DBF Field object.
GAIAGEO_DECLARE char * gaiaToHexWkb(gaiaGeomCollPtr geom)
Encodes a Geometry object into (hex) WKB notation.
GAIAGEO_DECLARE void gaiaFreeDbfField(gaiaDbfFieldPtr p)
Destroys a DBF Field object.
GAIAGEO_DECLARE void gaiaToWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Encodes a Geometry object into WKB notation.
Container for DBF field.
Definition: gg_structs.h:308
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaCloneDbfField(gaiaDbfFieldPtr org)
Allocates a new DBF Field object [duplicating an existing one].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromEWKB(const unsigned char *in_buffer)
Creates a Geometry object from EWKB notation.
GAIAGEO_DECLARE void gaiaMakePointZ(double x, double y, double z, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointZ.
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 gaiaReadShpEntity_ex(gaiaShapefilePtr shp, int current_row, int srid, int text_dates)
Reads a feature from a Shapefile object.
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 gaiaDbfListPtr gaiaCloneDbfEntity(gaiaDbfListPtr org)
Allocates a new DBF List object [duplicating an existing one].
GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf(void)
Allocates a new 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.
Container for OGC POINT Geometry.
Definition: gg_structs.h:68
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.
Container for OGC POLYGON Geometry.
Definition: gg_structs.h:182
GAIAGEO_DECLARE void gaiaOutGml(gaiaOutBufferPtr out_buf, int version, int precision, gaiaGeomCollPtr geom)
Encodes a Geometry object into GML notation.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml(const unsigned char *in_buffer, sqlite3 *sqlite_handle)
Creates a Geometry object from GML notation.
GAIAGEO_DECLARE int gaiaWriteDbfEntity(gaiaDbfPtr dbf, gaiaDbfListPtr entity)
Writes a record into a DBF File object.
GAIAGEO_DECLARE void gaiaOutGeoJSON(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision, int options)
Encodes a Geometry object into GeoJSON notation.
GAIAGEO_DECLARE void gaiaOutBareKml(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into KML notation.
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 int gaiaReadDbfEntity(gaiaDbfPtr dbf, int current_row, int *deleted)
Reads a record from a DBF File object.
GAIAGEO_DECLARE int gaiaTextReaderParse(gaiaTextReaderPtr reader)
Prescans the external file associated to a Text Reade object.
GAIAGEO_DECLARE void gaiaTextReaderDestroy(gaiaTextReaderPtr reader)
Destroys a Text Reader object.
GAIAGEO_DECLARE void gaiaOutBufferReset(gaiaOutBufferPtr buf)
Resets a dynamically growing Text output buffer to its initial (empty) state.
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 gaiaDbfListPtr gaiaAllocDbfList(void)
Creates an initially empty DBF List object.
GAIAGEO_DECLARE int gaiaReadShpEntity(gaiaShapefilePtr shp, int current_row, int srid)
Reads a feature from a Shapefile 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.
Container for a list of DBF fields.
Definition: gg_structs.h:334
GAIAGEO_DECLARE int gaiaIsValidDbfList(gaiaDbfListPtr list)
Checks a DBF List object for validity.
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 gaiaExport16(unsigned char *p, short value, int little_endian, int little_endian_arch)
Export an INT-16 value in endian-aware fashion.
GAIAGEO_DECLARE void gaiaMakePoint(double x, double y, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a Point.
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 gaiaSetIntValue(gaiaDbfFieldPtr field, sqlite3_int64 value)
Sets an INTEGER current value for a DBF Field object.
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 gaiaSetDoubleValue(gaiaDbfFieldPtr field, double value)
Sets a DOUBLE current value for a DBF Field object.
GAIAGEO_DECLARE void gaiaToFgf(gaiaGeomCollPtr geom, unsigned char **result, int *size, int coord_dims)
Encodes a Geometry object into FGF notation.
GAIAGEO_DECLARE void gaiaOutLinestringZ(gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring)
Encodes a WKT 3D Linestring [XYZ].
GAIAGEO_DECLARE void gaiaOutPointZex(gaiaOutBufferPtr out_buf, gaiaPointPtr point, int precision)
Encodes a WKT 3D Point [XYZ].
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 gaiaDbfFieldPtr gaiaAllocDbfField(char *name, unsigned char type, int offset, unsigned char length, unsigned char decimals)
Allocates a new DBF Field object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf(const unsigned char *blob, unsigned int size)
Creates a Geometry object from FGF notation.
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 int gaiaTextReaderGetRow(gaiaTextReaderPtr reader, int row_num)
Reads a line from a Text Reader object.
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 gaiaValuePtr gaiaCloneValue(gaiaValuePtr org)
Allocates a new DBF Field Value object [duplicating an existing one].
GAIAGEO_DECLARE void gaiaOutSvg(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int relative, int precision)
Encodes a Geometry object into SVG notation.
GAIAGEO_DECLARE void gaiaFlushShpHeaders(gaiaShapefilePtr shp)
Writes into an output Shapefile any required header / footer.
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Creates a BLOB-Geometry corresponding to a Geometry object.
GAIAGEO_DECLARE void gaiaOpenShpRead(gaiaShapefilePtr shp, const char *path, const char *charFrom, const char *charTo)
Open a Shapefile in read mode.
GAIAGEO_DECLARE void gaiaOutWkt(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into WKT notation.
Container for OGC LINESTRING Geometry.
Definition: gg_structs.h:118
GAIAGEO_DECLARE void gaiaOutWktEx(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into WKT notation.
GAIAGEO_DECLARE void gaiaFreeDbfList(gaiaDbfListPtr list)
Destroys a DBF List object.
Container for dynamically growing output buffer.
Definition: gg_structs.h:460
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 gaiaGeomCollPtr gaiaParseGeoJSON(const unsigned char *in_buffer)
Creates a Geometry object from GeoJSON notation.
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 void gaiaExport32(unsigned char *p, int value, int little_endian, int little_endian_arch)
Export an INT-32 value in endian-aware fashion.
Container for Virtual Text file handling.
Definition: gg_structs.h:565
GAIAGEO_DECLARE void gaiaSetNullValue(gaiaDbfFieldPtr field)
Sets a NULL current value for a DBF Field 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 void gaiaOutBufferInitialize(gaiaOutBufferPtr buf)
Initializes a dynamically growing Text output buffer.
GAIAGEO_DECLARE void gaiaMakePointM(double x, double y, double m, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing a PointM.
Container for SHP file handling.
Definition: gg_structs.h:394
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb(const unsigned char *blob, unsigned int size)
Creates a Geometry object from the corresponding BLOB-Geometry.
Container for DBF file handling.
Definition: gg_structs.h:356
GAIAGEO_DECLARE void gaiaShpAnalyze(gaiaShapefilePtr shp)
Prescans a Shapefile object gathering informations.
GAIAGEO_DECLARE void gaiaOutPointZ(gaiaOutBufferPtr out_buf, gaiaPointPtr point)
Encodes a WKT 3D Point [XYZ].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt(const unsigned char *in_buffer, short type)
Creates a Geometry object from WKT notation.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb(const unsigned char *blob, unsigned int size)
Creates a Geometry object from WKB notation.
GAIAGEO_DECLARE void gaiaOpenShpWrite(gaiaShapefilePtr shp, const char *path, int shape, gaiaDbfListPtr list, const char *charFrom, const char *charTo)
Open a Shapefile in read mode.
GAIAGEO_DECLARE void gaiaOutLinestringZex(gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring, int precision)
Encodes a WKT 3D Linestring [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.
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:216
GAIAGEO_DECLARE void gaiaToEWKB(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into EWKB notation.
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 gaiaToCompressedBlobWkb(gaiaGeomCollPtr geom, unsigned char **result, int *size)
Creates a Compressed BLOB-Geometry corresponding to a Geometry object.
GAIAGEO_DECLARE void gaiaOutPolygonZex(gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon, int precision)
Encodes a WKT 3D Polygon [XYZ].
GAIAGEO_DECLARE void gaiaFreeValue(gaiaValuePtr p)
Resets a DBF Field Value object to its initial empty state.
GAIAGEO_DECLARE void gaiaFreeShapefile(gaiaShapefilePtr shp)
Destroys a Shapefile object.
GAIAGEO_DECLARE void gaiaFlushDbfHeader(gaiaDbfPtr dbf)
Writes into an output DBF File any required header / footer.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseEWKT(const unsigned char *in_buffer)
Creates a Geometry object from EWKT notation.
GAIAGEO_DECLARE void gaiaAppendToOutBuffer(gaiaOutBufferPtr buf, const char *text)
Appends a text string at the end of Text output buffer.
GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile(void)
Allocates a new Shapefile object.
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 void gaiaOpenDbfWrite(gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo)
Open a DBF File in write mode.
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 gaiaOutWktStrict(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision)
Encodes a Geometry object into strict 2D WKT notation.
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 int gaiaWriteShpEntity(gaiaShapefilePtr shp, gaiaDbfListPtr entity)
Writes a feature into a Shapefile object.
GAIAGEO_DECLARE void gaiaOutPolygonZ(gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon)
Encodes a WKT 3D Polygon [XYZ].
GAIAGEO_DECLARE void gaiaToEWKT(gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom)
Encodes a Geometry object into EWKT notation.
GAIAGEO_DECLARE unsigned char * gaiaParseHexEWKB(const unsigned char *blob_hex, int *blob_size)
Translates an EWKB notation from hexadecimal into binary.
Container for variant (multi-type) value.
Definition: gg_structs.h:288