SpatiaLite  3.0.0-stable
Functions
src/headers/spatialite/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 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 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 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.

Detailed Description

Geometry handling functions: advanced.


Function Documentation

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 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 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 int gaiaIsClosed ( gaiaLinestringPtr  line)

Checks if a Linestring object represents an OGC Closed Geometry.

Parameters:
linepointer to Geometry object.
Returns:
0 if false; any other value if true
See also:
gaiaIsSimple, gaiaIsRing, gaiaIsValid
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 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:
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 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 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 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 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 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.
 All Data Structures Files Functions Variables Typedefs Defines