SpatiaLite
3.0.0-stable
|
Geometry handling functions: formats. More...
Go to the source code of this file.
Functions | |
GAIAGEO_DECLARE int | gaiaEndianArch (void) |
Test CPU endianness. | |
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 | gaiaImport32 (const unsigned char *p, int little_endian, int little_endian_arch) |
Import an INT-32 value in endian-aware fashion. | |
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 double | gaiaImport64 (const unsigned char *p, int little_endian, int little_endian_arch) |
Import an DOUBLE-64 in endian-aware fashion. | |
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 | 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 | gaiaExportF32 (unsigned char *p, float value, int little_endian, int little_endian_arch) |
Export 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 | 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 void | gaiaOutBufferInitialize (gaiaOutBufferPtr buf) |
Initializes a dynamically growing Text output buffer. | |
GAIAGEO_DECLARE void | gaiaOutBufferReset (gaiaOutBufferPtr buf) |
Resets a dynamically growing Text output buffer to its initial (empty) state. | |
GAIAGEO_DECLARE void | gaiaAppendToOutBuffer (gaiaOutBufferPtr buf, const char *text) |
Appends a text string at the end of Text output buffer. | |
GAIAGEO_DECLARE void | gaiaMakePoint (double x, double y, int srid, unsigned char **result, int *size) |
Creates a BLOB-Geometry representing a Point. | |
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 | gaiaFromSpatiaLiteBlobWkb (const unsigned char *blob, unsigned int size) |
Creates a Geometry object from the corresponding BLOB-Geometry. | |
GAIAGEO_DECLARE void | gaiaToSpatiaLiteBlobWkb (gaiaGeomCollPtr geom, unsigned char **result, int *size) |
Creates a BLOB-Geometry corresponding to a Geometry object. | |
GAIAGEO_DECLARE void | gaiaToCompressedBlobWkb (gaiaGeomCollPtr geom, unsigned char **result, int *size) |
Creates a Compressed BLOB-Geometry corresponding to a Geometry object. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaFromWkb (const unsigned char *blob, unsigned int size) |
Creates a Geometry object from WKB notation. | |
GAIAGEO_DECLARE void | gaiaToWkb (gaiaGeomCollPtr geom, unsigned char **result, int *size) |
Encodes a Geometry object into WKB notation. | |
GAIAGEO_DECLARE char * | gaiaToHexWkb (gaiaGeomCollPtr geom) |
Encodes a Geometry object into (hex) WKB notation. | |
GAIAGEO_DECLARE void | gaiaToEWKB (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom) |
Encodes a Geometry object into EWKB notation. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaFromEWKB (const unsigned char *in_buffer) |
Creates a Geometry object from EWKB notation. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaFromFgf (const unsigned char *blob, unsigned int size) |
Creates a Geometry object from FGF notation. | |
GAIAGEO_DECLARE void | gaiaToFgf (gaiaGeomCollPtr geom, unsigned char **result, int *size, int coord_dims) |
Encodes a Geometry object into FGF notation. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaParseWkt (const unsigned char *in_buffer, short type) |
Creates a Geometry object from WKT notation. | |
GAIAGEO_DECLARE void | gaiaOutWkt (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom) |
Encodes a Geometry object into WKT notation. | |
GAIAGEO_DECLARE void | gaiaOutWktStrict (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision) |
Encodes a Geometry object into strict 2D WKT notation. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaParseEWKT (const unsigned char *in_buffer) |
Creates a Geometry object from EWKT notation. | |
GAIAGEO_DECLARE void | gaiaToEWKT (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom) |
Encodes a Geometry object into EWKT notation. | |
GAIAGEO_DECLARE void | gaiaOutPointZ (gaiaOutBufferPtr out_buf, gaiaPointPtr point) |
Encodes a WKT 3D Point [XYZ]. | |
GAIAGEO_DECLARE void | gaiaOutLinestringZ (gaiaOutBufferPtr out_buf, gaiaLinestringPtr linestring) |
Encodes a WKT 3D Linestring [XYZ]. | |
GAIAGEO_DECLARE void | gaiaOutPolygonZ (gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon) |
Encodes a WKT 3D Polygon [XYZ]. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaParseKml (const unsigned char *in_buffer) |
Creates a Geometry object from KML notation. | |
GAIAGEO_DECLARE void | gaiaOutBareKml (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision) |
Encodes a Geometry object into KML notation. | |
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 gaiaGeomCollPtr | gaiaParseGml (const unsigned char *in_buffer, sqlite3 *sqlite_handle) |
Creates a Geometry object from GML notation. | |
GAIAGEO_DECLARE void | gaiaOutGml (gaiaOutBufferPtr out_buf, int version, int precision, gaiaGeomCollPtr geom) |
Encodes a Geometry object into GML notation. | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaParseGeoJSON (const unsigned char *in_buffer) |
Creates a Geometry object from GeoJSON notation. | |
GAIAGEO_DECLARE void | gaiaOutGeoJSON (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision, int options) |
Encodes a Geometry object into GeoJSON notation. | |
GAIAGEO_DECLARE void | gaiaOutSvg (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int relative, int precision) |
Encodes a Geometry object into SVG notation. | |
GAIAGEO_DECLARE gaiaValuePtr | gaiaCloneValue (gaiaValuePtr org) |
Allocates a new DBF Field Value object [duplicating an existing one]. | |
GAIAGEO_DECLARE void | gaiaFreeValue (gaiaValuePtr p) |
Resets a DBF Field Value object to its initial empty state. | |
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 | gaiaFreeDbfField (gaiaDbfFieldPtr p) |
Destroys a DBF Field object. | |
GAIAGEO_DECLARE gaiaDbfFieldPtr | gaiaCloneDbfField (gaiaDbfFieldPtr org) |
Allocates a new DBF Field object [duplicating an existing one]. | |
GAIAGEO_DECLARE void | gaiaSetNullValue (gaiaDbfFieldPtr field) |
Sets a NULL current value for a DBF Field object. | |
GAIAGEO_DECLARE void | gaiaSetIntValue (gaiaDbfFieldPtr field, sqlite3_int64 value) |
Sets an INTEGER current value for a DBF Field object. | |
GAIAGEO_DECLARE void | gaiaSetDoubleValue (gaiaDbfFieldPtr field, double value) |
Sets a DOUBLE current value for a DBF Field object. | |
GAIAGEO_DECLARE void | gaiaSetStrValue (gaiaDbfFieldPtr field, char *str) |
Sets a TEXT current value for a DBF Field object. | |
GAIAGEO_DECLARE gaiaDbfListPtr | gaiaAllocDbfList (void) |
Creates an initially empty DBF List object. | |
GAIAGEO_DECLARE void | gaiaFreeDbfList (gaiaDbfListPtr list) |
Destroys a DBF List object. | |
GAIAGEO_DECLARE int | gaiaIsValidDbfList (gaiaDbfListPtr list) |
Checks a DBF List object for validity. | |
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 | gaiaResetDbfEntity (gaiaDbfListPtr list) |
Resets a DBF List object to its initial empty state. | |
GAIAGEO_DECLARE gaiaDbfListPtr | gaiaCloneDbfEntity (gaiaDbfListPtr org) |
Allocates a new DBF List object [duplicating an existing one]. | |
GAIAGEO_DECLARE gaiaShapefilePtr | gaiaAllocShapefile (void) |
Allocates a new Shapefile object. | |
GAIAGEO_DECLARE void | gaiaFreeShapefile (gaiaShapefilePtr shp) |
Destroys a Shapefile 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 | gaiaOpenShpWrite (gaiaShapefilePtr shp, const char *path, int shape, gaiaDbfListPtr list, const char *charFrom, const char *charTo) |
Open a Shapefile in read mode. | |
GAIAGEO_DECLARE int | gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) |
Reads a feature from a Shapefile object. | |
GAIAGEO_DECLARE void | gaiaShpAnalyze (gaiaShapefilePtr shp) |
Prescans a Shapefile object gathering informations. | |
GAIAGEO_DECLARE int | gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) |
Writes a feature into a Shapefile object. | |
GAIAGEO_DECLARE void | gaiaFlushShpHeaders (gaiaShapefilePtr shp) |
Writes into an output Shapefile any required header / footer. | |
GAIAGEO_DECLARE gaiaDbfPtr | gaiaAllocDbf (void) |
Allocates a new DBF File object. | |
GAIAGEO_DECLARE void | gaiaFreeDbf (gaiaDbfPtr dbf) |
Destroys a DBF File object. | |
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 | gaiaOpenDbfWrite (gaiaDbfPtr dbf, const char *path, const char *charFrom, const char *charTo) |
Open a DBF File in write mode. | |
GAIAGEO_DECLARE int | gaiaReadDbfEntity (gaiaDbfPtr dbf, int current_row, int *deleted) |
Reads a record from a DBF File object. | |
GAIAGEO_DECLARE int | gaiaWriteDbfEntity (gaiaDbfPtr dbf, gaiaDbfListPtr entity) |
Writes a record into a DBF File object. | |
GAIAGEO_DECLARE void | gaiaFlushDbfHeader (gaiaDbfPtr dbf) |
Writes into an output DBF File any required header / footer. | |
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 | gaiaTextReaderDestroy (gaiaTextReaderPtr reader) |
Destroys a Text Reader object. | |
GAIAGEO_DECLARE int | gaiaTextReaderParse (gaiaTextReaderPtr reader) |
Prescans the external file associated to a Text Reade object. | |
GAIAGEO_DECLARE int | gaiaTextReaderGetRow (gaiaTextReaderPtr reader, int row_num) |
Reads a line from a Text Reader object. | |
GAIAGEO_DECLARE int | gaiaTextReaderFetchField (gaiaTextReaderPtr reader, int field_num, int *type, const char **value) |
Retrieves an individual field value from the current Line. |
Geometry handling functions: formats.
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.
list | pointer to the DBF List object. |
name | text string: DBF Field name. |
type | identifier of the corresponding DBF data type. |
offset | corresponding offset into the DBF I/O buffer. |
length | max field length (in bytes). |
decimals | precision: number of decimal digits. |
GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf | ( | void | ) |
Allocates a new DBF File object.
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField | ( | char * | name, |
unsigned char | type, | ||
int | offset, | ||
unsigned char | length, | ||
unsigned char | decimals | ||
) |
Allocates a new DBF Field object.
name | text string: DBF Field name. |
type | identifier of the corresponding DBF data type. |
offset | corresponding offset into the DBF I/O buffer. |
length | max field length (in bytes). |
decimals | precision: number of decimal digits. |
GAIAGEO_DECLARE gaiaDbfListPtr gaiaAllocDbfList | ( | void | ) |
Creates an initially empty DBF List object.
GAIAGEO_DECLARE gaiaShapefilePtr gaiaAllocShapefile | ( | void | ) |
Allocates a new Shapefile object.
GAIAGEO_DECLARE void gaiaAppendToOutBuffer | ( | gaiaOutBufferPtr | buf, |
const char * | text | ||
) |
Appends a text string at the end of Text output buffer.
buf | pointer to gaiaOutBufferStruct structure. |
text | the text string to be appended. |
GAIAGEO_DECLARE gaiaDbfListPtr gaiaCloneDbfEntity | ( | gaiaDbfListPtr | org | ) |
Allocates a new DBF List object [duplicating an existing one].
org | pointer to input DBF List object. |
GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaCloneDbfField | ( | gaiaDbfFieldPtr | org | ) |
Allocates a new DBF Field object [duplicating an existing one].
org | pointer to input DBF Field object. |
GAIAGEO_DECLARE gaiaValuePtr gaiaCloneValue | ( | gaiaValuePtr | org | ) |
Allocates a new DBF Field Value object [duplicating an existing one].
org | pointer to input DBF Field Value object. |
GAIAGEO_DECLARE int gaiaEndianArch | ( | void | ) |
Test CPU endianness.
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.
p | endian-dependent representation (output buffer). |
value | the internal value to be exported. |
little_endian | 0 if the output buffer has to be big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
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.
p | endian-dependent representation (output buffer). |
value | the internal value to be exported. |
little_endian | 0 if the output buffer has to be big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE void gaiaExport64 | ( | unsigned char * | p, |
double | value, | ||
int | little_endian, | ||
int | little_endian_arch | ||
) |
Export a DOUBLE value in endian-aware fashion.
p | endian-dependent representation (output buffer). |
value | the internal value to be exported. |
little_endian | 0 if the output buffer has to be big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
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.
p | endian-dependent representation (output buffer). |
value | the internal value to be exported. |
little_endian | 0 if the output buffer has to be big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
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.
p | endian-dependent representation (output buffer). |
value | the internal value to be exported. |
little_endian | 0 if the output buffer has to be big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE void gaiaFlushDbfHeader | ( | gaiaDbfPtr | dbf | ) |
Writes into an output DBF File any required header / footer.
dbf | pointer to the DBF File object. |
GAIAGEO_DECLARE void gaiaFlushShpHeaders | ( | gaiaShapefilePtr | shp | ) |
Writes into an output Shapefile any required header / footer.
shp | pointer to the Shapefile object. |
GAIAGEO_DECLARE void gaiaFreeDbf | ( | gaiaDbfPtr | dbf | ) |
Destroys a DBF File object.
dbf | pointer to the DBF File object. |
GAIAGEO_DECLARE void gaiaFreeDbfField | ( | gaiaDbfFieldPtr | p | ) |
Destroys a DBF Field object.
p | pointer to DBF Field object |
GAIAGEO_DECLARE void gaiaFreeDbfList | ( | gaiaDbfListPtr | list | ) |
Destroys a DBF List object.
list | pointer to the DBF List object |
GAIAGEO_DECLARE void gaiaFreeShapefile | ( | gaiaShapefilePtr | shp | ) |
Destroys a Shapefile object.
shp | pointer to the Shapefile object. |
GAIAGEO_DECLARE void gaiaFreeValue | ( | gaiaValuePtr | p | ) |
Resets a DBF Field Value object to its initial empty state.
p | pointer to DBF Field Value object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromEWKB | ( | const unsigned char * | in_buffer | ) |
Creates a Geometry object from EWKB notation.
in_buffer | pointer to EWKB buffer |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf | ( | const unsigned char * | blob, |
unsigned int | size | ||
) |
Creates a Geometry object from FGF notation.
blob | pointer to FGF buffer |
size | the BLOB's size (in bytes) |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb | ( | const unsigned char * | blob, |
unsigned int | size | ||
) |
Creates a Geometry object from the corresponding BLOB-Geometry.
blob | pointer to BLOB-Geometry |
size | the BLOB's size |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb | ( | const unsigned char * | blob, |
unsigned int | size | ||
) |
Creates a Geometry object from WKB notation.
blob | pointer to WKB buffer |
size | the BLOB's size (in bytes) |
GAIAGEO_DECLARE short gaiaImport16 | ( | const unsigned char * | p, |
int | little_endian, | ||
int | little_endian_arch | ||
) |
Import an INT-16 value in endian-aware fashion.
p | endian-dependent representation (input buffer). |
little_endian | 0 if the input buffer is big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE int gaiaImport32 | ( | const unsigned char * | p, |
int | little_endian, | ||
int | little_endian_arch | ||
) |
Import an INT-32 value in endian-aware fashion.
p | endian-dependent representation (input buffer). |
little_endian | 0 if the input buffer is big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE double gaiaImport64 | ( | const unsigned char * | p, |
int | little_endian, | ||
int | little_endian_arch | ||
) |
Import an DOUBLE-64 in endian-aware fashion.
p | endian-dependent representation (input buffer). |
little_endian | 0 if the input buffer is big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE float gaiaImportF32 | ( | const unsigned char * | p, |
int | little_endian, | ||
int | little_endian_arch | ||
) |
Import a FLOAT-32 value in endian-aware fashion.
p | endian-dependent representation (input buffer). |
little_endian | 0 if the input buffer is big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE sqlite3_int64 gaiaImportI64 | ( | const unsigned char * | p, |
int | little_endian, | ||
int | little_endian_arch | ||
) |
Import an INT-64 in endian-aware fashion.
p | endian-dependent representation (input buffer). |
little_endian | 0 if the input buffer is big-endian: any other value for little-endian. |
little_endian_arch | the value returned by gaiaEndianArch() |
GAIAGEO_DECLARE int gaiaIsValidDbfList | ( | gaiaDbfListPtr | list | ) |
Checks a DBF List object for validity.
list | pointer to the DBF List object. |
GAIAGEO_DECLARE void gaiaMakeLine | ( | gaiaGeomCollPtr | geom1, |
gaiaGeomCollPtr | geom2, | ||
unsigned char ** | result, | ||
int * | size | ||
) |
Creates a BLOB-Geometry representing a Segment (2-Points Linestring)
geom1 | pointer to first Geometry object (expected to represent a Point). |
geom2 | pointer to second Geometry object (expected to represent a Point). |
result | on completion will containt a pointer to BLOB-Geometry: NULL on failure. |
size | on completion this variable will contain the BLOB's size (in bytes) |
GAIAGEO_DECLARE void gaiaMakePoint | ( | double | x, |
double | y, | ||
int | srid, | ||
unsigned char ** | result, | ||
int * | size | ||
) |
Creates a BLOB-Geometry representing a Point.
x | Point X coordinate. |
y | Point Y coordinate. |
srid | the SRID to be set for the Point. |
result | on completion will containt a pointer to BLOB-Geometry: NULL on failure. |
size | on completion this variable will contain the BLOB's size (in bytes) |
GAIAGEO_DECLARE void gaiaOpenDbfRead | ( | gaiaDbfPtr | dbf, |
const char * | path, | ||
const char * | charFrom, | ||
const char * | charTo | ||
) |
Open a DBF File in read mode.
dbf | pointer to the DBF File object. |
path | pathname to the corresponding file-system file. |
charFrom | GNU ICONV name identifying the input charset encoding. |
charTo | GNU ICONV name identifying the output charset encoding. |
GAIAGEO_DECLARE void gaiaOpenDbfWrite | ( | gaiaDbfPtr | dbf, |
const char * | path, | ||
const char * | charFrom, | ||
const char * | charTo | ||
) |
Open a DBF File in write mode.
dbf | pointer to the DBF File object. |
path | pathname to the corresponding file-system file. |
charFrom | GNU ICONV name identifying the input charset encoding. |
charTo | GNU ICONV name identifying the output charset encoding. |
GAIAGEO_DECLARE void gaiaOpenShpRead | ( | gaiaShapefilePtr | shp, |
const char * | path, | ||
const char * | charFrom, | ||
const char * | charTo | ||
) |
Open a Shapefile in read mode.
shp | pointer to the Shapefile object. |
path | abstract pathname to the corresponding file-system files. |
charFrom | GNU ICONV name identifying the input charset encoding. |
charTo | GNU ICONV name identifying the output charset encoding. |
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.
shp | pointer to the Shapefile object. |
path | abstract pathname to the corresponding file-system files. |
shape | the SHAPE code; expected to be one of GAIA_SHP_POINT, GAIA_SHP_POLYLINE, GAIA_SHP_POLYGON, GAIA_SHP_MULTIPOINT, GAIA_SHP_POINTZ, GAIA_SHP_POLYLINEZ, GAIA_SHP_POLYGONZ, GAIA_SHP_MULTIPOINTZ, GAIA_SHP_POINTM, GAIA_SHP_POLYLINEM, GAIA_SHP_POLYGONM, GAIA_SHP_MULTIPOINTM |
list | pointer to DBF List object representing the corresponding data attributes. |
charFrom | GNU ICONV name identifying the input charset encoding. |
charTo | GNU ICONV name identifying the output charset encoding. |
GAIAGEO_DECLARE void gaiaOutBareKml | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom, | ||
int | precision | ||
) |
Encodes a Geometry object into KML notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
precision | decimal digits to be used for coordinates |
GAIAGEO_DECLARE void gaiaOutBufferInitialize | ( | gaiaOutBufferPtr | buf | ) |
Initializes a dynamically growing Text output buffer.
buf | pointer to gaiaOutBufferStruct structure |
GAIAGEO_DECLARE void gaiaOutBufferReset | ( | gaiaOutBufferPtr | buf | ) |
Resets a dynamically growing Text output buffer to its initial (empty) state.
buf | pointer to gaiaOutBufferStruct structure |
GAIAGEO_DECLARE void gaiaOutFullKml | ( | gaiaOutBufferPtr | out_buf, |
const char * | name, | ||
const char * | desc, | ||
gaiaGeomCollPtr | geom, | ||
int | precision | ||
) |
Encodes a Geometry object into KML notation.
out_buf | pointer to dynamically growing Text buffer |
name | text string to be set as KML name |
desc | text string to se set as KML description |
geom | pointer to Geometry object |
precision | decimal digits to be used for coordinates |
GAIAGEO_DECLARE void gaiaOutGeoJSON | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom, | ||
int | precision, | ||
int | options | ||
) |
Encodes a Geometry object into GeoJSON notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
precision | decimal digits to be used for coordinates |
options | GeoJSON specific options |
GAIAGEO_DECLARE void gaiaOutGml | ( | gaiaOutBufferPtr | out_buf, |
int | version, | ||
int | precision, | ||
gaiaGeomCollPtr | geom | ||
) |
Encodes a Geometry object into GML notation.
out_buf | pointer to dynamically growing Text buffer |
version | GML version |
precision | decimal digits to be used for coordinates |
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaOutLinestringZ | ( | gaiaOutBufferPtr | out_buf, |
gaiaLinestringPtr | linestring | ||
) |
Encodes a WKT 3D Linestring [XYZ].
out_buf | pointer to dynamically growing Text buffer |
linestring | pointer to Linestring object |
GAIAGEO_DECLARE void gaiaOutPointZ | ( | gaiaOutBufferPtr | out_buf, |
gaiaPointPtr | point | ||
) |
Encodes a WKT 3D Point [XYZ].
out_buf | pointer to dynamically growing Text buffer |
point | pointer to Point object |
GAIAGEO_DECLARE void gaiaOutPolygonZ | ( | gaiaOutBufferPtr | out_buf, |
gaiaPolygonPtr | polygon | ||
) |
Encodes a WKT 3D Polygon [XYZ].
out_buf | pointer to dynamically growing Text buffer |
polygon | pointer to Point object |
GAIAGEO_DECLARE void gaiaOutSvg | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom, | ||
int | relative, | ||
int | precision | ||
) |
Encodes a Geometry object into SVG notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
relative | flag: relative or absolute coordinates |
precision | decimal digits to be used for coordinates |
GAIAGEO_DECLARE void gaiaOutWkt | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom | ||
) |
Encodes a Geometry object into WKT notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaOutWktStrict | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom, | ||
int | precision | ||
) |
Encodes a Geometry object into strict 2D WKT notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
precision | decimal digits to be used for coordinates |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseEWKT | ( | const unsigned char * | in_buffer | ) |
Creates a Geometry object from EWKT notation.
in_buffer | pointer to EWKT buffer |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGeoJSON | ( | const unsigned char * | in_buffer | ) |
Creates a Geometry object from GeoJSON notation.
in_buffer | pointer to GeoJSON buffer |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseGml | ( | const unsigned char * | in_buffer, |
sqlite3 * | sqlite_handle | ||
) |
Creates a Geometry object from GML notation.
in_buffer | pointer to GML buffer |
sqlite_handle | handle to current DB connection |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseKml | ( | const unsigned char * | in_buffer | ) |
Creates a Geometry object from KML notation.
in_buffer | pointer to KML buffer |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt | ( | const unsigned char * | in_buffer, |
short | type | ||
) |
Creates a Geometry object from WKT notation.
in_buffer | pointer to WKT buffer |
type | the expected Geometry Class Type if actual type defined in WKT doesn't corresponds to this, an error will be raised. |
GAIAGEO_DECLARE int gaiaReadDbfEntity | ( | gaiaDbfPtr | dbf, |
int | current_row, | ||
int * | deleted | ||
) |
Reads a record from a DBF File object.
dbf | pointer to the DBF File object. |
current_row | the row number identifying the record to be read. |
deleted | on completion this variable will contain 0 if the record just read is valid: any other value if the record just read is marked as logically deleted. |
GAIAGEO_DECLARE int gaiaReadShpEntity | ( | gaiaShapefilePtr | shp, |
int | current_row, | ||
int | srid | ||
) |
Reads a feature from a Shapefile object.
shp | pointer to the Shapefile object. |
current_row | the row number identifying the feature to be read. |
srid | feature's SRID |
GAIAGEO_DECLARE void gaiaResetDbfEntity | ( | gaiaDbfListPtr | list | ) |
Resets a DBF List object to its initial empty state.
list | pointer to the DBF List object. |
GAIAGEO_DECLARE void gaiaSetDoubleValue | ( | gaiaDbfFieldPtr | field, |
double | value | ||
) |
Sets a DOUBLE current value for a DBF Field object.
field | pointer to DBF Field object. |
value | double value to be set. |
GAIAGEO_DECLARE void gaiaSetIntValue | ( | gaiaDbfFieldPtr | field, |
sqlite3_int64 | value | ||
) |
Sets an INTEGER current value for a DBF Field object.
field | pointer to DBF Field object. |
value | integer value to be set. |
GAIAGEO_DECLARE void gaiaSetNullValue | ( | gaiaDbfFieldPtr | field | ) |
Sets a NULL current value for a DBF Field object.
field | pointer to DBF Field object |
GAIAGEO_DECLARE void gaiaSetStrValue | ( | gaiaDbfFieldPtr | field, |
char * | str | ||
) |
Sets a TEXT current value for a DBF Field object.
field | pointer to DBF Field object. |
str | text string value to be set. |
GAIAGEO_DECLARE void gaiaShpAnalyze | ( | gaiaShapefilePtr | shp | ) |
Prescans a Shapefile object gathering informations.
shp | pointer to the Shapefile object. |
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.
path | to the corresponding file-system file. |
field_separator | the character acting as a separator between adjacent fields. |
text_separator | the character used to quote text strings. |
decimal_separator | the character used as a separator between integer and decimal digits for real numeric values. |
first_line_titles | 0 if the first line contains regular values: any other value if the first line contains column names. |
encoding | GNU ICONV name identifying the input charset encoding. |
GAIAGEO_DECLARE void gaiaTextReaderDestroy | ( | gaiaTextReaderPtr | reader | ) |
Destroys a Text Reader object.
reader | pointer to Text Reader object. |
GAIAGEO_DECLARE int gaiaTextReaderFetchField | ( | gaiaTextReaderPtr | reader, |
int | field_num, | ||
int * | type, | ||
const char ** | value | ||
) |
Retrieves an individual field value from the current Line.
reader | pointer to Text Reader object. |
field_num | relative field [aka column] index: first field has index 0. |
type | on completion this variable will contain the value type. |
value | on completion this variable will contain the current field value. |
GAIAGEO_DECLARE int gaiaTextReaderGetRow | ( | gaiaTextReaderPtr | reader, |
int | row_num | ||
) |
Reads a line from a Text Reader object.
reader | pointer to Text Reader object. |
row_num | the Line Number identifying the Line to be read. |
GAIAGEO_DECLARE int gaiaTextReaderParse | ( | gaiaTextReaderPtr | reader | ) |
Prescans the external file associated to a Text Reade object.
reader | pointer to Text Reader object. |
GAIAGEO_DECLARE void gaiaToCompressedBlobWkb | ( | gaiaGeomCollPtr | geom, |
unsigned char ** | result, | ||
int * | size | ||
) |
Creates a Compressed BLOB-Geometry corresponding to a Geometry object.
geom | pointer to the Geometry object. |
result | on completion will containt a pointer to Compressed BLOB-Geometry: NULL on failure. |
size | on completion this variable will contain the BLOB's size (in bytes) |
GAIAGEO_DECLARE void gaiaToEWKB | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom | ||
) |
Encodes a Geometry object into EWKB notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaToEWKT | ( | gaiaOutBufferPtr | out_buf, |
gaiaGeomCollPtr | geom | ||
) |
Encodes a Geometry object into EWKT notation.
out_buf | pointer to dynamically growing Text buffer |
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaToFgf | ( | gaiaGeomCollPtr | geom, |
unsigned char ** | result, | ||
int * | size, | ||
int | coord_dims | ||
) |
Encodes a Geometry object into FGF notation.
geom | pointer to Geometry object |
result | on completion will containt a pointer to the FGF buffer [BLOB]: NULL on failure. |
size | on completion this variable will contain the BLOB's size (in bytes) |
coord_dims | one of: GAIA_XY, GAIA_XY_Z, GAIA_XY_M, GAIA_XY_ZM |
GAIAGEO_DECLARE char* gaiaToHexWkb | ( | gaiaGeomCollPtr | geom | ) |
Encodes a Geometry object into (hex) WKB notation.
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb | ( | gaiaGeomCollPtr | geom, |
unsigned char ** | result, | ||
int * | size | ||
) |
Creates a BLOB-Geometry corresponding to a Geometry object.
geom | pointer to the Geometry object. |
result | on completion will containt a pointer to BLOB-Geometry: NULL on failure. |
size | on completion this variable will contain the BLOB's size (in bytes) |
GAIAGEO_DECLARE void gaiaToWkb | ( | gaiaGeomCollPtr | geom, |
unsigned char ** | result, | ||
int * | size | ||
) |
Encodes a Geometry object into WKB notation.
geom | pointer to Geometry object |
result | on completion will containt a pointer to the WKB buffer [BLOB]: NULL on failure. |
size | on completion this variable will contain the BLOB's size (in bytes) |
GAIAGEO_DECLARE int gaiaWriteDbfEntity | ( | gaiaDbfPtr | dbf, |
gaiaDbfListPtr | entity | ||
) |
Writes a record into a DBF File object.
dbf | pointer to the DBF File object. |
entity | pointer to DBF List object containing Fields and corresponding values. |
GAIAGEO_DECLARE int gaiaWriteShpEntity | ( | gaiaShapefilePtr | shp, |
gaiaDbfListPtr | entity | ||
) |
Writes a feature into a Shapefile object.
shp | pointer to the Shapefile object. |
entity | pointer to DBF List object containing both Geometry and Field values. |