| gg_advanced.h | | gg_advanced.h | |
| /* | | /* | |
| gg_advanced.h -- Gaia common support for geometries: advanced | | gg_advanced.h -- Gaia common support for geometries: advanced | |
| | | | |
|
| version 4.0, 2012 August 6 | | version 4.1, 2013 May 8 | |
| | | | |
| Author: Sandro Furieri a.furieri@lqt.it | | Author: Sandro Furieri a.furieri@lqt.it | |
| | | | |
| --------------------------------------------------------------------------
---- | | --------------------------------------------------------------------------
---- | |
| | | | |
| Version: MPL 1.1/GPL 2.0/LGPL 2.1 | | Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
| | | | |
| The contents of this file are subject to the Mozilla Public License Versio
n | | The contents of this file are subject to the Mozilla Public License Versio
n | |
| 1.1 (the "License"); you may not use this file except in compliance with | | 1.1 (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | | the License. You may obtain a copy of the License at | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| | | | |
| Software distributed under the License is distributed on an "AS IS" basis, | | Software distributed under the License is distributed on an "AS IS" basis, | |
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| for the specific language governing rights and limitations under the | | for the specific language governing rights and limitations under the | |
| License. | | License. | |
| | | | |
| The Original Code is the SpatiaLite library | | The Original Code is the SpatiaLite library | |
| | | | |
| The Initial Developer of the Original Code is Alessandro Furieri | | The Initial Developer of the Original Code is Alessandro Furieri | |
| | | | |
|
| Portions created by the Initial Developer are Copyright (C) 2008-2012 | | Portions created by the Initial Developer are Copyright (C) 2008-2013 | |
| the Initial Developer. All Rights Reserved. | | the Initial Developer. All Rights Reserved. | |
| | | | |
| Contributor(s): | | Contributor(s): | |
| | | | |
| Alternatively, the contents of this file may be used under the terms of | | Alternatively, the contents of this file may be used under the terms of | |
| either the GNU General Public License Version 2 or later (the "GPL"), or | | either the GNU General Public License Version 2 or later (the "GPL"), or | |
| the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | | the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | |
| in which case the provisions of the GPL or the LGPL are applicable instead | | in which case the provisions of the GPL or the LGPL are applicable instead | |
| of those above. If you wish to allow use of your version of this file only | | of those above. If you wish to allow use of your version of this file only | |
| under the terms of either the GPL or the LGPL, and not to allow others to | | under the terms of either the GPL or the LGPL, and not to allow others to | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| \file gg_advanced.h | | \file gg_advanced.h | |
| | | | |
| Geometry handling functions: advanced | | Geometry handling functions: advanced | |
| */ | | */ | |
| | | | |
| #ifndef _GG_ADVANCED_H | | #ifndef _GG_ADVANCED_H | |
| #ifndef DOXYGEN_SHOULD_SKIP_THIS | | #ifndef DOXYGEN_SHOULD_SKIP_THIS | |
| #define _GG_ADVANCED_H | | #define _GG_ADVANCED_H | |
| #endif | | #endif | |
| | | | |
|
| | | /** Gaia-to-GEOS: all geometries */ | |
| #define GAIA2GEOS_ALL 0 | | #define GAIA2GEOS_ALL 0 | |
|
| | | | |
| | | /** Gaia-to-GEOS: only geometries of the Point type */ | |
| #define GAIA2GEOS_ONLY_POINTS 1 | | #define GAIA2GEOS_ONLY_POINTS 1 | |
|
| | | | |
| | | /** Gaia-to-GEOS: only geometries of the Linestring type */ | |
| #define GAIA2GEOS_ONLY_LINESTRINGS 2 | | #define GAIA2GEOS_ONLY_LINESTRINGS 2 | |
|
| | | | |
| | | /** Gaia-to-GEOS: only geometries of the Polygon type */ | |
| #define GAIA2GEOS_ONLY_POLYGONS 3 | | #define GAIA2GEOS_ONLY_POLYGONS 3 | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" | | extern "C" | |
| { | | { | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef DOXYGEN_SHOULD_SKIP_THIS | |
| #ifndef OMIT_PROJ /* including PROJ.4 */ | | #ifndef OMIT_PROJ /* including PROJ.4 */ | |
|
| | | #endif | |
| | | | |
| /** | | /** | |
| Converts and angle from Radians into Degrees | | Converts and angle from Radians into Degrees | |
| \param rads the angle measured in Radians. | | \param rads the angle measured in Radians. | |
| | | | |
| \return the angle measured in Degrees. | | \return the angle measured in Degrees. | |
| | | | |
| \sa gaiaDegsToRads | | \sa gaiaDegsToRads | |
| | | | |
| \remark \b PROJ.4 support required | | \remark \b PROJ.4 support required | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 139 | |
| char *proj_from, | | char *proj_from, | |
| char *proj_to); | | char *proj_to); | |
| | | | |
| #endif /* end including PROJ.4 */ | | #endif /* end including PROJ.4 */ | |
| | | | |
| #ifndef OMIT_GEOS /* including GEOS */ | | #ifndef OMIT_GEOS /* including GEOS */ | |
| | | | |
| /** | | /** | |
| Resets the GEOS error and warning messages to an empty state | | Resets the GEOS error and warning messages to an empty state | |
| | | | |
|
| \sa gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, gaiaSetGeosErrorMsg, | | \sa gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, gaiaGeosAuxErrorMsg, | |
| gaiaSetGeosWarningMsg | | gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg, gaiaSetGeosAuxErrorMsg | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE void gaiaResetGeosMsg (void); | | GAIAGEO_DECLARE void gaiaResetGeosMsg (void); | |
| | | | |
| /** | | /** | |
| Return the latest GEOS error message (if any) | | Return the latest GEOS error message (if any) | |
| | | | |
| \return the latest GEOS error message: an empty string if no error was | | \return the latest GEOS error message: an empty string if no error was | |
| previoysly found. | | previoysly found. | |
| | | | |
|
| \sa gaiaResetGeosMsg, gaiaGetGeosWarningMsg, gaiaSetGeosErrorMsg, | | \sa gaiaResetGeosMsg, gaiaGetGeosWarningMsg, gaiaGetGeosAuxErrorMsg, | |
| gaiaSetGeosWarningMsg | | gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg, gaiaSetGeosAuxErrorMsg | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE const char *gaiaGetGeosErrorMsg (void); | | GAIAGEO_DECLARE const char *gaiaGetGeosErrorMsg (void); | |
| | | | |
| /** | | /** | |
| Return the latest GEOS warning message (if any) | | Return the latest GEOS warning message (if any) | |
| | | | |
| \return the latest GEOS warning message: an empty string if no warning was | | \return the latest GEOS warning message: an empty string if no warning was | |
| previoysly found. | | previoysly found. | |
| | | | |
|
| \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaSetGeosErrorMsg, | | \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosAuxErrorMsg, | |
| gaiaSetGeosWarningMsg | | gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg, gaiaSetGeosAuxErrorMsg | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE const char *gaiaGetGeosWarningMsg (void); | | GAIAGEO_DECLARE const char *gaiaGetGeosWarningMsg (void); | |
| | | | |
| /** | | /** | |
|
| | | Return the latest GEOS (auxiliary) error message (if any) | |
| | | | |
| | | \return the latest GEOS (auxiliary) error message: an empty string if no | |
| | | error was previoysly found. | |
| | | | |
| | | \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, | |
| | | gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg, gaiaSetGeosAuxErrorMsg | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE const char *gaiaGetGeosAuxErrorMsg (void); | |
| | | | |
| | | /** | |
| Set the current GEOS error message | | Set the current GEOS error message | |
| | | | |
| \param msg the error message to be set. | | \param msg the error message to be set. | |
| | | | |
| \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, | | \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, | |
|
| gaiaSetGeosWarningMsg | | gaiaGetGeosAuxErrorMsg, gaiaSetGeosWarningMsg, gaiaSetGeosAuxErrorMsg | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg); | | GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg); | |
| | | | |
| /** | | /** | |
| Set the current GEOS warning message | | Set the current GEOS warning message | |
| | | | |
| \param msg the warning message to be set. | | \param msg the warning message to be set. | |
| | | | |
| \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, | | \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, | |
|
| gaiaSetGeosErrorMsg | | gaiaGetGeosAuxErrorMsg, gaiaSetGeosErrorMsg, gaiaSetGeosAuxErrorMsg | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg); | | GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg); | |
| | | | |
| /** | | /** | |
|
| | | Set the current GEOS (auxiliary) error message | |
| | | | |
| | | \param msg the error message to be set. | |
| | | | |
| | | \sa gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, | |
| | | gaiaGetGeosAuxErrorMsg, gaiaSetGeosWarningMsg, gaiaSetGeosErrorMsg | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE void gaiaSetGeosAuxErrorMsg (const char *msg); | |
| | | | |
| | | /** | |
| Converts a Geometry object into a GEOS Geometry | | Converts a Geometry object into a GEOS Geometry | |
| | | | |
| \param gaia pointer to Geometry object | | \param gaia pointer to Geometry object | |
| | | | |
| \return handle to GEOS Geometry | | \return handle to GEOS Geometry | |
| | | | |
| \sa gaiaFromGeos_XY, gaiaFromGeos_XYZ, gaiaFromGeos_XYM, gaiaFromGeos_XYZM
, | | \sa gaiaFromGeos_XY, gaiaFromGeos_XYZ, gaiaFromGeos_XYM, gaiaFromGeos_XYZM
, | |
| gaiaToGeosSelective | | gaiaToGeosSelective | |
| | | | |
| \note convenience method, simply defaulting to gaiaToGeos(geom, GAIA2GEOS_
ALL) | | \note convenience method, simply defaulting to gaiaToGeos(geom, GAIA2GEOS_
ALL) | |
| | | | |
| skipping to change at line 319 | | skipping to change at line 353 | |
| | | | |
| \sa gaiaIsSimple, gaiaIsRing, gaiaIsValid, gaiaIsClosedGeom | | \sa gaiaIsSimple, gaiaIsRing, gaiaIsValid, gaiaIsClosedGeom | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaIsClosed (gaiaLinestringPtr line); | | GAIAGEO_DECLARE int gaiaIsClosed (gaiaLinestringPtr line); | |
| | | | |
| /** | | /** | |
| Checks if a Geometry object represents an OGC Closed Linestring | | Checks if a Geometry object represents an OGC Closed Linestring | |
| | | | |
|
| \param line pointer to Geometry object. | | \param geom pointer to Geometry object. | |
| | | | |
| \return 0 if false; any other value if true | | \return 0 if false; any other value if true | |
| | | | |
| \sa gaiaIsSimple, gaiaIsRing, gaiaIsValid, gaiaIsClosed | | \sa gaiaIsSimple, gaiaIsRing, gaiaIsValid, gaiaIsClosed | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaIsClosedGeom (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaIsClosedGeom (gaiaGeomCollPtr geom); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 396 | | skipping to change at line 430 | |
| int perimeter, | | int perimeter, | |
| double *length); | | double *length); | |
| /** | | /** | |
| Measures the total Area for a Geometry object | | Measures the total Area for a Geometry object | |
| | | | |
| \param geom pointer to Geometry object | | \param geom pointer to Geometry object | |
| \param area on completion this variable will contain the measured area | | \param area on completion this variable will contain the measured area | |
| | | | |
| \return 0 on failure: any other value on success | | \return 0 on failure: any other value on success | |
| | | | |
|
| \sa gaiaGeomCollLength, gaiaMeasureArea | | \sa gaiaGeomCollLength, gaiaMeasureArea, gaiaGeodesicArea | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollArea (gaiaGeomCollPtr geom, double *are
a); | | GAIAGEO_DECLARE int gaiaGeomCollArea (gaiaGeomCollPtr geom, double *are
a); | |
| | | | |
| /** | | /** | |
| Attempts to rearrange a generic Geometry object into a Polygon or MultiPol
ygon | | Attempts to rearrange a generic Geometry object into a Polygon or MultiPol
ygon | |
| | | | |
| \param geom the input Geometry object | | \param geom the input Geometry object | |
| \param force_multi if not set to 0, then an eventual Polygon will be | | \param force_multi if not set to 0, then an eventual Polygon will be | |
| | | | |
| skipping to change at line 431 | | skipping to change at line 465 | |
| /** | | /** | |
| Spatial relationship evalution: Equals | | Spatial relationship evalution: Equals | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, | | \sa gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, | |
| gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | | gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | |
|
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate, gaiaGeomCollPreparedDisjoint | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
| Spatial relationship evalution: Disjoint | | Spatial relationship evalution: Disjoint | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| | | | |
| skipping to change at line 456 | | skipping to change at line 490 | |
| \sa gaiaGeomCollEquals, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, | | \sa gaiaGeomCollEquals, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, | |
| gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | | gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | |
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Spatial relationship evalution: Disjoint (GEOSPreparedGeometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollDisjoint | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedDisjoint (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Spatial relationship evalution: Intesects | | Spatial relationship evalution: Intesects | |
| | | | |
|
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollOverlaps, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollOverlaps, | |
| gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | | gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | |
|
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate, gaiaGeomCollPreparedIntersects | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollIntersects (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollIntersects (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
|
| | | /** | |
| | | Spatial relationship evalution: Intesects (GEOSPreparedGeometry) | |
| | | | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollIntersects | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedIntersects (void *p_cache, | |
| | | gaiaGeomCollPtr geom | |
| | | 1, | |
| | | unsigned char *blob1 | |
| | | , | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom | |
| | | 2, | |
| | | unsigned char *blob2 | |
| | | , | |
| | | int size2); | |
| | | | |
| /** | | /** | |
| Spatial relationship evalution: Overlaps | | Spatial relationship evalution: Overlaps | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | |
| gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | | gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, | |
|
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate, gaiaGeomCollPreparedOverlaps | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollOverlaps (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollOverlaps (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Spatial relationship evalution: Overlaps (GEOSPreparedGeometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollOverlaps | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedOverlaps (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Spatial relationship evalution: Crosses | | Spatial relationship evalution: Crosses | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | |
| gaiaGeomCollOverlaps, gaiaGeomCollContains, gaiaGeomCollWithin, | | gaiaGeomCollOverlaps, gaiaGeomCollContains, gaiaGeomCollWithin, | |
|
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate, gaiaGeomCollCrosses | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollCrosses (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollCrosses (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Spatial relationship evalution: Crosses (GEOSPreparedGeometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollCrosses | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedCrosses (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Spatial relationship evalution: Contains | | Spatial relationship evalution: Contains | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | |
| gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollWithin, | | gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollWithin, | |
|
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate, gaiaGeomCollPreparedContains | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollContains (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollContains (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Spatial relationship evalution: Contains (GEOSPreparedGeometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollContains | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedContains (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Spatial relationship evalution: Within | | Spatial relationship evalution: Within | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | |
| gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, | | gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, | |
|
| gaiaGeomCollTouches, gaiaGeomCollRelate | | gaiaGeomCollTouches, gaiaGeomCollRelate, gaiaGeomCollWithin | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollWithin (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollWithin (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Spatial relationship evalution: Within (GEOSPreparedGeometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollPrepared | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedWithin (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Spatial relationship evalution: Touches | | Spatial relationship evalution: Touches | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | |
| gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, | | gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, | |
|
| gaiaGeomCollWithin, gaiaGeomCollRelate | | gaiaGeomCollWithin, gaiaGeomCollRelate, gaiaGeomCollPreparedTouches | |
| | | | |
| \remark \b GEOS support required. | | \remark \b GEOS support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollTouches (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollTouches (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Spatial relationship evalution: Touches (GEOSPreparedGeometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 the first Geometry object to be evaluated | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 the second Geometry object to be evaluated | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false: any other value if true | |
| | | | |
| | | \sa gaiaGeomCollTouches | |
| | | | |
| | | \remark \b GEOS support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedTouches (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Spatial relationship evalution: Relate | | Spatial relationship evalution: Relate | |
| | | | |
| \param geom1 the first Geometry object to be evaluated | | \param geom1 the first Geometry object to be evaluated | |
| \param geom2 the second Geometry object to be evaluated | | \param geom2 the second Geometry object to be evaluated | |
| \param pattern intersection matrix pattern [DE-9IM] | | \param pattern intersection matrix pattern [DE-9IM] | |
| | | | |
| \return 0 if false: any other value if true | | \return 0 if false: any other value if true | |
| | | | |
| \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | | \sa gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, | |
| gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, | | gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, | |
| | | | |
| skipping to change at line 1111 | | skipping to change at line 1319 | |
| \return 0 if false; any other value if geom1 \e spatially \e covers geom2. | | \return 0 if false; any other value if geom1 \e spatially \e covers geom2. | |
| | | | |
| \sa gaiaGeomCollCoveredBy | | \sa gaiaGeomCollCoveredBy | |
| | | | |
| \remark \b GEOS-ADVANCED support required. | | \remark \b GEOS-ADVANCED support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollCovers (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollCovers (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Topology check: test if a Geometry covers another one (GEOSPreparedGeometr | |
| | | y) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 pointer to first input Geometry object. | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 pointer to second input Geometry object. | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false; any other value if geom1 \e spatially \e covers geom2. | |
| | | | |
| | | \sa gaiaGeomCollCovers | |
| | | | |
| | | \remark \b GEOS-ADVANCED support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedCovers (void *p_cache, | |
| | | gaiaGeomCollPtr geom1, | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2, | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Topology check: test if a Geometry is covered by another one | | Topology check: test if a Geometry is covered by another one | |
| | | | |
| \param geom1 pointer to first input Geometry object. | | \param geom1 pointer to first input Geometry object. | |
| \param geom2 pointer to second input Geometry object. | | \param geom2 pointer to second input Geometry object. | |
| | | | |
| \return 0 if false; any other value if geom2 is \e spatially \e covered \e
by | | \return 0 if false; any other value if geom2 is \e spatially \e covered \e
by | |
| geom1. | | geom1. | |
| | | | |
| \sa gaiaGeomCollCovers | | \sa gaiaGeomCollCovers | |
| | | | |
| \remark \b GEOS-ADVANCED support required. | | \remark \b GEOS-ADVANCED support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaGeomCollCoveredBy (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollCoveredBy (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| /** | | /** | |
|
| | | Topology check: test if a Geometry is covered by another one (GEOSPrepared | |
| | | Geometry) | |
| | | | |
| | | \param p_cache a memory pointer returned by spatialite_alloc_connection() | |
| | | \param geom1 pointer to first input Geometry object. | |
| | | \param blob1 the BLOB corresponding to the first Geometry | |
| | | \param size1 the size (in bytes) of the first BLOB | |
| | | \param geom2 pointer to second input Geometry object. | |
| | | \param blob2 the BLOB corresponding to the second Geometry | |
| | | \param size2 the size (in bytes) of the second BLOB | |
| | | | |
| | | \return 0 if false; any other value if geom2 is \e spatially \e covered \e | |
| | | by | |
| | | geom1. | |
| | | | |
| | | \sa gaiaGeomCollCovers | |
| | | | |
| | | \remark \b GEOS-ADVANCED support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeomCollPreparedCoveredBy (void *p_cache, | |
| | | gaiaGeomCollPtr geom1 | |
| | | , | |
| | | unsigned char *blob1, | |
| | | int size1, | |
| | | gaiaGeomCollPtr geom2 | |
| | | , | |
| | | unsigned char *blob2, | |
| | | int size2); | |
| | | | |
| | | /** | |
| Utility function: SquareGrid | | Utility function: SquareGrid | |
| | | | |
| \param geom the Geometry to be covered by the Grid. | | \param geom the Geometry to be covered by the Grid. | |
| \param origin_x the X ccordinate identifying the Grid Origin. | | \param origin_x the X ccordinate identifying the Grid Origin. | |
| \param origin_y the Y coordinate identifiying the Grid Origin. | | \param origin_y the Y coordinate identifiying the Grid Origin. | |
| \param size the Grid cell-side size. | | \param size the Grid cell-side size. | |
| \param only_edges if non-zero will return a MULTILINESTRING, otherwise it
will | | \param only_edges if non-zero will return a MULTILINESTRING, otherwise it
will | |
| return a MULTIPOLYGON containing square POLYGONs. | | return a MULTIPOLYGON containing square POLYGONs. | |
| | | | |
| \return the pointer to newly created Geometry object: NULL on failure. | | \return the pointer to newly created Geometry object: NULL on failure. | |
| | | | |
| skipping to change at line 1263 | | skipping to change at line 1522 | |
| double extra_frame_s
ize, | | double extra_frame_s
ize, | |
| double tolerance, | | double tolerance, | |
| int only_edges); | | int only_edges); | |
| | | | |
| /** | | /** | |
| Concave Hull | | Concave Hull | |
| | | | |
| \param geom pointer to input Geometry object. | | \param geom pointer to input Geometry object. | |
| \param factor multiplier used for filtering Delaunay triangles: please rea
d the note. | | \param factor multiplier used for filtering Delaunay triangles: please rea
d the note. | |
| \param tolerance optional snapping tolerance. | | \param tolerance optional snapping tolerance. | |
|
| \param allow_hows if FALSE any interior hole will be suppressed. | | \param allow_holes if FALSE any interior hole will be suppressed. | |
| | | | |
| \return the pointer to newly created Geometry object (always of the Polygo
n type): | | \return the pointer to newly created Geometry object (always of the Polygo
n type): | |
| NULL on failure. | | NULL on failure. | |
| \n NULL will be returned if any argument is invalid. | | \n NULL will be returned if any argument is invalid. | |
| | | | |
| \sa gaiaFreeGeomColl, gaiaDelaunayTriangulation | | \sa gaiaFreeGeomColl, gaiaDelaunayTriangulation | |
| | | | |
| \note This function will first create the Delauany Triangulation correspon
ding | | \note This function will first create the Delauany Triangulation correspon
ding | |
| to input Geometry, determining at the same time the \b standard \b deviat
ion | | to input Geometry, determining at the same time the \b standard \b deviat
ion | |
| for all edge's lengths. | | for all edge's lengths. | |
| | | | |
| skipping to change at line 1296 | | skipping to change at line 1555 | |
| double tolerance, | | double tolerance, | |
| int allow_holes); | | int allow_holes); | |
| | | | |
| #endif /* end GEOS experimental features */ | | #endif /* end GEOS experimental features */ | |
| | | | |
| #ifndef DOXYGEN_SHOULD_IGNORE_THIS | | #ifndef DOXYGEN_SHOULD_IGNORE_THIS | |
| #ifdef ENABLE_LWGEOM | | #ifdef ENABLE_LWGEOM | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| | | Resets the LWGEOM error and warning messages to an empty state | |
| | | | |
| | | \sa gaiaGetLwGeomErrorMsg, gaiaGetLwGeomWarningMsg, gaiaSetLwGeomErrorMsg, | |
| | | gaiaSetLwGeomWarningMsg | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE void gaiaResetLwGeomMsg (void); | |
| | | | |
| | | /** | |
| | | Return the latest LWGEOM error message (if any) | |
| | | | |
| | | \return the latest LWGEOM error message: an empty string if no error was | |
| | | previoysly found. | |
| | | | |
| | | \sa gaiaResetLwGeomMsg, gaiaGetLwGeomWarningMsg, gaiaSetLwGeomErrorMsg, | |
| | | gaiaSetLwGeomWarningMsg | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE const char *gaiaGetLwGeomErrorMsg (void); | |
| | | | |
| | | /** | |
| | | Return the latest LWGEOM warning message (if any) | |
| | | | |
| | | \return the latest LWGEOM warning message: an empty string if no warning w | |
| | | as | |
| | | previoysly found. | |
| | | | |
| | | \sa gaiaResetLwGeomMsg, gaiaGetLwGeomErrorMsg, gaiaSetLwGeomErrorMsg, | |
| | | gaiaSetLwGeomWarningMsg | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE const char *gaiaGetLwGeomWarningMsg (void); | |
| | | | |
| | | /** | |
| | | Set the current LWGEOM error message | |
| | | | |
| | | \param msg the error message to be set. | |
| | | | |
| | | \sa gaiaResetLwGeomMsg, gaiaGetLwGeomErrorMsg, gaiaGetLwGeomWarningMsg, | |
| | | gaiaSetLwGeomWarningMsg | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE void gaiaSetLwGeomErrorMsg (const char *msg); | |
| | | | |
| | | /** | |
| | | Set the current LWGEOM warning message | |
| | | | |
| | | \param msg the warning message to be set. | |
| | | | |
| | | \sa gaiaResetLwGeomMsg, gaiaGetLwGeomErrorMsg, gaiaGetLwGeomWarningMsg, | |
| | | gaiaSetLwGeomErrorMsg | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE void gaiaSetLwGeomWarningMsg (const char *msg); | |
| | | | |
| | | /** | |
| Utility function: MakeValid | | Utility function: MakeValid | |
| | | | |
| \param geom the input Geometry object. | | \param geom the input Geometry object. | |
| | | | |
| \return the pointer to newly created Geometry object: NULL on failure. | | \return the pointer to newly created Geometry object: NULL on failure. | |
| \n this function will attempt to create a valid representation of a given | | \n this function will attempt to create a valid representation of a given | |
| invalid geometry without loosing any of the input vertices. | | invalid geometry without loosing any of the input vertices. | |
| \n Already-valid geometries are returned without further intervention. | | \n Already-valid geometries are returned without further intervention. | |
| \n NULL will be returned if the passed argument is invalid. | | \n NULL will be returned if the passed argument is invalid. | |
| | | | |
| | | | |
| skipping to change at line 1362 | | skipping to change at line 1681 | |
| this including any Geometry returned by gaiaSegmentize() | | this including any Geometry returned by gaiaSegmentize() | |
| | | | |
| \remark \b LWGEOM support required. | | \remark \b LWGEOM support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize (gaiaGeomCollPtr geom, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize (gaiaGeomCollPtr geom, | |
| double dist); | | double dist); | |
| | | | |
| /** | | /** | |
| Utility function: Azimuth | | Utility function: Azimuth | |
| | | | |
|
| \param xa the X ccordinate of PointA. | | \param xa the X coordinate of PointA. | |
| \param ya the Y coordinate of PointA. | | \param ya the Y coordinate of PointA. | |
| \param xb the X ccordinate of PointB. | | \param xb the X ccordinate of PointB. | |
| \param yb the Y coordinate of PointB. | | \param yb the Y coordinate of PointB. | |
| \param azimuth on completion this variable will contain the angle in radia
ns from | | \param azimuth on completion this variable will contain the angle in radia
ns from | |
| the horizontal of the vector defined by pointA and pointB. | | the horizontal of the vector defined by pointA and pointB. | |
| \n Angle is computed clockwise from down-to-up: on the clock: 12=0; 3=PI/2
; 6=PI; 9=3PI/2. | | \n Angle is computed clockwise from down-to-up: on the clock: 12=0; 3=PI/2
; 6=PI; 9=3PI/2. | |
| | | | |
| \return 0 on failure: any other value on success | | \return 0 on failure: any other value on success | |
| | | | |
|
| | | \sa gaiaProjectedPoint | |
| | | | |
| \remark \b LWGEOM support required. | | \remark \b LWGEOM support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaAzimuth (double xa, double ya, double xb, | | GAIAGEO_DECLARE int gaiaAzimuth (double xa, double ya, double xb, | |
| double yb, double *azimuth); | | double yb, double *azimuth); | |
| | | | |
| /** | | /** | |
|
| | | Utility function: EllipsoidAzimuth | |
| | | | |
| | | \param xa the X coordinate of PointA. | |
| | | \param ya the Y coordinate of PointA. | |
| | | \param xb the X ccordinate of PointB. | |
| | | \param yb the Y coordinate of PointB. | |
| | | \param a major axis of the reference spheroid. | |
| | | \param b minor axis of the reference spheroid. | |
| | | \param azimuth on completion this variable will contain the angle in radia | |
| | | ns from | |
| | | the horizontal of the vector defined by pointA and pointB. | |
| | | \n Angle is computed clockwise from down-to-up: on the clock: 12=0; 3=PI/2 | |
| | | ; 6=PI; 9=3PI/2. | |
| | | | |
| | | \return 0 on failure: any other value on success | |
| | | | |
| | | \sa gaiaAzimuth | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaEllipsoidAzimuth (double xa, double ya, double | |
| | | xb, | |
| | | double yb, double a, double b, | |
| | | double *azimuth); | |
| | | | |
| | | /** | |
| | | Utility function: ProjectedPoint | |
| | | | |
| | | \param x1 the X coordinate of the Start Point. | |
| | | \param y1 the Y coordinate of the Start Point. | |
| | | \param a major axis of the reference spheroid. | |
| | | \param b minor axis of the reference spheroid. | |
| | | \param distance a distance expressed in Meters | |
| | | \param azimuth (aka bearing aka heading) expressed in radians; | |
| | | on the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2. | |
| | | \param x2 on completion this variable will contain the the X coordinate | |
| | | of the Projected Point. | |
| | | \param y2 on completion this variable will contain the the Y coordinate | |
| | | of the Projected Point. | |
| | | | |
| | | \return 0 on failure: any other value on success | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaProjectedPoint (double x1, double y1, double a, | |
| | | double b, double distance, | |
| | | double azimuth, double *x2, | |
| | | double *y2); | |
| | | | |
| | | /** | |
| Utility function: GeoHash | | Utility function: GeoHash | |
| | | | |
| \param geom the input geometry. | | \param geom the input geometry. | |
| \param precision the expected precision: if <= 0 will be automatically det
ermined. | | \param precision the expected precision: if <= 0 will be automatically det
ermined. | |
| | | | |
| \return NULL on failure: a null-terminated text string on success | | \return NULL on failure: a null-terminated text string on success | |
| | | | |
| \note you are responsible to free (before or after) any text string return
ed | | \note you are responsible to free (before or after) any text string return
ed | |
| by gaiaGeoHash() | | by gaiaGeoHash() | |
| | | | |
| | | | |
| skipping to change at line 1410 | | skipping to change at line 1778 | |
| | | | |
| \return NULL on failure: a null-terminated text string on success | | \return NULL on failure: a null-terminated text string on success | |
| | | | |
| \note you are responsible to free (before or after) any text string return
ed | | \note you are responsible to free (before or after) any text string return
ed | |
| by gaiaAsX3D() | | by gaiaAsX3D() | |
| | | | |
| \remark \b LWGEOM support required. | | \remark \b LWGEOM support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE char *gaiaAsX3D (gaiaGeomCollPtr geom, const char *srs, | | GAIAGEO_DECLARE char *gaiaAsX3D (gaiaGeomCollPtr geom, const char *srs, | |
| int precision, int options, | | int precision, int options, | |
|
| const char *defid); | | const char *refid); | |
| | | | |
| /** | | /** | |
| Calculates the minimum 3D distance intercurring between two Geometry objec
ts | | Calculates the minimum 3D distance intercurring between two Geometry objec
ts | |
| | | | |
| \param geom1 the first Geometry object | | \param geom1 the first Geometry object | |
| \param geom2 the second Geometry object | | \param geom2 the second Geometry object | |
| \param dist on completion this variable will contain the calculated distan
ce | | \param dist on completion this variable will contain the calculated distan
ce | |
| | | | |
| \return 0 on failure: any other value on success. | | \return 0 on failure: any other value on success. | |
| | | | |
| | | | |
| skipping to change at line 1531 | | skipping to change at line 1899 | |
| this including any Geometry returned by gaiaSplitRight() | | this including any Geometry returned by gaiaSplitRight() | |
| | | | |
| \note gaiaSplitLeft will only return the \b right split half; NULL may be
eventually | | \note gaiaSplitLeft will only return the \b right split half; NULL may be
eventually | |
| returned if empty. | | returned if empty. | |
| | | | |
| \remark \b LWGEOM support required. | | \remark \b LWGEOM support required. | |
| */ | | */ | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight (gaiaGeomCollPtr input, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight (gaiaGeomCollPtr input, | |
| gaiaGeomCollPtr blade); | | gaiaGeomCollPtr blade); | |
| | | | |
|
| | | /** | |
| | | Measures the total Area for a Geometry object (geodesic) | |
| | | | |
| | | \param geom pointer to Geometry object | |
| | | \param a major axis of the reference spheroid. | |
| | | \param b minor axis of the reference spheroid. | |
| | | \param use_ellipsoid if TRUE will measure the Area on the Ellipsoid, | |
| | | otherwise on the Sphere | |
| | | \param area on completion this variable will contain the measured area | |
| | | | |
| | | \return 0 on failure: any other value on success | |
| | | | |
| | | \sa gaiaGeomCollLength, gaiaMeasureArea, gaiaGeomCollArea | |
| | | | |
| | | \remark \b LWGEOM support required. | |
| | | */ | |
| | | GAIAGEO_DECLARE int gaiaGeodesicArea (gaiaGeomCollPtr geom, double a, | |
| | | double b, int use_ellipsoid, | |
| | | double *area); | |
| | | | |
| #endif /* end LWGEOM support */ | | #endif /* end LWGEOM support */ | |
| | | | |
| #endif /* end including GEOS */ | | #endif /* end including GEOS */ | |
| | | | |
| /** | | /** | |
| Utility function: SnapToGrid | | Utility function: SnapToGrid | |
| | | | |
|
| | | \param geom the input Geometry object. | |
| \param origin_x the X ccordinate identifying the Grid Origin. | | \param origin_x the X ccordinate identifying the Grid Origin. | |
| \param origin_y the Y coordinate identifiying the Grid Origin. | | \param origin_y the Y coordinate identifiying the Grid Origin. | |
|
| | | \param origin_z the Z ccordinate identifying the Grid Origin. | |
| | | \param origin_m the M coordinate identifiying the Grid Origin. | |
| \param size_x Grid cell size (X axis). | | \param size_x Grid cell size (X axis). | |
| \param size_y Grid cell size (Y axis). | | \param size_y Grid cell size (Y axis). | |
| \param size_z Grid cell size (Z axis). | | \param size_z Grid cell size (Z axis). | |
| \param size_m Grid cell size (M axis). | | \param size_m Grid cell size (M axis). | |
| | | | |
| \return the pointer to newly created Geometry object: NULL on failure. | | \return the pointer to newly created Geometry object: NULL on failure. | |
| \n this function will return a modified geometry having all points snapped
to a regular Grid | | \n this function will return a modified geometry having all points snapped
to a regular Grid | |
| defined by its origin and cell size. | | defined by its origin and cell size. | |
| \n Consecutive points falling on the same cell will be removed, eventually
returning NULL if | | \n Consecutive points falling on the same cell will be removed, eventually
returning NULL if | |
| \n output points are not enough to define a geometry of the given type. | | \n output points are not enough to define a geometry of the given type. | |
| | | | |
End of changes. 43 change blocks. |
| 22 lines changed or deleted | | 426 lines changed or added | |
|
| gg_formats.h | | gg_formats.h | |
| /* | | /* | |
| gg_formats.h -- Gaia common support for geometries: formats | | gg_formats.h -- Gaia common support for geometries: formats | |
| | | | |
|
| version 4.0, 2012 August 6 | | version 4.1, 2013 May 8 | |
| | | | |
| Author: Sandro Furieri a.furieri@lqt.it | | Author: Sandro Furieri a.furieri@lqt.it | |
| | | | |
| --------------------------------------------------------------------------
---- | | --------------------------------------------------------------------------
---- | |
| | | | |
| Version: MPL 1.1/GPL 2.0/LGPL 2.1 | | Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
| | | | |
| The contents of this file are subject to the Mozilla Public License Versio
n | | The contents of this file are subject to the Mozilla Public License Versio
n | |
| 1.1 (the "License"); you may not use this file except in compliance with | | 1.1 (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | | the License. You may obtain a copy of the License at | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| | | | |
| Software distributed under the License is distributed on an "AS IS" basis, | | Software distributed under the License is distributed on an "AS IS" basis, | |
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| for the specific language governing rights and limitations under the | | for the specific language governing rights and limitations under the | |
| License. | | License. | |
| | | | |
| The Original Code is the SpatiaLite library | | The Original Code is the SpatiaLite library | |
| | | | |
| The Initial Developer of the Original Code is Alessandro Furieri | | The Initial Developer of the Original Code is Alessandro Furieri | |
| | | | |
|
| Portions created by the Initial Developer are Copyright (C) 2008-2012 | | Portions created by the Initial Developer are Copyright (C) 2008-2013 | |
| the Initial Developer. All Rights Reserved. | | the Initial Developer. All Rights Reserved. | |
| | | | |
| Contributor(s): | | Contributor(s): | |
| Klaus Foerster klaus.foerster@svg.cc | | Klaus Foerster klaus.foerster@svg.cc | |
| | | | |
| Alternatively, the contents of this file may be used under the terms of | | Alternatively, the contents of this file may be used under the terms of | |
| either the GNU General Public License Version 2 or later (the "GPL"), or | | either the GNU General Public License Version 2 or later (the "GPL"), or | |
| the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | | the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | |
| in which case the provisions of the GPL or the LGPL are applicable instead | | in which case the provisions of the GPL or the LGPL are applicable instead | |
| of those above. If you wish to allow use of your version of this file only | | of those above. If you wish to allow use of your version of this file only | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 109 | |
| | | | |
| \sa gaiaEndianArch, gaiaExport32 | | \sa gaiaEndianArch, gaiaExport32 | |
| | | | |
| \note you are expected to pass an input buffer corresponding to an | | \note you are expected to pass an input buffer corresponding to an | |
| allocation size of (at least) 4 bytes. | | allocation size of (at least) 4 bytes. | |
| */ | | */ | |
| GAIAGEO_DECLARE int gaiaImport32 (const unsigned char *p, int little_en
dian, | | GAIAGEO_DECLARE int gaiaImport32 (const unsigned char *p, int little_en
dian, | |
| int little_endian_arch); | | int little_endian_arch); | |
| | | | |
| /** | | /** | |
|
| | | Import an UINT-32 value in endian-aware fashion | |
| | | | |
| | | \param p endian-dependent representation (input buffer). | |
| | | \param little_endian 0 if the input buffer is big-endian: any other value | |
| | | for little-endian. | |
| | | \param little_endian_arch the value returned by gaiaEndianArch() | |
| | | | |
| | | \return the internal UINT value | |
| | | | |
| | | \sa gaiaEndianArch, gaiaExportU32 | |
| | | | |
| | | \note you are expected to pass an input buffer corresponding to an | |
| | | allocation size of (at least) 4 bytes. | |
| | | */ | |
| | | GAIAGEO_DECLARE unsigned int gaiaImportU32 (const unsigned char *p, | |
| | | int little_endian, | |
| | | int little_endian_arch); | |
| | | | |
| | | /** | |
| Import a FLOAT-32 value in endian-aware fashion | | Import a FLOAT-32 value in endian-aware fashion | |
| | | | |
| \param p endian-dependent representation (input buffer). | | \param p endian-dependent representation (input buffer). | |
| \param little_endian 0 if the input buffer is big-endian: any other value | | \param little_endian 0 if the input buffer is big-endian: any other value | |
| for little-endian. | | for little-endian. | |
| \param little_endian_arch the value returned by gaiaEndianArch() | | \param little_endian_arch the value returned by gaiaEndianArch() | |
| | | | |
| \return the internal FLOAT value | | \return the internal FLOAT value | |
| | | | |
| \sa gaiaEndianArch, gaiaExportF32 | | \sa gaiaEndianArch, gaiaExportF32 | |
| | | | |
| skipping to change at line 202 | | skipping to change at line 221 | |
| \sa gaiaEndianArch, gaiaImport32 | | \sa gaiaEndianArch, gaiaImport32 | |
| | | | |
| \note you are expected to pass an output buffer corresponding to an | | \note you are expected to pass an output buffer corresponding to an | |
| allocation size of (at least) 4 bytes. | | allocation size of (at least) 4 bytes. | |
| */ | | */ | |
| GAIAGEO_DECLARE void gaiaExport32 (unsigned char *p, int value, | | GAIAGEO_DECLARE void gaiaExport32 (unsigned char *p, int value, | |
| int little_endian, | | int little_endian, | |
| int little_endian_arch); | | int little_endian_arch); | |
| | | | |
| /** | | /** | |
|
| | | Export an UINT-32 value in endian-aware fashion | |
| | | | |
| | | \param p endian-dependent representation (output buffer). | |
| | | \param value the internal value to be exported. | |
| | | \param little_endian 0 if the output buffer has to be big-endian: any othe | |
| | | r value | |
| | | for little-endian. | |
| | | \param little_endian_arch the value returned by gaiaEndianArch() | |
| | | | |
| | | \sa gaiaEndianArch, gaiaImportU32 | |
| | | | |
| | | \note you are expected to pass an output buffer corresponding to an | |
| | | allocation size of (at least) 4 bytes. | |
| | | */ | |
| | | GAIAGEO_DECLARE void gaiaExportU32 (unsigned char *p, unsigned int valu | |
| | | e, | |
| | | int little_endian, | |
| | | int little_endian_arch); | |
| | | | |
| | | /** | |
| Export a FLOAT-32 value in endian-aware fashion | | Export a FLOAT-32 value in endian-aware fashion | |
| | | | |
| \param p endian-dependent representation (output buffer). | | \param p endian-dependent representation (output buffer). | |
| \param value the internal value to be exported. | | \param value the internal value to be exported. | |
| \param little_endian 0 if the output buffer has to be big-endian: any othe
r value | | \param little_endian 0 if the output buffer has to be big-endian: any othe
r value | |
| for little-endian. | | for little-endian. | |
| \param little_endian_arch the value returned by gaiaEndianArch() | | \param little_endian_arch the value returned by gaiaEndianArch() | |
| | | | |
| \sa gaiaEndianArch, gaiaImportF32 | | \sa gaiaEndianArch, gaiaImportF32 | |
| | | | |
| | | | |
| skipping to change at line 571 | | skipping to change at line 608 | |
| | | | |
| /** | | /** | |
| Attempts to decode a Point from within an EWKB binary buffer | | Attempts to decode a Point from within an EWKB binary buffer | |
| | | | |
| \param geom pointer to an existing Geometry object; if succesfull the pars
ed Point | | \param geom pointer to an existing Geometry object; if succesfull the pars
ed Point | |
| will be inserted into this Geometry | | will be inserted into this Geometry | |
| \param blob pointer to EWKB input buffer | | \param blob pointer to EWKB input buffer | |
| \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | | \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | |
| \param blob_size lenght (in bytes) of the input buffer. | | \param blob_size lenght (in bytes) of the input buffer. | |
| \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | | \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | |
|
| \param endiam_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | | \param endian_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | |
| \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | | \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | |
| | | | |
| \return -1 on failure; otherwise the offset where the next object starts. | | \return -1 on failure; otherwise the offset where the next object starts. | |
| | | | |
| \sa gaiaEwkbGetLinestring, gaiaEwkbGetPolygon, gaiaEwkbGetMultiGeometry | | \sa gaiaEwkbGetLinestring, gaiaEwkbGetPolygon, gaiaEwkbGetMultiGeometry | |
| | | | |
| \note these functions are mainly intended for internal usage. | | \note these functions are mainly intended for internal usage. | |
| */ | | */ | |
| GAIAGEO_DECLARE int | | GAIAGEO_DECLARE int | |
| gaiaEwkbGetPoint (gaiaGeomCollPtr geom, unsigned char *blob, | | gaiaEwkbGetPoint (gaiaGeomCollPtr geom, unsigned char *blob, | |
| | | | |
| skipping to change at line 594 | | skipping to change at line 631 | |
| | | | |
| /** | | /** | |
| Attempts to decode a Point from within an EWKB binary buffer | | Attempts to decode a Point from within an EWKB binary buffer | |
| | | | |
| \param geom pointer to an existing Geometry object; if succesfull the pars
ed Linestring | | \param geom pointer to an existing Geometry object; if succesfull the pars
ed Linestring | |
| will be inserted into this Geometry | | will be inserted into this Geometry | |
| \param blob pointer to EWKB input buffer | | \param blob pointer to EWKB input buffer | |
| \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | | \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | |
| \param blob_size lenght (in bytes) of the input buffer. | | \param blob_size lenght (in bytes) of the input buffer. | |
| \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | | \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | |
|
| \param endiam_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | | \param endian_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | |
| \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | | \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | |
| | | | |
| \return -1 on failure; otherwise the offset where the next object starts. | | \return -1 on failure; otherwise the offset where the next object starts. | |
| | | | |
| \sa gaiaEwkbGetPoint, gaiaEwkbGetPolygon, gaiaEwkbGetMultiGeometry | | \sa gaiaEwkbGetPoint, gaiaEwkbGetPolygon, gaiaEwkbGetMultiGeometry | |
| | | | |
| \note these functions are mainly intended for internal usage. | | \note these functions are mainly intended for internal usage. | |
| */ | | */ | |
| GAIAGEO_DECLARE int | | GAIAGEO_DECLARE int | |
| gaiaEwkbGetLinestring (gaiaGeomCollPtr geom, unsigned char *blob, | | gaiaEwkbGetLinestring (gaiaGeomCollPtr geom, unsigned char *blob, | |
| | | | |
| skipping to change at line 617 | | skipping to change at line 654 | |
| | | | |
| /** | | /** | |
| Attempts to decode a Polygon from within an EWKB binary buffer | | Attempts to decode a Polygon from within an EWKB binary buffer | |
| | | | |
| \param geom pointer to an existing Geometry object; if succesfull the pars
ed Polygon | | \param geom pointer to an existing Geometry object; if succesfull the pars
ed Polygon | |
| will be inserted into this Geometry | | will be inserted into this Geometry | |
| \param blob pointer to EWKB input buffer | | \param blob pointer to EWKB input buffer | |
| \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | | \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | |
| \param blob_size lenght (in bytes) of the input buffer. | | \param blob_size lenght (in bytes) of the input buffer. | |
| \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | | \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | |
|
| \param endiam_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | | \param endian_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | |
| \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | | \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | |
| | | | |
| \return -1 on failure; otherwise the offset where the next object starts. | | \return -1 on failure; otherwise the offset where the next object starts. | |
| | | | |
| \sa gaiaEwkbGetPoint, gaiaEwkbGetPolygon, gaiaEwkbGetMultiGeometry | | \sa gaiaEwkbGetPoint, gaiaEwkbGetPolygon, gaiaEwkbGetMultiGeometry | |
| */ | | */ | |
| GAIAGEO_DECLARE int | | GAIAGEO_DECLARE int | |
| gaiaEwkbGetPolygon (gaiaGeomCollPtr geom, unsigned char *blob, | | gaiaEwkbGetPolygon (gaiaGeomCollPtr geom, unsigned char *blob, | |
| int offset, int blob_size, int endian, | | int offset, int blob_size, int endian, | |
| int endian_arch, int dims); | | int endian_arch, int dims); | |
| | | | |
| /** | | /** | |
| Attempts to decode a MultiGeometry from within an EWKB binary buffer | | Attempts to decode a MultiGeometry from within an EWKB binary buffer | |
| | | | |
| \param geom pointer to an existing Geometry object; if succesfull the pars
ed MultiGeometry | | \param geom pointer to an existing Geometry object; if succesfull the pars
ed MultiGeometry | |
| will be inserted into this Geometry | | will be inserted into this Geometry | |
| \param blob pointer to EWKB input buffer | | \param blob pointer to EWKB input buffer | |
| \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | | \param offset the offset (in bytes) on the input buffer where the Point de
finition is expected to start. | |
| \param blob_size lenght (in bytes) of the input buffer. | | \param blob_size lenght (in bytes) of the input buffer. | |
| \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | | \param endian (boolean) states if the EWKB input buffer is little- or big-
endian encode. | |
|
| \param endiam_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | | \param endian_arch (boolean) states if the target CPU has a little- or big
-endian architecture. | |
| \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | | \param dims dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_Z_
M | |
| | | | |
| \return -1 on failure; otherwise the offset where the next object starts. | | \return -1 on failure; otherwise the offset where the next object starts. | |
| | | | |
| \sa gaiaEwkbGetPoint, gaiaEwkbGetLinestring, gaiaEwkbGetPolygon | | \sa gaiaEwkbGetPoint, gaiaEwkbGetLinestring, gaiaEwkbGetPolygon | |
| | | | |
| \note these functions are mainly intended for internal usage. | | \note these functions are mainly intended for internal usage. | |
| */ | | */ | |
| GAIAGEO_DECLARE int | | GAIAGEO_DECLARE int | |
| gaiaEwkbGetMultiGeometry (gaiaGeomCollPtr geom, unsigned char *blob, | | gaiaEwkbGetMultiGeometry (gaiaGeomCollPtr geom, unsigned char *blob, | |
| | | | |
End of changes. 8 change blocks. |
| 6 lines changed or deleted | | 45 lines changed or added | |
|
| spatialite.h | | spatialite.h | |
| /* | | /* | |
| spatialite.h -- Gaia spatial support for SQLite | | spatialite.h -- Gaia spatial support for SQLite | |
| | | | |
|
| version 4.0, 2012 August 6 | | version 4.1, 2013 May 8 | |
| | | | |
| Author: Sandro Furieri a.furieri@lqt.it | | Author: Sandro Furieri a.furieri@lqt.it | |
| | | | |
| --------------------------------------------------------------------------
---- | | --------------------------------------------------------------------------
---- | |
| | | | |
| Version: MPL 1.1/GPL 2.0/LGPL 2.1 | | Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
| | | | |
| The contents of this file are subject to the Mozilla Public License Versio
n | | The contents of this file are subject to the Mozilla Public License Versio
n | |
| 1.1 (the "License"); you may not use this file except in compliance with | | 1.1 (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | | the License. You may obtain a copy of the License at | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| | | | |
| Software distributed under the License is distributed on an "AS IS" basis, | | Software distributed under the License is distributed on an "AS IS" basis, | |
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| for the specific language governing rights and limitations under the | | for the specific language governing rights and limitations under the | |
| License. | | License. | |
| | | | |
| The Original Code is the SpatiaLite library | | The Original Code is the SpatiaLite library | |
| | | | |
| The Initial Developer of the Original Code is Alessandro Furieri | | The Initial Developer of the Original Code is Alessandro Furieri | |
| | | | |
|
| Portions created by the Initial Developer are Copyright (C) 2008-2012 | | Portions created by the Initial Developer are Copyright (C) 2008-2013 | |
| the Initial Developer. All Rights Reserved. | | the Initial Developer. All Rights Reserved. | |
| | | | |
| Contributor(s): | | Contributor(s): | |
| | | | |
| Alternatively, the contents of this file may be used under the terms of | | Alternatively, the contents of this file may be used under the terms of | |
| either the GNU General Public License Version 2 or later (the "GPL"), or | | either the GNU General Public License Version 2 or later (the "GPL"), or | |
| the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | | the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | |
| in which case the provisions of the GPL or the LGPL are applicable instead | | in which case the provisions of the GPL or the LGPL are applicable instead | |
| of those above. If you wish to allow use of your version of this file only | | of those above. If you wish to allow use of your version of this file only | |
| under the terms of either the GPL or the LGPL, and not to allow others to | | under the terms of either the GPL or the LGPL, and not to allow others to | |
| | | | |
| skipping to change at line 80 | | skipping to change at line 80 | |
| #endif | | #endif | |
| | | | |
| #include <spatialite/gaiageo.h> | | #include <spatialite/gaiageo.h> | |
| | | | |
| /** | | /** | |
| Return the current library version. | | Return the current library version. | |
| */ | | */ | |
| SPATIALITE_DECLARE const char *spatialite_version (void); | | SPATIALITE_DECLARE const char *spatialite_version (void); | |
| | | | |
| /** | | /** | |
|
| | | Initializes the internal memory block supporting each connection | |
| | | | |
| | | \sa spatialite_init_ex, spatialite_cleanup_ex | |
| | | | |
| | | */ | |
| | | SPATIALITE_DECLARE void *spatialite_alloc_connection (void); | |
| | | | |
| | | /** | |
| Initializes the library. | | Initializes the library. | |
| | | | |
|
| | | This function is now \b DEPRECATED because is not reentrant (not thread sa | |
| | | fe); | |
| | | use spatialite_init_ex() for all new development. | |
| | | | |
| \param verbose if TRUE a short start-up message is shown on stderr | | \param verbose if TRUE a short start-up message is shown on stderr | |
| | | | |
|
| | | \sa spatialite_cleanup, spatialite_init_ex | |
| | | | |
| \note You absolutely must invoke this function before attempting to perfor
m | | \note You absolutely must invoke this function before attempting to perfor
m | |
| any other SpatiaLite's call. | | any other SpatiaLite's call. | |
| | | | |
| */ | | */ | |
| SPATIALITE_DECLARE void spatialite_init (int verbose); | | SPATIALITE_DECLARE void spatialite_init (int verbose); | |
| | | | |
| /** | | /** | |
|
| | | Initializes the library. | |
| | | | |
| | | \param db_handle handle to the current SQLite connection | |
| | | \param ptr a memory pointer returned by spatialite_alloc_connection() | |
| | | \param verbose if TRUE a short start-up message is shown on stderr | |
| | | | |
| | | \sa spatialite_alloc_connection, spatialite_cleanup_ex, spatialite_init | |
| | | | |
| | | \note You absolutely must invoke this function before attempting to perfor | |
| | | m | |
| | | any other SpatiaLite's call. | |
| | | | |
| | | */ | |
| | | SPATIALITE_DECLARE void spatialite_init_ex (sqlite3 * db_handle, void * | |
| | | ptr, | |
| | | int verbose); | |
| | | | |
| | | /** | |
| Initializes the GEOS library. | | Initializes the GEOS library. | |
| | | | |
| \note You are never supposed to invoke this function (internally handled). | | \note You are never supposed to invoke this function (internally handled). | |
| | | | |
| */ | | */ | |
| SPATIALITE_DECLARE void spatialite_init_geos (void); | | SPATIALITE_DECLARE void spatialite_init_geos (void); | |
| | | | |
| /** | | /** | |
| Cleanup spatialite | | Cleanup spatialite | |
| | | | |
|
| | | This function is now \b DEPRECATED; use spatialite_cleanup_ex() for all ne | |
| | | w development. | |
| | | | |
| This function performs general cleanup, essentially undoing the effect | | This function performs general cleanup, essentially undoing the effect | |
| of spatialite_init(). | | of spatialite_init(). | |
| | | | |
| \sa spatialite_init | | \sa spatialite_init | |
| */ | | */ | |
| SPATIALITE_DECLARE void spatialite_cleanup (void); | | SPATIALITE_DECLARE void spatialite_cleanup (void); | |
| | | | |
| /** | | /** | |
|
| | | Cleanup spatialite | |
| | | | |
| | | This function performs general cleanup, essentially undoing the effect | |
| | | of spatialite_init_ex(). | |
| | | | |
| | | \param ptr the same memory pointer passed to the corresponding call to | |
| | | spatialite_init_ex() and returned by spatialite_alloc_connection() | |
| | | | |
| | | \sa spatialite_init_ex, spatialite_alloc_connection | |
| | | */ | |
| | | SPATIALITE_DECLARE void spatialite_cleanup_ex (void *ptr); | |
| | | | |
| | | /** | |
| Dumps a full geometry-table into an external Shapefile | | Dumps a full geometry-table into an external Shapefile | |
| | | | |
| \param sqlite handle to current DB connection | | \param sqlite handle to current DB connection | |
| \param table the name of the table to be exported | | \param table the name of the table to be exported | |
| \param column the name of the geometry column | | \param column the name of the geometry column | |
| \param shp_path pathname of the Shapefile to be exported (no suffix) | | \param shp_path pathname of the Shapefile to be exported (no suffix) | |
| \param charset a valid GNU ICONV charset to be used for DBF text strings | | \param charset a valid GNU ICONV charset to be used for DBF text strings | |
| \param geom_type "POINT", "LINESTRING", "POLYGON", "MULTIPOLYGON" or NULL | | \param geom_type "POINT", "LINESTRING", "POLYGON", "MULTIPOLYGON" or NULL | |
| \param verbose if TRUE a short report is shown on stderr | | \param verbose if TRUE a short report is shown on stderr | |
| \param rows on completion will contain the total number of actually export
ed rows | | \param rows on completion will contain the total number of actually export
ed rows | |
| | | | |
| skipping to change at line 476 | | skipping to change at line 520 | |
| - if both table and column are not NULL, then only the | | - if both table and column are not NULL, then only the | |
| given entry will be processed. | | given entry will be processed. | |
| | | | |
| \return 0 on failure, the total count of processed entries on success | | \return 0 on failure, the total count of processed entries on success | |
| */ | | */ | |
| SPATIALITE_DECLARE int update_layer_statistics (sqlite3 * sqlite, | | SPATIALITE_DECLARE int update_layer_statistics (sqlite3 * sqlite, | |
| const char *table, | | const char *table, | |
| const char *column); | | const char *column); | |
| | | | |
| /** | | /** | |
|
| | | Queries the Metadata tables returning the Layer Full Extent | |
| | | | |
| | | \param handle SQLite handle to current DB connection. | |
| | | \param table VectorLayer Table (or View, or VirtualShape). | |
| | | \param geometry Geometry Column name. | |
| | | \param mode if TRUE a PESSIMISTIC statistics update will be implied, | |
| | | otherwise OPTIMISTIC. | |
| | | | |
| | | \return the pointer to the newly created Geometry (Envelope): NULL on fail | |
| | | ure | |
| | | | |
| | | \note you are responsible to destroy (before or after) any allocated | |
| | | Geometry returned by gaiaGetLayerExtent(). | |
| | | \n The geometry arg is optional when the table simply has a single Geometr | |
| | | y Column, | |
| | | and can be NULL in this case. | |
| | | \n When the mode arg is set to FALSE (default) then the returned infos | |
| | | will be simply retrieved from the staticized statistic tables (faster, bu | |
| | | t could be inaccurate). | |
| | | \n If the mode arg is set to TRUE a preliminary attempt to update the | |
| | | statistic tables will be always performed (probably slower, but surely ac | |
| | | curate). | |
| | | \n If the named Layer doesn't exist, or if it's completely empty (not cont | |
| | | aining | |
| | | any valid Geometry) NULL will be returned. | |
| | | */ | |
| | | SPATIALITE_DECLARE gaiaGeomCollPtr gaiaGetLayerExtent (sqlite3 * handle | |
| | | , | |
| | | const char *table | |
| | | , | |
| | | const char *geome | |
| | | try, | |
| | | int mode); | |
| | | | |
| | | /** | |
| Queries the Metadata tables supporting Vector Layers | | Queries the Metadata tables supporting Vector Layers | |
| | | | |
| \param handle SQLite handle to current DB connection. | | \param handle SQLite handle to current DB connection. | |
| \param table VectorLayer Table (or View, or VirtualShape). | | \param table VectorLayer Table (or View, or VirtualShape). | |
| \param geometry Geometry Column name. | | \param geometry Geometry Column name. | |
| \param mode one of GAIA_VECTORS_LIST_LOOSE or GAIA_VECTORS_LIST_STRICT. | | \param mode one of GAIA_VECTORS_LIST_LOOSE or GAIA_VECTORS_LIST_STRICT. | |
| | | | |
| \return the pointer to the newly created VectorLayersList object: NULL on
failure | | \return the pointer to the newly created VectorLayersList object: NULL on
failure | |
| | | | |
| \sa gaiaFreeVectorLayersList | | \sa gaiaFreeVectorLayersList | |
| | | | |
| skipping to change at line 497 | | skipping to change at line 568 | |
| \note you are responsible to destroy (before or after) any allocated | | \note you are responsible to destroy (before or after) any allocated | |
| VectorLayersList returned by gaiaGetVectorLayersList(). | | VectorLayersList returned by gaiaGetVectorLayersList(). | |
| \n If the table arg is NULL all VectorLayers defined within the DB will be
reported; | | \n If the table arg is NULL all VectorLayers defined within the DB will be
reported; | |
| otherwise only a single Layer will be reported (if existing). | | otherwise only a single Layer will be reported (if existing). | |
| \n By defining the geometry arg (not NULL) you can further restrict the re
turned report. | | \n By defining the geometry arg (not NULL) you can further restrict the re
turned report. | |
| \n When the mode arg is set to GAIA_VECTORS_LIST_FAST (default) then the r
eturned infos | | \n When the mode arg is set to GAIA_VECTORS_LIST_FAST (default) then the r
eturned infos | |
| will be simply retrieved from the staticized statistic tables (faster, bu
t could be inaccurate). | | will be simply retrieved from the staticized statistic tables (faster, bu
t could be inaccurate). | |
| \n If the mode arg is set to GAIA_VECTORS_LIST_PRECISE a preliminary attem
pt to update the | | \n If the mode arg is set to GAIA_VECTORS_LIST_PRECISE a preliminary attem
pt to update the | |
| statistic tables will be always performed (probably slower, but surely ac
curate). | | statistic tables will be always performed (probably slower, but surely ac
curate). | |
| */ | | */ | |
|
| SPATIALITE_DECLARE gaiaVectorLayersListPtr gaiaGetVectorLayersList (sql | | SPATIALITE_DECLARE gaiaVectorLayersListPtr gaiaGetVectorLayersList (sql | |
| ite3 * | | ite3 | |
| handle, | | * | |
| const char *table, const char *geometry, int mode); | | hand | |
| | | le, | |
| | | cons | |
| | | t | |
| | | char | |
| | | *tab | |
| | | le, | |
| | | cons | |
| | | t | |
| | | char | |
| | | *geo | |
| | | metry, | |
| | | int | |
| | | mode | |
| | | ); | |
| | | | |
| /** | | /** | |
| Destroys a VectorLayersList object | | Destroys a VectorLayersList object | |
| | | | |
| \param ptr pointer to the VectorLayersList object to be destroyed | | \param ptr pointer to the VectorLayersList object to be destroyed | |
| | | | |
| \sa gaiaGetVectorLayersList | | \sa gaiaGetVectorLayersList | |
| */ | | */ | |
|
| SPATIALITE_DECLARE void gaiaFreeVectorLayersList (gaiaVectorLayersListP | | SPATIALITE_DECLARE void gaiaFreeVectorLayersList (gaiaVectorLayersListP | |
| tr ptr); | | tr | |
| | | ptr); | |
| | | | |
| /** | | /** | |
| Drops a layer-table, removing any related dependency | | Drops a layer-table, removing any related dependency | |
| | | | |
| \param sqlite handle to current DB connection | | \param sqlite handle to current DB connection | |
| \param table name of the table to be removed | | \param table name of the table to be removed | |
| | | | |
| \note this function will drop a SpatialTable, SpatialView or VirtualShape
being | | \note this function will drop a SpatialTable, SpatialView or VirtualShape
being | |
| properly registered within the Metadata tables. | | properly registered within the Metadata tables. | |
| \n an eventual Spatial Index will be dropped as well, and any row referrin
g the | | \n an eventual Spatial Index will be dropped as well, and any row referrin
g the | |
| selected table will be removed from the Metadata tables. | | selected table will be removed from the Metadata tables. | |
| | | | |
| \return 0 on failure, any other value on success | | \return 0 on failure, any other value on success | |
| */ | | */ | |
| SPATIALITE_DECLARE int gaiaDropTable (sqlite3 * sqlite, const char *tab
le); | | SPATIALITE_DECLARE int gaiaDropTable (sqlite3 * sqlite, const char *tab
le); | |
| | | | |
|
| | | /** | |
| | | Checks a Geometry Column for validity | |
| | | | |
| | | \param sqlite handle to current DB connection | |
| | | \param table name of the table | |
| | | \param geometry name of the column to be checked | |
| | | \param report_path pathname of the report-file | |
| | | \param n_rows if this variable is not NULL on successful completion will | |
| | | contain the total number of rows found into the checkeck table | |
| | | \param n_invalids if this variable is not NULL on successful completion wi | |
| | | ll | |
| | | contain the total number of invalid Geometries found into the checkeck tab | |
| | | le | |
| | | \param err_msg if this variable is not NULL and the return status is ZERO | |
| | | (failure), an appropriate error message will be returned | |
| | | | |
| | | \note this function will check a Geometry Column (layer) for validity; | |
| | | a HTML report will be produced. | |
| | | \n an eventual error message returned via err_msg requires to be deallocat | |
| | | ed | |
| | | by invoking free() | |
| | | | |
| | | \return 0 on failure, any other value on success | |
| | | */ | |
| | | SPATIALITE_DECLARE int check_geometry_column (sqlite3 * sqlite, | |
| | | const char *table, | |
| | | const char *geom, | |
| | | const char *report_path, | |
| | | int *n_rows, int *n_invali | |
| | | ds, | |
| | | char **err_msg); | |
| | | | |
| | | /** | |
| | | Checks all Geometry Columns for validity | |
| | | | |
| | | \param sqlite handle to current DB connection | |
| | | \param output_dir pathname of the directory to be created for report-files | |
| | | \param n_invalids if this variable is not NULL on successful completion wi | |
| | | ll | |
| | | contain the total number of invalid Geometries found | |
| | | \param err_msg if this variable is not NULL and the return status is ZERO | |
| | | (failure), an appropriate error message will be returned | |
| | | | |
| | | \note this function will check all Geometry Columns (vector layers) for va | |
| | | lidity; | |
| | | a HTML report will be produced. | |
| | | \n an eventual error message returned via err_msg requires to be deallocat | |
| | | ed | |
| | | by invoking free() | |
| | | | |
| | | \return 0 on failure, any other value on success | |
| | | */ | |
| | | SPATIALITE_DECLARE int check_all_geometry_columns (sqlite3 * sqlite, | |
| | | const char *output_di | |
| | | r, | |
| | | int *n_invalids, | |
| | | char **err_msg); | |
| | | | |
| | | /** | |
| | | Sanitizes a Geometry Column making all invalid geometries to be valid | |
| | | | |
| | | \param sqlite handle to current DB connection | |
| | | \param table name of the table | |
| | | \param geometry name of the column to be checked | |
| | | \param tmp_table name of the temporary table | |
| | | \param report_path pathname of the report-file | |
| | | \param n_invalids if this variable is not NULL on successful completion wi | |
| | | ll | |
| | | contain the total number of invalid Geometries found into the sanitize tab | |
| | | le | |
| | | \param n_repaired if this variable is not NULL on successful completion wi | |
| | | ll | |
| | | contain the total number of repaired Geometries | |
| | | \param n_discarded if this variable is not NULL on successful completion w | |
| | | ill | |
| | | contain the total number of repaired Geometries (by discarding fragments) | |
| | | \param n_failures if this variable is not NULL on successful completion wi | |
| | | ll | |
| | | contain the total number of repair failures (i.e. Geometries beyond possib | |
| | | le repair) | |
| | | \param err_msg if this variable is not NULL and the return status is ZERO | |
| | | (failure), an appropriate error message will be returned | |
| | | | |
| | | \note this function will attempt to make valid all invalid geometries | |
| | | found within a Geometry Column (layer); a temporary table is required. | |
| | | \n if the process has full success the temprary table will be deleted; | |
| | | otherwise it will be preserved for further inspection. | |
| | | a HTML report will be produced as well. | |
| | | \n an eventual error message returned via err_msg requires to be deallocat | |
| | | ed | |
| | | by invoking free() | |
| | | | |
| | | \return 0 on failure, any other value on success | |
| | | */ | |
| | | SPATIALITE_DECLARE int sanitize_geometry_column (sqlite3 * sqlite, | |
| | | const char *table, | |
| | | const char *geom, | |
| | | const char *tmp_table, | |
| | | const char *report_path | |
| | | , | |
| | | int *n_invalids, | |
| | | int *n_repaired, | |
| | | int *n_discarded, | |
| | | int *n_failures, | |
| | | char **err_msg); | |
| | | | |
| | | /** | |
| | | Sanitizes all Geometry Columns making all invalid geometries to be valid | |
| | | | |
| | | \param sqlite handle to current DB connection | |
| | | \param tmp_prefix name-prefix for temporary tables | |
| | | \param output_dir pathname of the directory to be created for report-files | |
| | | \param not_repaired if this variable is not NULL on successful completion | |
| | | will | |
| | | contain the total count of repair failures (i.e. Geometries beyond possibl | |
| | | e repair) | |
| | | \param err_msg if this variable is not NULL and the return status is ZERO | |
| | | (failure), an appropriate error message will be returned | |
| | | | |
| | | \note this function will attempt to make valid all invalid geometries | |
| | | found within all Geometry Columns (vector layers); a temporary table is | |
| | | required so to support each input table. | |
| | | \n if the process has full success the temprary table will be deleted; | |
| | | otherwise it will be preserved for further inspection. | |
| | | a HTML report will be produced as well. | |
| | | \n an eventual error message returned via err_msg requires to be deallocat | |
| | | ed | |
| | | by invoking free() | |
| | | | |
| | | \return 0 on failure, any other value on success | |
| | | */ | |
| | | SPATIALITE_DECLARE int sanitize_all_geometry_columns (sqlite3 * sqlite, | |
| | | const char | |
| | | *tmp_prefix, | |
| | | const char | |
| | | *output_dir, | |
| | | int *not_repaired, | |
| | | char **err_msg); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _SPATIALITE_H */ | | #endif /* _SPATIALITE_H */ | |
| | | | |
End of changes. 12 change blocks. |
| 8 lines changed or deleted | | 245 lines changed or added | |
|