SpatiaLite  4.0.0-RC1
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
gg_advanced.h File Reference

Geometry handling functions: advanced. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GAIAGEO_DECLARE double gaiaRadsToDegs (double rads)
 Converts and angle from Radians into Degrees.
GAIAGEO_DECLARE double gaiaDegsToRads (double degs)
 Converts and angle from Degrees into Radians.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTransform (gaiaGeomCollPtr org, char *proj_from, char *proj_to)
 Tansforms a Geometry object into a different Reference System [aka Reprojection].
GAIAGEO_DECLARE void gaiaResetGeosMsg (void)
 Resets the GEOS error and warning messages to an empty state.
GAIAGEO_DECLARE const char * gaiaGetGeosErrorMsg (void)
 Return the latest GEOS error message (if any)
GAIAGEO_DECLARE const char * gaiaGetGeosWarningMsg (void)
 Return the latest GEOS warning message (if any)
GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg)
 Set the current GEOS error message.
GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg)
 Set the current GEOS warning message.
GAIAGEO_DECLARE void * gaiaToGeos (const gaiaGeomCollPtr gaia)
 Converts a Geometry object into a GEOS Geometry.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XY (const void *geos)
 Converts a GEOS Geometry into a Geometry object [XY dims].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZ (const void *geos)
 Converts a GEOS Geometry into a Geometry object [XYZ dims].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYM (const void *geos)
 Converts a GEOS Geometry into a Geometry object [XYM dims].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZM (const void *geos)
 Converts a GEOS Geometry into a Geometry object [XYZM dims].
GAIAGEO_DECLARE int gaiaIsSimple (gaiaGeomCollPtr geom)
 Checks if a Geometry object represents an OGC Simple Geometry.
GAIAGEO_DECLARE int gaiaIsClosed (gaiaLinestringPtr line)
 Checks if a Linestring object represents an OGC Closed Geometry.
GAIAGEO_DECLARE int gaiaIsClosedGeom (gaiaGeomCollPtr geom)
 Checks if a Geometry object represents an OGC Closed Linestring.
GAIAGEO_DECLARE int gaiaIsRing (gaiaLinestringPtr line)
 Checks if a Linestring object represents an OGC Ring Geometry.
GAIAGEO_DECLARE int gaiaIsValid (gaiaGeomCollPtr geom)
 Checks if a Geometry object represents an OGC Valid Geometry.
GAIAGEO_DECLARE int gaiaGeomCollLength (gaiaGeomCollPtr geom, double *length)
 Measures the total Length for a Geometry object.
GAIAGEO_DECLARE int gaiaGeomCollArea (gaiaGeomCollPtr geom, double *area)
 Measures the total Area for a Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaPolygonize (gaiaGeomCollPtr geom, int force_multi)
 Attempts to rearrange a generic Geometry object into a Polygon or MultiPolygon.
GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Equals.
GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Disjoint.
GAIAGEO_DECLARE int gaiaGeomCollIntersects (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Intesects.
GAIAGEO_DECLARE int gaiaGeomCollOverlaps (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Overlaps.
GAIAGEO_DECLARE int gaiaGeomCollCrosses (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Crosses.
GAIAGEO_DECLARE int gaiaGeomCollContains (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Contains.
GAIAGEO_DECLARE int gaiaGeomCollWithin (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Within.
GAIAGEO_DECLARE int gaiaGeomCollTouches (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial relationship evalution: Touches.
GAIAGEO_DECLARE int gaiaGeomCollRelate (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, const char *pattern)
 Spatial relationship evalution: Relate.
GAIAGEO_DECLARE int gaiaGeomCollDistance (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, double *dist)
 Calculates the minimum distance intercurring between two Geometry objects.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryIntersection (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: Intersection.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryUnion (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: Union.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryDifference (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: Difference.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometrySymDifference (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: SymDifference.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaBoundary (gaiaGeomCollPtr geom)
 Spatial operator: Boundary.
GAIAGEO_DECLARE int gaiaGeomCollCentroid (gaiaGeomCollPtr geom, double *x, double *y)
 Spatial operator: Centroid.
GAIAGEO_DECLARE int gaiaGetPointOnSurface (gaiaGeomCollPtr geom, double *x, double *y)
 Spatial operator: PointOnSurface.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollSimplify (gaiaGeomCollPtr geom, double tolerance)
 Spatial operator: Simplify.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollSimplifyPreserveTopology (gaiaGeomCollPtr geom, double tolerance)
 Spatial operator: Simplify [preserving topology].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConvexHull (gaiaGeomCollPtr geom)
 Spatial operator: ConvexHull.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollBuffer (gaiaGeomCollPtr geom, double radius, int points)
 Spatial operator: Buffer.
GAIAGEO_DECLARE int gaiaHausdorffDistance (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, double *dist)
 Calculates the Hausdorff distance intercurring between two Geometry objects.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaOffsetCurve (gaiaGeomCollPtr geom, double radius, int points, int left_right)
 Spatial operator: Offset Curve.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSingleSidedBuffer (gaiaGeomCollPtr geom, double radius, int points, int left_right)
 Spatial operator: Single Sided Buffer.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSharedPaths (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: Shared Paths.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineInterpolatePoint (gaiaGeomCollPtr ln_geom, double fraction)
 Spatial operator: Line Interpolate Point.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineInterpolateEquidistantPoints (gaiaGeomCollPtr ln_geom, double distance)
 Spatial operator: Line Interpolate Equidistant Points.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineSubstring (gaiaGeomCollPtr ln_geom, double start_fraction, double end_fraction)
 Spatial operator: Line Substring.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaShortestLine (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: Shortest Line.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSnap (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, double tolerance)
 Spatial operator: Shortest Line.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineMerge (gaiaGeomCollPtr geom)
 Spatial operator: Line Merge.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinesCutAtNodes (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Spatial operator: Line Cut At Nodes.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaUnaryUnion (gaiaGeomCollPtr geom)
 Spatial operator: Unary Union.
GAIAGEO_DECLARE double gaiaLineLocatePoint (gaiaGeomCollPtr ln_geom, gaiaGeomCollPtr pt_geom)
 Determines the location of the closest Point on Linestring to the given Point.
GAIAGEO_DECLARE int gaiaGeomCollCovers (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Topology check: test if a Geometry covers another one.
GAIAGEO_DECLARE int gaiaGeomCollCoveredBy (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
 Topology check: test if a Geometry is covered by another one.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDelaunayTriangulation (gaiaGeomCollPtr geom, double tolerance, int only_edges)
 Delaunay Triangulation.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaVoronojDiagram (gaiaGeomCollPtr geom, double extra_frame_size, double tolerance, int only_edges)
 Voronoj Diagram.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConcaveHull (gaiaGeomCollPtr geom, double factor, double tolerance, int allow_holes)
 Concave Hull.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValid (gaiaGeomCollPtr geom)
 Utility function: MakeValid.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValidDiscarded (gaiaGeomCollPtr geom)
 Utility function: MakeValidDiscarded.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize (gaiaGeomCollPtr geom, double dist)
 Utility function: Segmentize.
GAIAGEO_DECLARE int gaiaAzimuth (double xa, double ya, double xb, double yb, double *azimuth)
 Utility function: Azimuth.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplit (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
 Utility function: Split.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitLeft (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
 Utility function: SplitLeft.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
 Utility function: SplitRight.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSnapToGrid (gaiaGeomCollPtr geom, double origin_x, double origin_y, double origin_z, double origin_m, double size_x, double size_y, double size_z, double size_m)
 Utility function: SnapToGrid.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSquareGrid (gaiaGeomCollPtr geom, double origin_x, double origin_y, double size, int only_edges)
 Utility function: SquareGrid.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTriangularGrid (gaiaGeomCollPtr geom, double origin_x, double origin_y, double size, int only_edges)
 Utility function: TriangularGrid.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaHexagonalGrid (gaiaGeomCollPtr geom, double origin_x, double origin_y, double size, int only_edges)
 Utility function: HexagonalGrid.

Detailed Description

Geometry handling functions: advanced.


Function Documentation

GAIAGEO_DECLARE int gaiaAzimuth ( double  xa,
double  ya,
double  xb,
double  yb,
double *  azimuth 
)

Utility function: Azimuth.

Parameters:
xathe X ccordinate of PointA.
yathe Y coordinate of PointA.
xbthe X ccordinate of PointB.
ybthe Y coordinate of PointB.
azimuthon completion this variable will contain the angle in radians from the horizontal of the vector defined by pointA and pointB.
Angle is computed clockwise from down-to-up: on the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2.
Returns:
0 on failure: any other value on success
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaBoundary ( gaiaGeomCollPtr  geom)

Spatial operator: Boundary.

Parameters:
geomthe Geometry object to be evaluated
Returns:
the pointer to newly created Geometry object representing the geometry Boundary of the input Geometry: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaBoundary()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConcaveHull ( gaiaGeomCollPtr  geom,
double  factor,
double  tolerance,
int  allow_holes 
)

Concave Hull.

Parameters:
geompointer to input Geometry object.
factormultiplier used for filtering Delaunay triangles: please read the note.
toleranceoptional snapping tolerance.
allow_howsif FALSE any interior hole will be suppressed.
Returns:
the pointer to newly created Geometry object (always of the Polygon type): NULL on failure.
NULL will be returned if any argument is invalid.
See also:
gaiaFreeGeomColl, gaiaDelaunayTriangulation
Note:
This function will first create the Delauany Triangulation corresponding to input Geometry, determining at the same time the standard deviation for all edge's lengths.
Then in a second pass all Delaunay's triangles will be filtered, and all triangles presenting at least one edge longer than standard deviation * factor will be discarded.
All filtered triangles will then be merged altogether so to create the Concave Hull.
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaConcaveHull()
Remarks:
GEOS-TRUNK support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConvexHull ( gaiaGeomCollPtr  geom)

Spatial operator: ConvexHull.

Parameters:
geomthe input Geometry object
Returns:
the pointer to newly created Geometry object representing the ConvexHull of input Geometry: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaConvexHull()
Remarks:
GEOS support required.
GAIAGEO_DECLARE double gaiaDegsToRads ( double  degs)

Converts and angle from Degrees into Radians.

Parameters:
degsthe angle measured in Degrees.
Returns:
the angle measured in Radians.
See also:
gaiaRadsToDegs
Remarks:
PROJ.4 support required
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDelaunayTriangulation ( gaiaGeomCollPtr  geom,
double  tolerance,
int  only_edges 
)

Delaunay Triangulation.

Parameters:
geompointer to input Geometry object.
toleranceoptional snapping tolerance.
only_edgesif non-zero will return a MULTILINESTRING, otherwise it will return a MULTIPOLYGON containing triangular POLYGONs.
Returns:
the pointer to newly created Geometry object: NULL on failure.
NULL will be returned if any argument is invalid.
See also:
gaiaFreeGeomColl, gaiaVoronojDiagram, gaiaConcaveHull
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaDelaunayTriangulation()
Remarks:
GEOS-TRUNK support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XY ( const void *  geos)

Converts a GEOS Geometry into a Geometry object [XY dims].

Parameters:
geoshandle to GEOS Geometry
Returns:
the pointer to the newly created Geometry object
See also:
gaiaToGeos, gaiaFromGeos_XYZ, gaiaFromGeos_XYM, gaiaFromGeos_XYZM
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaFromGeos_XY()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYM ( const void *  geos)

Converts a GEOS Geometry into a Geometry object [XYM dims].

Parameters:
geoshandle to GEOS Geometry
Returns:
the pointer to the newly created Geometry object
See also:
gaiaToGeos, gaiaFromGeos_XY, gaiaFromGeos_XYZ, gaiaFromGeos_XYZM
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaFromGeos_XYM()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZ ( const void *  geos)

Converts a GEOS Geometry into a Geometry object [XYZ dims].

Parameters:
geoshandle to GEOS Geometry
Returns:
the pointer to the newly created Geometry object
See also:
gaiaToGeos, gaiaFromGeos_XY, gaiaFromGeos_XYM, gaiaFromGeos_XYZM
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaFromGeos_XYZ()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZM ( const void *  geos)

Converts a GEOS Geometry into a Geometry object [XYZM dims].

Parameters:
geoshandle to GEOS Geometry
Returns:
the pointer to the newly created Geometry object
See also:
gaiaToGeos, gaiaFromGeos_XY, gaiaFromGeos_XYZ, gaiaFromGeos_XYM
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaFromGeos_XYZM()
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollArea ( gaiaGeomCollPtr  geom,
double *  area 
)

Measures the total Area for a Geometry object.

Parameters:
geompointer to Geometry object
areaon completion this variable will contain the measured area
Returns:
0 on failure: any other value on success
See also:
gaiaGeomCollLength, gaiaMeasureArea
Remarks:
GEOS support required.
Examples:
demo1.c.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollBuffer ( gaiaGeomCollPtr  geom,
double  radius,
int  points 
)

Spatial operator: Buffer.

Parameters:
geomthe input Geometry object
radiusthe buffer's radius
pointsnumber of points (aka vertices) to be used in order to approximate a circular arc.
Returns:
the pointer to newly created Geometry object representing the Buffer of input Geometry: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeomCollBuffer()
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollCentroid ( gaiaGeomCollPtr  geom,
double *  x,
double *  y 
)

Spatial operator: Centroid.

Parameters:
geompointer to Geometry object.
xon completion this variable will contain the centroid X coordinate
yon completion this variable will contain the centroid Y coordinate
Returns:
0 on failure: any other value on success
See also:
gaiaRingCentroid
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollContains ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Contains.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollWithin, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollCoveredBy ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Topology check: test if a Geometry is covered by another one.

Parameters:
geom1pointer to first input Geometry object.
geom2pointer to second input Geometry object.
Returns:
0 if false; any other value if geom2 is spatially covered by geom1.
See also:
gaiaGeomCollCovers
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE int gaiaGeomCollCovers ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Topology check: test if a Geometry covers another one.

Parameters:
geom1pointer to first input Geometry object.
geom2pointer to second input Geometry object.
Returns:
0 if false; any other value if geom1 spatially covers geom2.
See also:
gaiaGeomCollCoveredBy
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE int gaiaGeomCollCrosses ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Crosses.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollDisjoint ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Disjoint.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollDistance ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2,
double *  dist 
)

Calculates the minimum distance intercurring between two Geometry objects.

Parameters:
geom1the first Geometry object
geom2the second Geometry object
diston completion this variable will contain the calculated distance
Returns:
0 on failuer: any other value on success.
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollEquals ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Equals.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollIntersects ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Intesects.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollLength ( gaiaGeomCollPtr  geom,
double *  length 
)

Measures the total Length for a Geometry object.

Parameters:
geompointer to Geometry object
lengthon completion this variable will contain the measured length
Returns:
0 on failure: any other value on success
See also:
gaiaGeomCollArea, gaiaMeasureLength
Remarks:
GEOS support required.
Examples:
demo1.c.
GAIAGEO_DECLARE int gaiaGeomCollOverlaps ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Overlaps.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollRelate ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2,
const char *  pattern 
)

Spatial relationship evalution: Relate.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
patternintersection matrix pattern [DE-9IM]
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollTouches
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollSimplify ( gaiaGeomCollPtr  geom,
double  tolerance 
)

Spatial operator: Simplify.

Parameters:
geomthe input Geometry object
toleranceapproximation threshold
Returns:
the pointer to newly created Geometry object representing the simplified Geometry [applying the Douglas-Peucker algorithm]: NULL on failure.
See also:
gaiaFreeGeomColl, gaiaGeomCollSimplifyPreserveTopology
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeomCollSimplify()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollSimplifyPreserveTopology ( gaiaGeomCollPtr  geom,
double  tolerance 
)

Spatial operator: Simplify [preserving topology].

Parameters:
geomthe input Geometry object
toleranceapproximation threshold
Returns:
the pointer to newly created Geometry object representing the simplified Geometry [applying the Douglas-Peucker algorithm]: NULL on failure.
See also:
gaiaFreeGeomColl, gaiaGeomCollSimplify
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeomCollSimplify()
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollTouches ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Touches.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollWithin, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGeomCollWithin ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial relationship evalution: Within.

Parameters:
geom1the first Geometry object to be evaluated
geom2the second Geometry object to be evaluated
Returns:
0 if false: any other value if true
See also:
gaiaGeomCollEquals, gaiaGeomCollDisjoint, gaiaGeomCollIntersects, gaiaGeomCollOverlaps, gaiaGeomCollCrosses, gaiaGeomCollContains, gaiaGeomCollTouches, gaiaGeomCollRelate
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryDifference ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: Difference.

Parameters:
geom1the first Geometry object
geom2the second Geometry object
Returns:
the pointer to newly created Geometry object representing the geometry Difference of both input Geometries: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeometryDifference()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryIntersection ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: Intersection.

Parameters:
geom1the first Geometry object
geom2the second Geometry object
Returns:
the pointer to newly created Geometry object representing the geometry Intersection of both input Geometries: NULL on failure.
See also:
gaiaFreeGeomColl, gaiaGeometryUnion, gaiaGeometryDifference, gaiaGeometrySymDifference, gaiaBoundary
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeometryIntersection()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometrySymDifference ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: SymDifference.

Parameters:
geom1the first Geometry object
geom2the second Geometry object
Returns:
the pointer to newly created Geometry object representing the geometry SymDifference of both input Geometries: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeometrySymDifference()
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryUnion ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: Union.

Parameters:
geom1the first Geometry object
geom2the second Geometry object
Returns:
the pointer to newly created Geometry object representing the geometry Union of both input Geometries: NULL on failure.
See also:
gaiaFreeGeomColl, gaiaUnaryUnion
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeometryUnion()
Remarks:
GEOS support required.
GAIAGEO_DECLARE const char* gaiaGetGeosErrorMsg ( void  )

Return the latest GEOS error message (if any)

Returns:
the latest GEOS error message: an empty string if no error was previoysly found.
See also:
gaiaResetGeosMsg, gaiaGetGeosWarningMsg, gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg
Remarks:
GEOS support required.
GAIAGEO_DECLARE const char* gaiaGetGeosWarningMsg ( void  )

Return the latest GEOS warning message (if any)

Returns:
the latest GEOS warning message: an empty string if no warning was previoysly found.
See also:
gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaGetPointOnSurface ( gaiaGeomCollPtr  geom,
double *  x,
double *  y 
)

Spatial operator: PointOnSurface.

Parameters:
geompointer to Geometry object.
xon completion this variable will contain the Point X coordinate
yon completion this variable will contain the Point Y coordinate
Returns:
0 on failure: any other value on success
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaHausdorffDistance ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2,
double *  dist 
)

Calculates the Hausdorff distance intercurring between two Geometry objects.

Parameters:
geom1pointer to first Geometry object
geom2pointer to second Geometry object
diston completion this variable will contain the calculated Hausdorff distance
Returns:
0 on failure: any other value on success.
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaHexagonalGrid ( gaiaGeomCollPtr  geom,
double  origin_x,
double  origin_y,
double  size,
int  only_edges 
)

Utility function: HexagonalGrid.

Parameters:
geomthe Geometry to be covered by the Grid.
origin_xthe X ccordinate identifying the Grid Origin.
origin_ythe Y coordinate identifiying the Grid Origin.
sizethe Grid cell-side size.
only_edgesif non-zero will return a MULTILINESTRING, otherwise it will return a MULTIPOLYGON containing hexagonal POLYGONs.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will always return a MultiPolygon
NULL will be returned if any argument is invalid.
See also:
gaiaFreeGeomColl, gaiaSquareGrid, gaiaTriangularGrid
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaHexagonalGrid()
GAIAGEO_DECLARE int gaiaIsClosed ( gaiaLinestringPtr  line)

Checks if a Linestring object represents an OGC Closed Geometry.

This function only works on a single linestring - if you pass in a multi-line linestring geometry, it will return 0 (false). See gaiaIsClosedGeom for an alternative.

Parameters:
linepointer to Linestring object.
Returns:
0 if false; any other value if true
See also:
gaiaIsSimple, gaiaIsRing, gaiaIsValid, gaiaIsClosedGeom
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaIsClosedGeom ( gaiaGeomCollPtr  geom)

Checks if a Geometry object represents an OGC Closed Linestring.

Parameters:
linepointer to Geometry object.
Returns:
0 if false; any other value if true
See also:
gaiaIsSimple, gaiaIsRing, gaiaIsValid, gaiaIsClosed
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaIsRing ( gaiaLinestringPtr  line)

Checks if a Linestring object represents an OGC Ring Geometry.

Parameters:
linepointer to Geometry object.
Returns:
0 if false; any other value if true
See also:
gaiaIsSimple, gaiaIsClosed, gaiaIsValid
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaIsSimple ( gaiaGeomCollPtr  geom)

Checks if a Geometry object represents an OGC Simple Geometry.

Parameters:
geompointer to Geometry object.
Returns:
0 if false; any other value if true
See also:
gaiaIsClosed, gaiaIsRing, gaiaIsValid
Remarks:
GEOS support required.
GAIAGEO_DECLARE int gaiaIsValid ( gaiaGeomCollPtr  geom)

Checks if a Geometry object represents an OGC Valid Geometry.

Parameters:
geompointer to Geometry object.
Returns:
0 if false; any other value if true
See also:
gaiaIsSimple, gaiaIsClosed, gaiaIsRing
Remarks:
GEOS support required.
Examples:
demo2.c.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineInterpolateEquidistantPoints ( gaiaGeomCollPtr  ln_geom,
double  distance 
)

Spatial operator: Line Interpolate Equidistant Points.

Parameters:
ln_geomthe input Geometry object [expected to be of lineal type]
distanceregular distance between interpolated points
Returns:
the pointer to newly created Geometry object representing a MultiPoint; such MultiPoint always supports the M coordinate (the corresponding value representing the progressive distance for each interpolated Point). individual Points will be regularly spaced by the given distance: NULL on failure.
See also:
gaiaLineInterpolatePoint
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaLineInterpolateEquidistantPoints()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineInterpolatePoint ( gaiaGeomCollPtr  ln_geom,
double  fraction 
)

Spatial operator: Line Interpolate Point.

Parameters:
ln_geomthe input Geometry object [expected to be of lineal type]
fractiontotal length fraction [in the range 0.0 / 1.0]
Returns:
the pointer to newly created Geometry object representing a Point laying on the input Geometry and positioned at the given length fraction: NULL on failure.
See also:
gaiaLineInterpolateEquidistantPoints
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaLineInterpolatePoint()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE double gaiaLineLocatePoint ( gaiaGeomCollPtr  ln_geom,
gaiaGeomCollPtr  pt_geom 
)

Determines the location of the closest Point on Linestring to the given Point.

Parameters:
ln_geompointer to first input Geometry object [expected to be of the lineal type].
pt_geompointer to second input Geometry object [expected to be a Point].
Returns:
the fraction [in the range 0.0 / 1.0] of ln_geom total length where the closest Point to pt_geom lays.
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineMerge ( gaiaGeomCollPtr  geom)

Spatial operator: Line Merge.

Parameters:
geompointer to input Geometry object.
Returns:
the pointer to newly created Geometry object; NULL on failure.
if possible, this representing a reassembled Linestring or MultiLinestring.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaLineMerge()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinesCutAtNodes ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: Line Cut At Nodes.

Parameters:
geom1pointer to input Geometry object [Linestring or MultiLinestring].
geom2pointer to input Geometry object [Point or MultiPoint].
Returns:
the pointer to newly created Geometry object; NULL on failure.
if possible, any input Linestring will be split accordingly to given Node(s): no point will be interpolated, existing Linestring Vertices will be evaluated.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaLinesCutAtNodes()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineSubstring ( gaiaGeomCollPtr  ln_geom,
double  start_fraction,
double  end_fraction 
)

Spatial operator: Line Substring.

Parameters:
ln_geomthe input Geometry object [expected to be of lineal type]
start_fractionsubstring start, expressed as total length fraction [in the range 0.0 / 1.0]
end_fractionsubstring end, expressed as total length fraction
Returns:
the pointer to newly created Geometry object representing a Linestring laying on the input Geometry.
this Linestring will begin (and stop) at given total length fractions. NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaLineSubstring()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValid ( gaiaGeomCollPtr  geom)

Utility function: MakeValid.

Parameters:
geomthe input Geometry object.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will attempt to create a valid representation of a given invalid geometry without loosing any of the input vertices.
Already-valid geometries are returned without further intervention.
NULL will be returned if the passed argument is invalid.
See also:
gaiaFreeGeomColl, gaiaMakeValidDiscarded
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaMakeValid()
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValidDiscarded ( gaiaGeomCollPtr  geom)

Utility function: MakeValidDiscarded.

Parameters:
geomthe input Geometry object.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will attempt to collect any invalid item (offending geometries) discarded by gaiaMakeValid while building a valid Geometry.
Saving any discarded item could be useful for a finer (manual) adjustment.
NULL will be returned if gaiaMakeValid hasn't identified any offending item to be discarded during the validation.
See also:
gaiaFreeGeomColl, gaiaMakeValid
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaMakeValidDiscarded()
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaOffsetCurve ( gaiaGeomCollPtr  geom,
double  radius,
int  points,
int  left_right 
)

Spatial operator: Offset Curve.

Parameters:
geomthe input Geometry object
radiusthe buffer's radius
pointsnumber of points (aka vertices) to be used in order to approximate a circular arc.
left_rightif set to 1 the left-sided OffsetCurve will be returned; otherwise the right-sided one.
Returns:
the pointer to newly created Geometry object representing the OffsetCurve of input Geometry: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaOffsetCurve()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaPolygonize ( gaiaGeomCollPtr  geom,
int  force_multi 
)

Attempts to rearrange a generic Geometry object into a Polygon or MultiPolygon.

Parameters:
geomthe input Geometry object
force_multiif not set to 0, then an eventual Polygon will be returned casted to MultiPolygon
Returns:
the pointer to newly created Geometry object representing a Polygon or MultiPolygon Geometry: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaPolygonize()
Remarks:
GEOS support required.
GAIAGEO_DECLARE double gaiaRadsToDegs ( double  rads)

Converts and angle from Radians into Degrees.

Parameters:
radsthe angle measured in Radians.
Returns:
the angle measured in Degrees.
See also:
gaiaDegsToRads
Remarks:
PROJ.4 support required
GAIAGEO_DECLARE void gaiaResetGeosMsg ( void  )

Resets the GEOS error and warning messages to an empty state.

See also:
gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, gaiaSetGeosErrorMsg, gaiaSetGeosWarningMsg
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize ( gaiaGeomCollPtr  geom,
double  dist 
)

Utility function: Segmentize.

Parameters:
geomthe input Geometry object.
distthe meximum segment length.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will return a modified geometry having no segment longer than the given distance.
Distance computation is performed in 2d only.
all Points or segments shorter than 'dist' will be returned without further intervention.
NULL will be returned if the passed argument is invalid.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSegmentize()
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE void gaiaSetGeosErrorMsg ( const char *  msg)

Set the current GEOS error message.

Parameters:
msgthe error message to be set.
See also:
gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, gaiaSetGeosWarningMsg
Remarks:
GEOS support required.
GAIAGEO_DECLARE void gaiaSetGeosWarningMsg ( const char *  msg)

Set the current GEOS warning message.

Parameters:
msgthe warning message to be set.
See also:
gaiaResetGeosMsg, gaiaGetGeosErrorMsg, gaiaGetGeosWarningMsg, gaiaSetGeosErrorMsg
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSharedPaths ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: Shared Paths.

Parameters:
geom1pointer to first Geometry object
geom2pointer to second Geometry object
Returns:
the pointer to newly created Geometry object representing any Share Path common to both input geometries: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSharedPaths()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaShortestLine ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2 
)

Spatial operator: Shortest Line.

Parameters:
geom1pointer to the first Geometry object.
geom2pointer to the second Geometry object.
Returns:
the pointer to newly created Geometry object representing a Linestring; NULL on failure.
the returned Linestring graphically represents the minimum distance intercurrinng between both input geometries.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaShortestLine()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSingleSidedBuffer ( gaiaGeomCollPtr  geom,
double  radius,
int  points,
int  left_right 
)

Spatial operator: Single Sided Buffer.

Parameters:
geomthe input Geometry object
radiusthe buffer's radius
pointsnumber of points (aka vertices) to be used in order to approximate a circular arc.
left_rightif set to 1 the left-sided Buffer will be returned; otherwise the right-sided one.
Returns:
the pointer to newly created Geometry object representing the single-sided Buffer of input Geometry: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSingleSidedBuffer()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSnap ( gaiaGeomCollPtr  geom1,
gaiaGeomCollPtr  geom2,
double  tolerance 
)

Spatial operator: Shortest Line.

Parameters:
geom1pointer to the first Geometry object.
geom2pointer to the second Geometry object.
toleranceapproximation factor
Returns:
the pointer to newly created Geometry object; NULL on failure.
the returned Geometry represents the first input Geometry (nicely snapped to the second input Geometry, whenever is possible).
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaShortestLine()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSnapToGrid ( gaiaGeomCollPtr  geom,
double  origin_x,
double  origin_y,
double  origin_z,
double  origin_m,
double  size_x,
double  size_y,
double  size_z,
double  size_m 
)

Utility function: SnapToGrid.

Parameters:
origin_xthe X ccordinate identifying the Grid Origin.
origin_ythe Y coordinate identifiying the Grid Origin.
size_xGrid cell size (X axis).
size_yGrid cell size (Y axis).
size_zGrid cell size (Z axis).
size_mGrid cell size (M axis).
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will return a modified geometry having all points snapped to a regular Grid defined by its origin and cell size.
Consecutive points falling on the same cell will be removed, eventually returning NULL if
output points are not enough to define a geometry of the given type.
Collapsed geometries in a collection are stripped from it.
Specify 0 as size for any dimension you don't want to snap to a grid.
NULL will be returned if the passed argument is invalid.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSnapToGrid()
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplit ( gaiaGeomCollPtr  input,
gaiaGeomCollPtr  blade 
)

Utility function: Split.

Parameters:
inputthe input Geometry object.
bladethe blade Geometry object.
Returns:
the pointer to newly created Geometry object: NULL on failure.
The function supports splitting a line by point, a line by line, a polygon by line.
See also:
gaiaFreeGeomColl, gaiaSplitLeft, gaiaSplitRight
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSplit()
gaiaSplit will return both the left and the right split halves at the same time.
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitLeft ( gaiaGeomCollPtr  input,
gaiaGeomCollPtr  blade 
)

Utility function: SplitLeft.

Parameters:
inputthe input Geometry object.
bladethe blade Geometry object.
Returns:
the pointer to newly created Geometry object: NULL on failure.
The function supports splitting a line by point, a line by line, a polygon by line.
See also:
gaiaFreeGeomColl, gaiaSplit, gaiaSplitRight
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSplitLeft()
gaiaSplitLeft will only return the left split half; NULL may be eventually returned if empty.
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight ( gaiaGeomCollPtr  input,
gaiaGeomCollPtr  blade 
)

Utility function: SplitRight.

Parameters:
inputthe input Geometry object.
bladethe blade Geometry object.
Returns:
the pointer to newly created Geometry object: NULL on failure.
The function supports splitting a line by point, a line by line, a polygon by line.
See also:
gaiaFreeGeomColl, gaiaSplit, gaiaSplitLeft
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSplitRight()
gaiaSplitLeft will only return the right split half; NULL may be eventually returned if empty.
Remarks:
LWGEOM support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSquareGrid ( gaiaGeomCollPtr  geom,
double  origin_x,
double  origin_y,
double  size,
int  only_edges 
)

Utility function: SquareGrid.

Parameters:
geomthe Geometry to be covered by the Grid.
origin_xthe X ccordinate identifying the Grid Origin.
origin_ythe Y coordinate identifiying the Grid Origin.
sizethe Grid cell-side size.
only_edgesif non-zero will return a MULTILINESTRING, otherwise it will return a MULTIPOLYGON containing square POLYGONs.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will always return a MultiPolygon
NULL will be returned if any argument is invalid.
See also:
gaiaFreeGeomColl, gaiaTriangularGrid, gaiaHexagonalGrid
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaSquareGrid()
GAIAGEO_DECLARE void* gaiaToGeos ( const gaiaGeomCollPtr  gaia)

Converts a Geometry object into a GEOS Geometry.

Parameters:
gaiapointer to Geometry object
Returns:
handle to GEOS Geometry
See also:
gaiaFromGeos_XY, gaiaFromGeos_XYZ, gaiaFromGeos_XYM, gaiaFromGeos_XYZM
Remarks:
GEOS support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTransform ( gaiaGeomCollPtr  org,
char *  proj_from,
char *  proj_to 
)

Tansforms a Geometry object into a different Reference System [aka Reprojection].

Parameters:
orgpointer to input Geometry object.
proj_fromgeodetic parameters string [EPSG format] qualifying the input Reference System
proj_togeodetic parameters string [EPSG format] qualifying the output Reference System
Returns:
the pointer to newly created Geometry object: NULL on failure.
See also:
gaiaFreeGeomColl
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaGeometryTransform()
Remarks:
PROJ.4 support required
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTriangularGrid ( gaiaGeomCollPtr  geom,
double  origin_x,
double  origin_y,
double  size,
int  only_edges 
)

Utility function: TriangularGrid.

Parameters:
geomthe Geometry to be covered by the Grid.
origin_xthe X ccordinate identifying the Grid Origin.
origin_ythe Y coordinate identifiying the Grid Origin.
sizethe Grid cell-side size.
only_edgesif non-zero will return a MULTILINESTRING, otherwise it will return a MULTIPOLYGON containing triangular POLYGONs.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function will always return a MultiPolygon
NULL will be returned if any argument is invalid.
See also:
gaiaFreeGeomColl, gaiaSquareGrid, gaiaHexagonalGrid
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaTriangularGrid()
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaUnaryUnion ( gaiaGeomCollPtr  geom)

Spatial operator: Unary Union.

Parameters:
geomthe input Geometry object.
Returns:
the pointer to newly created Geometry object: NULL on failure.
this function is the same as gaiaGeometryUnion, except in that this works internally to the input Geometry itself. NULL on failure.
See also:
gaiaFreeGeomColl, gaiaGeometryUnion
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaUnaryUnion()
Remarks:
GEOS-ADVANCED support required.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaVoronojDiagram ( gaiaGeomCollPtr  geom,
double  extra_frame_size,
double  tolerance,
int  only_edges 
)

Voronoj Diagram.

Parameters:
geompointer to input Geometry object.
extra_frame_sizepercent factor expanding the BBOX of input Geometry
toleranceoptional snapping tolerance.
only_edgesif non-zero will return a MULTILINESTRING, otherwise it will return a MULTIPOLYGON.
Returns:
the pointer to newly created Geometry object: NULL on failure.
NULL will be returned if any argument is invalid.
See also:
gaiaFreeGeomColl, gaiaDelaunayTriangulation
Note:
you are responsible to destroy (before or after) any allocated Geometry, this including any Geometry returned by gaiaVoronojDiagram()
Remarks:
GEOS-TRUNK support required.