geos_c.h File Reference

C API for the GEOS geometry algorithms library. More...

`#include <stddef.h>`
`#include <geos/export.h>`

Go to the source code of this file.

## Typedefs

typedef struct GEOSContextHandle_HS * | GEOSContextHandle_t
typedef void(* | GEOSMessageHandler) (GEOS_PRINTF_FORMAT const char *fmt,...) GEOS_PRINTF_FORMAT_ATTR(1
typedef void typedef void(* | GEOSMessageHandler_r) (const char *message, void *userdata)
typedef struct GEOSGeom_t | GEOSGeometry
typedef struct GEOSPrepGeom_t | GEOSPreparedGeometry
typedef struct GEOSCoordSeq_t | GEOSCoordSequence
typedef struct GEOSSTRtree_t | GEOSSTRtree
typedef struct GEOSBufParams_t | GEOSBufferParams
typedef struct GEOSCoverageCleanParams_t | GEOSCoverageCleanParams
typedef struct GEOSMakeValidParams_t | GEOSMakeValidParams
typedef struct GEOSClusterInfo_t | GEOSClusterInfo
typedef void(* | GEOSQueryCallback) (void *item, void *userdata)
typedef int(* | GEOSDistanceCallback) (const void *item1, const void *item2, double *distance, void *userdata)
typedef int(* | GEOSTransformXYCallback) (double *x, double *y, void *userdata)
typedef int(* | GEOSTransformXYZCallback) (double *x, double *y, double *z, void *userdata)
typedef void | GEOSInterruptCallback(void)
typedef int | GEOSContextInterruptCallback(void *)
typedef struct GEOSWKTReader_t | GEOSWKTReader
typedef struct GEOSWKTWriter_t | GEOSWKTWriter
typedef struct GEOSWKBReader_t | GEOSWKBReader
typedef struct GEOSWKBWriter_t | GEOSWKBWriter
typedef struct GEOSGeoJSONReader_t | GEOSGeoJSONReader
typedef struct GEOSGeoJSONWriter_t | GEOSGeoJSONWriter

## Enumerations

enum | GEOSGeomTypes { GEOS_POINT , GEOS_LINESTRING , GEOS_LINEARRING , GEOS_POLYGON , GEOS_MULTIPOINT , GEOS_MULTILINESTRING , GEOS_MULTIPOLYGON , GEOS_GEOMETRYCOLLECTION , GEOS_CIRCULARSTRING , GEOS_COMPOUNDCURVE , GEOS_CURVEPOLYGON , GEOS_MULTICURVE , GEOS_MULTISURFACE }
enum | GEOSWKBByteOrders { GEOS_WKB_XDR = 0 , GEOS_WKB_NDR = 1 }
enum | GEOSWKBFlavors { GEOS_WKB_EXTENDED = 1 , GEOS_WKB_ISO = 2 }
enum | GEOSOverlapMerge { GEOS_MERGE_LONGEST_BORDER = 0 , GEOS_MERGE_MAX_AREA = 1 , GEOS_MERGE_MIN_AREA = 2 , GEOS_MERGE_MIN_INDEX = 3 }
enum | GEOSBufCapStyles { GEOSBUF_CAP_ROUND = 1 , GEOSBUF_CAP_FLAT = 2 , GEOSBUF_CAP_SQUARE = 3 }
enum | GEOSBufJoinStyles { GEOSBUF_JOIN_ROUND = 1 , GEOSBUF_JOIN_MITRE = 2 , GEOSBUF_JOIN_BEVEL = 3 }
enum | GEOSRelateBoundaryNodeRules { GEOSRELATE_BNR_MOD2 = 1 , GEOSRELATE_BNR_OGC = 1 , GEOSRELATE_BNR_ENDPOINT = 2 , GEOSRELATE_BNR_MULTIVALENT_ENDPOINT = 3 , GEOSRELATE_BNR_MONOVALENT_ENDPOINT = 4 }
enum | GEOSValidFlags { GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE = 1 }
enum | GEOSMakeValidMethods { GEOS_MAKE_VALID_LINEWORK = 0 , GEOS_MAKE_VALID_STRUCTURE = 1 }
enum | GEOSPrecisionRules { GEOS_PREC_VALID_OUTPUT = 0 , GEOS_PREC_NO_TOPO = 1 , GEOS_PREC_KEEP_COLLAPSED = 2 }

## Functions

GEOSInterruptCallback * | GEOS_interruptRegisterCallback (GEOSInterruptCallback *cb)
GEOSContextInterruptCallback * | GEOSContext_setInterruptCallback_r (GEOSContextHandle_t extHandle, GEOSContextInterruptCallback *cb, void *userData)
void | GEOS_interruptRequest (void)
void | GEOS_interruptThread (void)
void | GEOS_interruptCancel (void)
GEOSContextHandle_t | GEOS_init_r (void)
void | GEOS_finish_r (GEOSContextHandle_t handle)
GEOSMessageHandler | GEOSContext_setNoticeHandler_r (GEOSContextHandle_t extHandle, GEOSMessageHandler nf)
GEOSMessageHandler | GEOSContext_setErrorHandler_r (GEOSContextHandle_t extHandle, GEOSMessageHandler ef)
GEOSMessageHandler_r | GEOSContext_setNoticeMessageHandler_r (GEOSContextHandle_t extHandle, GEOSMessageHandler_r nf, void *userData)
GEOSMessageHandler_r | GEOSContext_setErrorMessageHandler_r (GEOSContextHandle_t extHandle, GEOSMessageHandler_r ef, void *userData)
GEOSCoordSequence * | GEOSCoordSeq_create_r (GEOSContextHandle_t handle, unsigned int size, unsigned int dims)
GEOSCoordSequence * | GEOSCoordSeq_createWithDimensions_r (GEOSContextHandle_t handle, unsigned int size, int hasZ, int hasM)
GEOSCoordSequence * | GEOSCoordSeq_copyFromBuffer_r (GEOSContextHandle_t handle, const double *buf, unsigned int size, int hasZ, int hasM)
GEOSCoordSequence * | GEOSCoordSeq_copyFromArrays_r (GEOSContextHandle_t handle, const double *x, const double *y, const double *z, const double *m, unsigned int size)
int | GEOSCoordSeq_copyToBuffer_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, double *buf, int hasZ, int hasM)
int | GEOSCoordSeq_copyToArrays_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, double *x, double *y, double *z, double *m)
GEOSCoordSequence * | GEOSCoordSeq_clone_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s)
void | GEOSCoordSeq_destroy_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
char | GEOSCoordSeq_hasZ_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
char | GEOSCoordSeq_hasM_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
int | GEOSCoordSeq_setX_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setY_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setZ_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setM_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setXY_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, double x, double y)
int | GEOSCoordSeq_setXYZ_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, double x, double y, double z)
int | GEOSCoordSeq_setOrdinate_r (GEOSContextHandle_t handle, GEOSCoordSequence *s, unsigned int idx, unsigned int dim, double val)
int | GEOSCoordSeq_getX_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getY_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getZ_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getM_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getXY_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, double *x, double *y)
int | GEOSCoordSeq_getXYZ_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, double *x, double *y, double *z)
int | GEOSCoordSeq_getOrdinate_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int idx, unsigned int dim, double *val)
int | GEOSCoordSeq_getSize_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int *size)
int | GEOSCoordSeq_getDimensions_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, unsigned int *dims)
int | GEOSCoordSeq_isCCW_r (GEOSContextHandle_t handle, const GEOSCoordSequence *s, char *is_ccw)
double | GEOSProject_r (GEOSContextHandle_t handle, const GEOSGeometry *line, const GEOSGeometry *point)
GEOSGeometry * | GEOSInterpolate_r (GEOSContextHandle_t handle, const GEOSGeometry *line, double d)
double | GEOSProjectNormalized_r (GEOSContextHandle_t handle, const GEOSGeometry *g, const GEOSGeometry *p)
GEOSGeometry * | GEOSInterpolateNormalized_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double d)
GEOSGeometry * | GEOSBuffer_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double width, int quadsegs)
GEOSBufferParams * | GEOSBufferParams_create_r (GEOSContextHandle_t handle)
void | GEOSBufferParams_destroy_r (GEOSContextHandle_t handle, GEOSBufferParams *parms)
int | GEOSBufferParams_setEndCapStyle_r (GEOSContextHandle_t handle, GEOSBufferParams *p, int style)
int | GEOSBufferParams_setJoinStyle_r (GEOSContextHandle_t handle, GEOSBufferParams *p, int joinStyle)
int | GEOSBufferParams_setMitreLimit_r (GEOSContextHandle_t handle, GEOSBufferParams *p, double mitreLimit)
int | GEOSBufferParams_setQuadrantSegments_r (GEOSContextHandle_t handle, GEOSBufferParams *p, int quadSegs)
int | GEOSBufferParams_setSingleSided_r (GEOSContextHandle_t handle, GEOSBufferParams *p, int singleSided)
GEOSGeometry * | GEOSBufferWithParams_r (GEOSContextHandle_t handle, const GEOSGeometry *g, const GEOSBufferParams *p, double width)
GEOSGeometry * | GEOSBufferWithStyle_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double width, int quadsegs, int endCapStyle, int joinStyle, double mitreLimit)
GEOSGeometry * | GEOSDensify_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSOffsetCurve_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double width, int quadsegs, int joinStyle, double mitreLimit)
GEOSGeometry * | GEOSGeom_createPoint_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createPointFromXY_r (GEOSContextHandle_t handle, double x, double y)
GEOSGeometry * | GEOSGeom_createEmptyPoint_r (GEOSContextHandle_t handle)
GEOSGeometry * | GEOSGeom_createLinearRing_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createLineString_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createEmptyLineString_r (GEOSContextHandle_t handle)
GEOSGeometry * | GEOSGeom_createEmptyPolygon_r (GEOSContextHandle_t handle)
GEOSGeometry * | GEOSGeom_createPolygon_r (GEOSContextHandle_t handle, GEOSGeometry *shell, GEOSGeometry **holes, unsigned int nholes)
GEOSGeometry * | GEOSGeom_createCollection_r (GEOSContextHandle_t handle, int type, GEOSGeometry **geoms, unsigned int ngeoms)
GEOSGeometry ** | GEOSGeom_releaseCollection_r (GEOSContextHandle_t handle, GEOSGeometry *collection, unsigned int *ngeoms)
GEOSGeometry * | GEOSGeom_createEmptyCollection_r (GEOSContextHandle_t handle, int type)
GEOSGeometry * | GEOSGeom_createRectangle_r (GEOSContextHandle_t handle, double xmin, double ymin, double xmax, double ymax)
GEOSGeometry * | GEOSGeom_clone_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSGeom_createCircularString_r (GEOSContextHandle_t handle, GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createEmptyCircularString_r (GEOSContextHandle_t handle)
GEOSGeometry * | GEOSGeom_createCompoundCurve_r (GEOSContextHandle_t handle, GEOSGeometry **curves, unsigned int ncurves)
GEOSGeometry * | GEOSGeom_createEmptyCompoundCurve_r (GEOSContextHandle_t handle)
GEOSGeometry * | GEOSGeom_createCurvePolygon_r (GEOSContextHandle_t handle, GEOSGeometry *shell, GEOSGeometry **holes, unsigned int nholes)
GEOSGeometry * | GEOSGeom_createEmptyCurvePolygon_r (GEOSContextHandle_t handle)
void | GEOSGeom_destroy_r (GEOSContextHandle_t handle, GEOSGeometry *g)
GEOSGeometry * | GEOSCoverageUnion_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSCoverageIsValid_r (GEOSContextHandle_t extHandle, const GEOSGeometry *input, double gapWidth, GEOSGeometry **output)
GEOSGeometry * | GEOSCoverageSimplifyVW_r (GEOSContextHandle_t extHandle, const GEOSGeometry *input, double tolerance, int preserveBoundary)
GEOSCoverageCleanParams * | GEOSCoverageCleanParams_create_r (GEOSContextHandle_t extHandle)
void | GEOSCoverageCleanParams_destroy_r (GEOSContextHandle_t extHandle, GEOSCoverageCleanParams *params)
int | GEOSCoverageCleanParams_setSnappingDistance_r (GEOSContextHandle_t extHandle, GEOSCoverageCleanParams *params, double snappingDistance)
int | GEOSCoverageCleanParams_setGapMaximumWidth_r (GEOSContextHandle_t extHandle, GEOSCoverageCleanParams *params, double gapMaximumWidth)
int | GEOSCoverageCleanParams_setOverlapMergeStrategy_r (GEOSContextHandle_t extHandle, GEOSCoverageCleanParams *params, int overlapMergeStrategy)
GEOSGeometry * | GEOSCoverageCleanWithParams_r (GEOSContextHandle_t extHandle, const GEOSGeometry *input, const GEOSCoverageCleanParams *params)
GEOSGeometry * | GEOSCoverageClean_r (GEOSContextHandle_t extHandle, const GEOSGeometry *input)
GEOSGeometry * | GEOSEnvelope_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSIntersection_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSIntersectionPrec_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double gridSize)
GEOSGeometry * | GEOSConvexHull_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSConcaveHull_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double ratio, unsigned int allowHoles)
GEOSGeometry * | GEOSConcaveHullByLength_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double ratio, unsigned int allowHoles)
GEOSGeometry * | GEOSPolygonHullSimplify_r (GEOSContextHandle_t handle, const GEOSGeometry *g, unsigned int isOuter, double vertexNumFraction)
GEOSGeometry * | GEOSPolygonHullSimplifyMode_r (GEOSContextHandle_t handle, const GEOSGeometry *g, unsigned int isOuter, unsigned int parameterMode, double parameter)
GEOSGeometry * | GEOSConcaveHullOfPolygons_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double lengthRatio, unsigned int isTight, unsigned int isHolesAllowed)
GEOSGeometry * | GEOSMinimumRotatedRectangle_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSMaximumInscribedCircle_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSLargestEmptyCircle_r (GEOSContextHandle_t handle, const GEOSGeometry *g, const GEOSGeometry *boundary, double tolerance)
GEOSGeometry * | GEOSMinimumWidth_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSMinimumClearanceLine_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSMinimumClearance_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *distance)
GEOSGeometry * | GEOSDifference_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSDifferencePrec_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double gridSize)
GEOSGeometry * | GEOSSymDifference_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSSymDifferencePrec_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double gridSize)
GEOSGeometry * | GEOSBoundary_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSUnion_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSUnionPrec_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double gridSize)
GEOSGeometry * | GEOSUnaryUnion_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSUnaryUnionPrec_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double gridSize)
GEOSGeometry * | GEOSDisjointSubsetUnion_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSPointOnSurface_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSGetCentroid_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSMinimumBoundingCircle_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *radius, GEOSGeometry **center)
GEOSGeometry * | GEOSNode_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSClipByRect_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double xmin, double ymin, double xmax, double ymax)
int | GEOSGridIntersectionFractions_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double xmin, double ymin, double xmax, double ymax, unsigned nx, unsigned ny, float *buf)
GEOSGeometry * | GEOSPolygonize_r (GEOSContextHandle_t handle, const GEOSGeometry *const geoms[], unsigned int ngeoms)
GEOSGeometry * | GEOSPolygonize_valid_r (GEOSContextHandle_t handle, const GEOSGeometry *const geoms[], unsigned int ngems)
GEOSGeometry * | GEOSPolygonizer_getCutEdges_r (GEOSContextHandle_t handle, const GEOSGeometry *const geoms[], unsigned int ngeoms)
GEOSGeometry * | GEOSPolygonize_full_r (GEOSContextHandle_t handle, const GEOSGeometry *input, GEOSGeometry **cuts, GEOSGeometry **dangles, GEOSGeometry **invalidRings)
GEOSGeometry * | GEOSBuildArea_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSLineMerge_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSLineMergeDirected_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSLineSubstring_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double start_fraction, double end_fdraction)
GEOSGeometry * | GEOSReverse_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSSimplify_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSTopologyPreserveSimplify_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSGeom_extractUniquePoints_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSSharedPaths_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSSnap_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double tolerance)
GEOSGeometry * | GEOSDelaunayTriangulation_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double tolerance, int onlyEdges)
GEOSGeometry * | GEOSConstrainedDelaunayTriangulation_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSVoronoiDiagram_r (GEOSContextHandle_t extHandle, const GEOSGeometry *g, const GEOSGeometry *env, double tolerance, int flags)
int | GEOSSegmentIntersection_r (GEOSContextHandle_t extHandle, double ax0, double ay0, double ax1, double ay1, double bx0, double by0, double bx1, double by1, double *cx, double *cy)
char | GEOSDisjoint_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSTouches_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSIntersects_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSCrosses_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSWithin_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSContains_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSOverlaps_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSEquals_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSEqualsExact_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double tolerance)
char | GEOSEqualsIdentical_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSCovers_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSCoveredBy_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
const GEOSPreparedGeometry * | GEOSPrepare_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
void | GEOSPreparedGeom_destroy_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *g)
char | GEOSPreparedContains_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedContainsXY_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, double x, double y)
char | GEOSPreparedContainsProperly_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedCoveredBy_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedCovers_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedCrosses_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedDisjoint_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedIntersects_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedIntersectsXY_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, double x, double y)
char | GEOSPreparedOverlaps_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedTouches_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedWithin_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char * | GEOSPreparedRelate_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedRelatePattern_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2, const char *im)
GEOSCoordSequence * | GEOSPreparedNearestPoints_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
int | GEOSPreparedDistance_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2, double *dist)
char | GEOSPreparedDistanceWithin_r (GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2, double dist)
GEOSSTRtree * | GEOSSTRtree_create_r (GEOSContextHandle_t handle, size_t nodeCapacity)
int | GEOSSTRtree_build_r (GEOSContextHandle_t handle, GEOSSTRtree *tree)
void | GEOSSTRtree_insert_r (GEOSContextHandle_t handle, GEOSSTRtree *tree, const GEOSGeometry *g, void *item)
void | GEOSSTRtree_query_r (GEOSContextHandle_t handle, GEOSSTRtree *tree, const GEOSGeometry *g, GEOSQueryCallback callback, void *userdata)
const GEOSGeometry * | GEOSSTRtree_nearest_r (GEOSContextHandle_t handle, GEOSSTRtree *tree, const GEOSGeometry *geom)
const void * | GEOSSTRtree_nearest_generic_r (GEOSContextHandle_t handle, GEOSSTRtree *tree, const void *item, const GEOSGeometry *itemEnvelope, GEOSDistanceCallback distancefn, void *userdata)
void | GEOSSTRtree_iterate_r (GEOSContextHandle_t handle, GEOSSTRtree *tree, GEOSQueryCallback callback, void *userdata)
char | GEOSSTRtree_remove_r (GEOSContextHandle_t handle, GEOSSTRtree *tree, const GEOSGeometry *g, void *item)
void | GEOSSTRtree_destroy_r (GEOSContextHandle_t handle, GEOSSTRtree *tree)
char | GEOSisEmpty_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSisSimple_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSisRing_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSHasZ_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSHasM_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSisClosed_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSRelatePattern_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, const char *imPattern)
char * | GEOSRelate_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSRelatePatternMatch_r (GEOSContextHandle_t handle, const char *intMatrix, const char *imPattern)
char * | GEOSRelateBoundaryNodeRule_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, int bnr)
char | GEOSisValid_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char * | GEOSisValidReason_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
char | GEOSisSimpleDetail_r (GEOSContextHandle_t handle, const GEOSGeometry *g, int findAllLocations, GEOSGeometry **location)
char | GEOSisValidDetail_r (GEOSContextHandle_t handle, const GEOSGeometry *g, int flags, char **reason, GEOSGeometry **location)
GEOSMakeValidParams * | GEOSMakeValidParams_create_r (GEOSContextHandle_t extHandle)
void | GEOSMakeValidParams_destroy_r (GEOSContextHandle_t handle, GEOSMakeValidParams *parms)
int | GEOSMakeValidParams_setKeepCollapsed_r (GEOSContextHandle_t handle, GEOSMakeValidParams *p, int style)
int | GEOSMakeValidParams_setMethod_r (GEOSContextHandle_t handle, GEOSMakeValidParams *p, enum GEOSMakeValidMethods method)
GEOSGeometry * | GEOSMakeValid_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSMakeValidWithParams_r (GEOSContextHandle_t handle, const GEOSGeometry *g, const GEOSMakeValidParams *makeValidParams)
GEOSGeometry * | GEOSRemoveRepeatedPoints_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double tolerance)
char * | GEOSGeomType_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGeomTypeId_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGetSRID_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
void | GEOSSetSRID_r (GEOSContextHandle_t handle, GEOSGeometry *g, int SRID)
void * | GEOSGeom_getUserData_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
void | GEOSGeom_setUserData_r (GEOSContextHandle_t handle, GEOSGeometry *g, void *userData)
int | GEOSGetNumGeometries_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
const GEOSGeometry * | GEOSGetGeometryN_r (GEOSContextHandle_t handle, const GEOSGeometry *g, int n)
int | GEOSNormalize_r (GEOSContextHandle_t handle, GEOSGeometry *g)
int | GEOSOrientPolygons_r (GEOSContextHandle_t handle, GEOSGeometry *g, int exteriorCW)
GEOSGeometry * | GEOSGeom_setPrecision_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double gridSize, int flags)
double | GEOSGeom_getPrecision_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGetNumInteriorRings_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGeomGetNumPoints_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGeomGetX_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *x)
int | GEOSGeomGetY_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *y)
int | GEOSGeomGetZ_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *z)
int | GEOSGeomGetM_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *m)
const GEOSGeometry * | GEOSGetInteriorRingN_r (GEOSContextHandle_t handle, const GEOSGeometry *g, int n)
const GEOSGeometry * | GEOSGetExteriorRing_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGetNumCoordinates_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
const GEOSCoordSequence * | GEOSGeom_getCoordSeq_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGeom_getDimensions_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGeom_getCoordinateDimension_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSGeom_getXMin_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *value)
int | GEOSGeom_getYMin_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *value)
int | GEOSGeom_getXMax_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *value)
int | GEOSGeom_getYMax_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *value)
int | GEOSGeom_getExtent_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *xmin, double *ymin, double *xmax, double *ymax)
GEOSGeometry * | GEOSGeomGetPointN_r (GEOSContextHandle_t handle, const GEOSGeometry *g, int n)
GEOSGeometry * | GEOSGeomGetStartPoint_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSGeometry * | GEOSGeomGetEndPoint_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOSArea_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *area)
int | GEOSLength_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *length)
int | GEOSDistance_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
char | GEOSDistanceWithin_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double dist)
int | GEOSDistanceIndexed_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
int | GEOSHausdorffDistance_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
int | GEOSHausdorffDistanceDensify_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double densifyFrac, double *dist)
int | GEOSFrechetDistance_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
int | GEOSFrechetDistanceDensify_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2, double densifyFrac, double *dist)
int | GEOSHilbertCode_r (GEOSContextHandle_t handle, const GEOSGeometry *geom, const GEOSGeometry *extent, unsigned int level, unsigned int *code)
int | GEOSGeomGetLength_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double *length)
GEOSCoordSequence * | GEOSNearestPoints_r (GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSGeom_transformXY_r (GEOSContextHandle_t handle, const GEOSGeometry *g, GEOSTransformXYCallback callback, void *userdata)
GEOSGeometry * | GEOSGeom_transformXYZ_r (GEOSContextHandle_t handle, const GEOSGeometry *g, GEOSTransformXYZCallback callback, void *userdata)
GEOSClusterInfo * | GEOSClusterDBSCAN_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double eps, unsigned minPoints)
GEOSClusterInfo * | GEOSClusterGeometryDistance_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double d)
GEOSClusterInfo * | GEOSClusterGeometryIntersects_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
GEOSClusterInfo * | GEOSClusterEnvelopeDistance_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double d)
GEOSClusterInfo * | GEOSClusterEnvelopeIntersects_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
size_t | GEOSClusterInfo_getNumClusters_r (GEOSContextHandle_t, const GEOSClusterInfo *clusters)
size_t | GEOSClusterInfo_getClusterSize_r (GEOSContextHandle_t, const GEOSClusterInfo *clusters, size_t i)
size_t * | GEOSClusterInfo_getClustersForInputs_r (GEOSContextHandle_t, const GEOSClusterInfo *clusters)
const size_t * | GEOSClusterInfo_getInputsForClusterN_r (GEOSContextHandle_t, const GEOSClusterInfo *clusters, size_t i)
void | GEOSClusterInfo_destroy_r (GEOSContextHandle_t, GEOSClusterInfo *info)
int | GEOSOrientationIndex_r (GEOSContextHandle_t handle, double Ax, double Ay, double Bx, double By, double Px, double Py)
GEOSWKTReader * | GEOSWKTReader_create_r (GEOSContextHandle_t handle)
void | GEOSWKTReader_destroy_r (GEOSContextHandle_t handle, GEOSWKTReader *reader)
GEOSGeometry * | GEOSWKTReader_read_r (GEOSContextHandle_t handle, GEOSWKTReader *reader, const char *wkt)
void | GEOSWKTReader_setFixStructure_r (GEOSContextHandle_t handle, GEOSWKTReader *reader, char doFix)
GEOSWKTWriter * | GEOSWKTWriter_create_r (GEOSContextHandle_t handle)
void | GEOSWKTWriter_destroy_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer)
char * | GEOSWKTWriter_write_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer, const GEOSGeometry *g)
void | GEOSWKTWriter_setTrim_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer, char trim)
void | GEOSWKTWriter_setRoundingPrecision_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer, int precision)
void | GEOSWKTWriter_setOutputDimension_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer, int dim)
int | GEOSWKTWriter_getOutputDimension_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer)
void | GEOSWKTWriter_setOld3D_r (GEOSContextHandle_t handle, GEOSWKTWriter *writer, int useOld3D)
int | GEOS_printDouble (double d, unsigned int precision, char *result)
GEOSWKBReader * | GEOSWKBReader_create_r (GEOSContextHandle_t handle)
void | GEOSWKBReader_destroy_r (GEOSContextHandle_t handle, GEOSWKBReader *reader)
void | GEOSWKBReader_setFixStructure_r (GEOSContextHandle_t handle, GEOSWKBReader *reader, char doFix)
GEOSGeometry * | GEOSWKBReader_read_r (GEOSContextHandle_t handle, GEOSWKBReader *reader, const unsigned char *wkb, size_t size)
GEOSGeometry * | GEOSWKBReader_readHEX_r (GEOSContextHandle_t handle, GEOSWKBReader *reader, const unsigned char *hex, size_t size)
GEOSWKBWriter * | GEOSWKBWriter_create_r (GEOSContextHandle_t handle)
void | GEOSWKBWriter_destroy_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer)
unsigned char * | GEOSWKBWriter_write_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer, const GEOSGeometry *g, size_t *size)
unsigned char * | GEOSWKBWriter_writeHEX_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer, const GEOSGeometry *g, size_t *size)
int | GEOSWKBWriter_getOutputDimension_r (GEOSContextHandle_t handle, const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setOutputDimension_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer, int newDimension)
int | GEOSWKBWriter_getByteOrder_r (GEOSContextHandle_t handle, const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setByteOrder_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer, int byteOrder)
int | GEOSWKBWriter_getFlavor_r (GEOSContextHandle_t handle, const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setFlavor_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer, int flavor)
char | GEOSWKBWriter_getIncludeSRID_r (GEOSContextHandle_t handle, const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setIncludeSRID_r (GEOSContextHandle_t handle, GEOSWKBWriter *writer, const char writeSRID)
GEOSGeoJSONReader * | GEOSGeoJSONReader_create_r (GEOSContextHandle_t handle)
void | GEOSGeoJSONReader_destroy_r (GEOSContextHandle_t handle, GEOSGeoJSONReader *reader)
GEOSGeometry * | GEOSGeoJSONReader_readGeometry_r (GEOSContextHandle_t handle, GEOSGeoJSONReader *reader, const char *geojson)
GEOSGeoJSONWriter * | GEOSGeoJSONWriter_create_r (GEOSContextHandle_t handle)
void | GEOSGeoJSONWriter_destroy_r (GEOSContextHandle_t handle, GEOSGeoJSONWriter *writer)
char * | GEOSGeoJSONWriter_writeGeometry_r (GEOSContextHandle_t handle, GEOSGeoJSONWriter *writer, const GEOSGeometry *g, int indent)
void | GEOSGeoJSONWriter_setOutputDimension_r (GEOSContextHandle_t handle, GEOSGeoJSONWriter *writer, int dim)
int | GEOSGeoJSONWriter_getOutputDimension_r (GEOSContextHandle_t handle, GEOSGeoJSONWriter *writer)
void | GEOSFree_r (GEOSContextHandle_t handle, void *buffer)
const char * | GEOSversion (void)
Library and Memory Management
Functions to initialize and tear down the library, and deallocate memory.
void | initGEOS (GEOSMessageHandler notice_function, GEOSMessageHandler error_function)
void | finishGEOS (void)
void | GEOSFree (void *buffer)
Coordinate Sequences
A GEOSCoordSequence is an ordered list of coordinates. Coordinates are 2 (XY), 3 (XYZ or XYM), or 4 (XYZM) dimensional.
GEOSCoordSequence * | GEOSCoordSeq_create (unsigned int size, unsigned int dims)
GEOSCoordSequence * | GEOSCoordSeq_createWithDimensions (unsigned int size, int hasZ, int hasM)
GEOSCoordSequence * | GEOSCoordSeq_copyFromBuffer (const double *buf, unsigned int size, int hasZ, int hasM)
GEOSCoordSequence * | GEOSCoordSeq_copyFromArrays (const double *x, const double *y, const double *z, const double *m, unsigned int size)
int | GEOSCoordSeq_copyToBuffer (const GEOSCoordSequence *s, double *buf, int hasZ, int hasM)
int | GEOSCoordSeq_copyToArrays (const GEOSCoordSequence *s, double *x, double *y, double *z, double *m)
GEOSCoordSequence * | GEOSCoordSeq_clone (const GEOSCoordSequence *s)
void | GEOSCoordSeq_destroy (GEOSCoordSequence *s)
char | GEOSCoordSeq_hasZ (GEOSCoordSequence *s)
char | GEOSCoordSeq_hasM (GEOSCoordSequence *s)
int | GEOSCoordSeq_setX (GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setY (GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setZ (GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setM (GEOSCoordSequence *s, unsigned int idx, double val)
int | GEOSCoordSeq_setXY (GEOSCoordSequence *s, unsigned int idx, double x, double y)
int | GEOSCoordSeq_setXYZ (GEOSCoordSequence *s, unsigned int idx, double x, double y, double z)
int | GEOSCoordSeq_setOrdinate (GEOSCoordSequence *s, unsigned int idx, unsigned int dim, double val)
int | GEOSCoordSeq_getX (const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getY (const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getZ (const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getM (const GEOSCoordSequence *s, unsigned int idx, double *val)
int | GEOSCoordSeq_getXY (const GEOSCoordSequence *s, unsigned int idx, double *x, double *y)
int | GEOSCoordSeq_getXYZ (const GEOSCoordSequence *s, unsigned int idx, double *x, double *y, double *z)
int | GEOSCoordSeq_getOrdinate (const GEOSCoordSequence *s, unsigned int idx, unsigned int dim, double *val)
int | GEOSCoordSeq_getSize (const GEOSCoordSequence *s, unsigned int *size)
int | GEOSCoordSeq_getDimensions (const GEOSCoordSequence *s, unsigned int *dims)
int | GEOSCoordSeq_isCCW (const GEOSCoordSequence *s, char *is_ccw)
Geometry Constructors
Functions for creating and destroying geometries. Created geometries must be freed with GEOSGeom_destroy().
GEOSGeometry * | GEOSGeom_createPoint (GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createPointFromXY (double x, double y)
GEOSGeometry * | GEOSGeom_createEmptyPoint (void)
GEOSGeometry * | GEOSGeom_createLinearRing (GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createLineString (GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createEmptyLineString (void)
GEOSGeometry * | GEOSGeom_createEmptyPolygon (void)
GEOSGeometry * | GEOSGeom_createPolygon (GEOSGeometry *shell, GEOSGeometry **holes, unsigned int nholes)
GEOSGeometry * | GEOSGeom_createCircularString (GEOSCoordSequence *s)
GEOSGeometry * | GEOSGeom_createEmptyCircularString ()
GEOSGeometry * | GEOSGeom_createCompoundCurve (GEOSGeometry **curves, unsigned int ncurves)
GEOSGeometry * | GEOSGeom_createEmptyCompoundCurve ()
GEOSGeometry * | GEOSGeom_createCurvePolygon (GEOSGeometry *shell, GEOSGeometry **holes, unsigned int nholes)
GEOSGeometry * | GEOSGeom_createEmptyCurvePolygon ()
GEOSGeometry * | GEOSGeom_createCollection (int type, GEOSGeometry **geoms, unsigned int ngeoms)
GEOSGeometry ** | GEOSGeom_releaseCollection (GEOSGeometry *collection, unsigned int *ngeoms)
GEOSGeometry * | GEOSGeom_createEmptyCollection (int type)
GEOSGeometry * | GEOSGeom_createRectangle (double xmin, double ymin, double xmax, double ymax)
GEOSGeometry * | GEOSGeom_clone (const GEOSGeometry *g)
void | GEOSGeom_destroy (GEOSGeometry *g)
Geometry Accessors
Functions to provide information about geometries.
char * | GEOSGeomType (const GEOSGeometry *g)
int | GEOSGeomTypeId (const GEOSGeometry *g)
int | GEOSGetSRID (const GEOSGeometry *g)
void * | GEOSGeom_getUserData (const GEOSGeometry *g)
int | GEOSGetNumGeometries (const GEOSGeometry *g)
const GEOSGeometry * | GEOSGetGeometryN (const GEOSGeometry *g, int n)
double | GEOSGeom_getPrecision (const GEOSGeometry *g)
int | GEOSGetNumInteriorRings (const GEOSGeometry *g)
int | GEOSGeomGetNumPoints (const GEOSGeometry *g)
int | GEOSGeomGetX (const GEOSGeometry *g, double *x)
int | GEOSGeomGetY (const GEOSGeometry *g, double *y)
int | GEOSGeomGetZ (const GEOSGeometry *g, double *z)
int | GEOSGeomGetM (const GEOSGeometry *g, double *m)
const GEOSGeometry * | GEOSGetInteriorRingN (const GEOSGeometry *g, int n)
const GEOSGeometry * | GEOSGetExteriorRing (const GEOSGeometry *g)
int | GEOSGetNumCoordinates (const GEOSGeometry *g)
const GEOSCoordSequence * | GEOSGeom_getCoordSeq (const GEOSGeometry *g)
int | GEOSGeom_getDimensions (const GEOSGeometry *g)
int | GEOSGeom_getCoordinateDimension (const GEOSGeometry *g)
int | GEOSGeom_getXMin (const GEOSGeometry *g, double *value)
int | GEOSGeom_getYMin (const GEOSGeometry *g, double *value)
int | GEOSGeom_getXMax (const GEOSGeometry *g, double *value)
int | GEOSGeom_getYMax (const GEOSGeometry *g, double *value)
int | GEOSGeom_getExtent (const GEOSGeometry *g, double *xmin, double *ymin, double *xmax, double *ymax)
GEOSGeometry * | GEOSGeomGetPointN (const GEOSGeometry *g, int n)
GEOSGeometry * | GEOSGeomGetStartPoint (const GEOSGeometry *g)
GEOSGeometry * | GEOSGeomGetEndPoint (const GEOSGeometry *g)
char | GEOSisEmpty (const GEOSGeometry *g)
char | GEOSisRing (const GEOSGeometry *g)
char | GEOSHasZ (const GEOSGeometry *g)
char | GEOSHasM (const GEOSGeometry *g)
char | GEOSisClosed (const GEOSGeometry *g)
Geometry Mutators
Functions to change geometry information or content.
void | GEOSSetSRID (GEOSGeometry *g, int SRID)
void | GEOSGeom_setUserData (GEOSGeometry *g, void *userData)
int | GEOSNormalize (GEOSGeometry *g)
int | GEOSOrientPolygons (GEOSGeometry *g, int exteriorCW)
Validation
Functions to check and create topological validity, simplicity and geometric quality.
char | GEOSisSimple (const GEOSGeometry *g)
char | GEOSisSimpleDetail (const GEOSGeometry *g, int findAllLocations, GEOSGeometry **locations)
char | GEOSisValid (const GEOSGeometry *g)
char * | GEOSisValidReason (const GEOSGeometry *g)
char | GEOSisValidDetail (const GEOSGeometry *g, int flags, char **reason, GEOSGeometry **location)
GEOSGeometry * | GEOSMakeValid (const GEOSGeometry *g)
GEOSGeometry * | GEOSMakeValidWithParams (const GEOSGeometry *g, const GEOSMakeValidParams *makeValidParams)
GEOSMakeValidParams * | GEOSMakeValidParams_create (void)
void | GEOSMakeValidParams_destroy (GEOSMakeValidParams *parms)
int | GEOSMakeValidParams_setMethod (GEOSMakeValidParams *p, enum GEOSMakeValidMethods method)
int | GEOSMakeValidParams_setKeepCollapsed (GEOSMakeValidParams *p, int keepCollapsed)
int | GEOSMinimumClearance (const GEOSGeometry *g, double *d)
GEOSGeometry * | GEOSMinimumClearanceLine (const GEOSGeometry *g)
GEOSGeometry * | GEOSRemoveRepeatedPoints (const GEOSGeometry *g, double tolerance)
Geometry Metrics
Functions to compute geometry metrics.
int | GEOSArea (const GEOSGeometry *g, double *area)
int | GEOSLength (const GEOSGeometry *g, double *length)
int | GEOSGeomGetLength (const GEOSGeometry *g, double *length)
Distance
Functions to compute distances between geometries using various distance metrics.
int | GEOSDistance (const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
char | GEOSDistanceWithin (const GEOSGeometry *g1, const GEOSGeometry *g2, double dist)
int | GEOSDistanceIndexed (const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
GEOSCoordSequence * | GEOSNearestPoints (const GEOSGeometry *g1, const GEOSGeometry *g2)
int | GEOSHausdorffDistance (const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
int | GEOSHausdorffDistanceDensify (const GEOSGeometry *g1, const GEOSGeometry *g2, double densifyFrac, double *dist)
int | GEOSFrechetDistance (const GEOSGeometry *g1, const GEOSGeometry *g2, double *dist)
int | GEOSFrechetDistanceDensify (const GEOSGeometry *g1, const GEOSGeometry *g2, double densifyFrac, double *dist)
Linear Referencing
Functions to operate on LineStrings using locations specified by distance along the line.
double | GEOSProject (const GEOSGeometry *line, const GEOSGeometry *point)
GEOSGeometry * | GEOSInterpolate (const GEOSGeometry *line, double d)
double | GEOSProjectNormalized (const GEOSGeometry *line, const GEOSGeometry *point)
GEOSGeometry * | GEOSInterpolateNormalized (const GEOSGeometry *line, double proportion)
Overlay
Functions for computing boolean set-theoretic values from overlay pairs of geometries.
GEOSGeometry * | GEOSIntersection (const GEOSGeometry *g1, const GEOSGeometry *g2)
GEOSGeometry * | GEOSIntersectionPrec (const GEOSGeometry *g1, const GEOSGeometry *g2, double gridSize)
GEOSGeometry * | GEOSDifference (const GEOSGeometry *ga, const GEOSGeometry *gb)
GEOSGeometry * | GEOSDifferencePrec (const GEOSGeometry *ga, const GEOSGeometry *gb, double gridSize)
GEOSGeometry * | GEOSSymDifference (const GEOSGeometry *ga, const GEOSGeometry *gb)
GEOSGeometry * | GEOSSymDifferencePrec (const GEOSGeometry *ga, const GEOSGeometry *gb, double gridSize)
GEOSGeometry * | GEOSUnion (const GEOSGeometry *ga, const GEOSGeometry *gb)
GEOSGeometry * | GEOSUnionPrec (const GEOSGeometry *ga, const GEOSGeometry *gb, double gridSize)
GEOSGeometry * | GEOSUnaryUnion (const GEOSGeometry *g)
GEOSGeometry * | GEOSUnaryUnionPrec (const GEOSGeometry *g, double gridSize)
GEOSGeometry * | GEOSDisjointSubsetUnion (const GEOSGeometry *g)
GEOSGeometry * | GEOSClipByRect (const GEOSGeometry *g, double xmin, double ymin, double xmax, double ymax)
int | GEOSGridIntersectionFractions (const GEOSGeometry *g, double xmin, double ymin, double xmax, double ymax, unsigned nx, unsigned ny, float *buf)
GEOSGeometry * | GEOSSharedPaths (const GEOSGeometry *g1, const GEOSGeometry *g2)
Buffer and Offset Curves
Functions for creating distance-based buffers and offset curves.
GEOSGeometry * | GEOSBuffer (const GEOSGeometry *g, double width, int quadsegs)
GEOSBufferParams * | GEOSBufferParams_create (void)
void | GEOSBufferParams_destroy (GEOSBufferParams *parms)
int | GEOSBufferParams_setEndCapStyle (GEOSBufferParams *p, int style)
int | GEOSBufferParams_setJoinStyle (GEOSBufferParams *p, int joinStyle)
int | GEOSBufferParams_setMitreLimit (GEOSBufferParams *p, double mitreLimit)
int | GEOSBufferParams_setQuadrantSegments (GEOSBufferParams *p, int quadSegs)
int | GEOSBufferParams_setSingleSided (GEOSBufferParams *p, int singleSided)
GEOSGeometry * | GEOSBufferWithParams (const GEOSGeometry *g, const GEOSBufferParams *p, double width)
GEOSGeometry * | GEOSBufferWithStyle (const GEOSGeometry *g, double width, int quadsegs, int endCapStyle, int joinStyle, double mitreLimit)
GEOSGeometry * | GEOSOffsetCurve (const GEOSGeometry *g, double width, int quadsegs, int joinStyle, double mitreLimit)
Coverages
Functions to work with coverages represented by lists of polygons that exactly share edge geometry.
GEOSGeometry * | GEOSCoverageUnion (const GEOSGeometry *g)
int | GEOSCoverageIsValid (const GEOSGeometry *input, double gapWidth, GEOSGeometry **invalidEdges)
GEOSGeometry * | GEOSCoverageSimplifyVW (const GEOSGeometry *input, double tolerance, int preserveBoundary)
GEOSCoverageCleanParams * | GEOSCoverageCleanParams_create ()
void | GEOSCoverageCleanParams_destroy (GEOSCoverageCleanParams *params)
int | GEOSCoverageCleanParams_setSnappingDistance (GEOSCoverageCleanParams *params, double snappingDistance)
int | GEOSCoverageCleanParams_setGapMaximumWidth (GEOSCoverageCleanParams *params, double gapMaximumWidth)
int | GEOSCoverageCleanParams_setOverlapMergeStrategy (GEOSCoverageCleanParams *params, int overlapMergeStrategy)
GEOSGeometry * | GEOSCoverageCleanWithParams (const GEOSGeometry *input, const GEOSCoverageCleanParams *params)
GEOSGeometry * | GEOSCoverageClean (const GEOSGeometry *input)
Noding and Polygonization
Functions computing noding of lines, and forming noded lines into polygons.
GEOSGeometry * | GEOSNode (const GEOSGeometry *g)
GEOSGeometry * | GEOSPolygonize (const GEOSGeometry *const geoms[], unsigned int ngeoms)
GEOSGeometry * | GEOSPolygonize_valid (const GEOSGeometry *const geoms[], unsigned int ngeoms)
GEOSGeometry * | GEOSPolygonizer_getCutEdges (const GEOSGeometry *const geoms[], unsigned int ngeoms)
GEOSGeometry * | GEOSPolygonize_full (const GEOSGeometry *input, GEOSGeometry **cuts, GEOSGeometry **dangles, GEOSGeometry **invalid)
GEOSGeometry * | GEOSBuildArea (const GEOSGeometry *g)
Processing
Functions performing various geometric processes.
GEOSGeometry * | GEOSDensify (const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSLineMerge (const GEOSGeometry *g)
GEOSGeometry * | GEOSLineMergeDirected (const GEOSGeometry *g)
GEOSGeometry * | GEOSLineSubstring (const GEOSGeometry *g, double start_fraction, double end_fraction)
GEOSGeometry * | GEOSReverse (const GEOSGeometry *g)
GEOSGeometry * | GEOSSimplify (const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSTopologyPreserveSimplify (const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSGeom_extractUniquePoints (const GEOSGeometry *g)
int | GEOSHilbertCode (const GEOSGeometry *geom, const GEOSGeometry *extent, unsigned int level, unsigned int *code)
GEOSGeometry * | GEOSGeom_transformXY (const GEOSGeometry *g, GEOSTransformXYCallback callback, void *userdata)
GEOSGeometry * | GEOSGeom_transformXYZ (const GEOSGeometry *g, GEOSTransformXYZCallback callback, void *userdata)
GEOSGeometry * | GEOSSnap (const GEOSGeometry *input, const GEOSGeometry *snap_target, double tolerance)
GEOSGeometry * | GEOSGeom_setPrecision (const GEOSGeometry *g, double gridSize, int flags)
Spatial Predicates
Functions computing binary spatial predicates using the DE-9IM topology model.
char | GEOSDisjoint (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSTouches (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSIntersects (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSCrosses (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSWithin (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSContains (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSOverlaps (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSEquals (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSCovers (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSCoveredBy (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSEqualsExact (const GEOSGeometry *g1, const GEOSGeometry *g2, double tolerance)
char | GEOSEqualsIdentical (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSRelatePattern (const GEOSGeometry *g1, const GEOSGeometry *g2, const char *imPattern)
char * | GEOSRelate (const GEOSGeometry *g1, const GEOSGeometry *g2)
char | GEOSRelatePatternMatch (const char *intMatrix, const char *imPattern)
char * | GEOSRelateBoundaryNodeRule (const GEOSGeometry *g1, const GEOSGeometry *g2, int bnr)
Prepared Geometry

A GEOSPreparedGeometry is a wrapper around GEOSGeometry that includes spatial indexing on the edges of the geometry. This allows spatial predicates to evaluate much faster, so for cases in which the same base geometry will be used over and over again for predicate tests, wrapping it in a GEOSPreparedGeometry is a best practice.

Prepared Geometry supports some binary spatial predicates and distance calculations.

const GEOSPreparedGeometry * | GEOSPrepare (const GEOSGeometry *g)
void | GEOSPreparedGeom_destroy (const GEOSPreparedGeometry *g)
char | GEOSPreparedContains (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedContainsXY (const GEOSPreparedGeometry *pg1, double x, double y)
char | GEOSPreparedContainsProperly (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedCoveredBy (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedCovers (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedCrosses (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedDisjoint (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedIntersects (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedIntersectsXY (const GEOSPreparedGeometry *pg1, double x, double y)
char | GEOSPreparedOverlaps (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedTouches (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedWithin (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char * | GEOSPreparedRelate (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
char | GEOSPreparedRelatePattern (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2, const char *imPattern)
GEOSCoordSequence * | GEOSPreparedNearestPoints (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2)
int | GEOSPreparedDistance (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2, double *dist)
char | GEOSPreparedDistanceWithin (const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2, double dist)
STRtree
A GEOSSTRtree is a R-tree spatial index structure for two dimensional data. It uses the Sort-Tile-Recursive packing algorithm.
GEOSSTRtree * | GEOSSTRtree_create (size_t nodeCapacity)
int | GEOSSTRtree_build (GEOSSTRtree *tree)
void | GEOSSTRtree_insert (GEOSSTRtree *tree, const GEOSGeometry *g, void *item)
void | GEOSSTRtree_query (GEOSSTRtree *tree, const GEOSGeometry *g, GEOSQueryCallback callback, void *userdata)
const GEOSGeometry * | GEOSSTRtree_nearest (GEOSSTRtree *tree, const GEOSGeometry *geom)
const void * | GEOSSTRtree_nearest_generic (GEOSSTRtree *tree, const void *item, const GEOSGeometry *itemEnvelope, GEOSDistanceCallback distancefn, void *userdata)
void | GEOSSTRtree_iterate (GEOSSTRtree *tree, GEOSQueryCallback callback, void *userdata)
char | GEOSSTRtree_remove (GEOSSTRtree *tree, const GEOSGeometry *g, void *item)
void | GEOSSTRtree_destroy (GEOSSTRtree *tree)
Geometric Algorithms
Functions to compute basic geometric algorithms.
int | GEOSSegmentIntersection (double ax0, double ay0, double ax1, double ay1, double bx0, double by0, double bx1, double by1, double *cx, double *cy)
int | GEOSOrientationIndex (double Ax, double Ay, double Bx, double By, double Px, double Py)
WKT Reader and Writer
Functions for doing WKT I/O.
GEOSWKTReader * | GEOSWKTReader_create (void)
void | GEOSWKTReader_destroy (GEOSWKTReader *reader)
GEOSGeometry * | GEOSWKTReader_read (GEOSWKTReader *reader, const char *wkt)
void | GEOSWKTReader_setFixStructure (GEOSWKTReader *reader, char doFix)
GEOSWKTWriter * | GEOSWKTWriter_create (void)
void | GEOSWKTWriter_destroy (GEOSWKTWriter *writer)
char * | GEOSWKTWriter_write (GEOSWKTWriter *writer, const GEOSGeometry *g)
void | GEOSWKTWriter_setTrim (GEOSWKTWriter *writer, char trim)
void | GEOSWKTWriter_setRoundingPrecision (GEOSWKTWriter *writer, int precision)
void | GEOSWKTWriter_setOutputDimension (GEOSWKTWriter *writer, int dim)
int | GEOSWKTWriter_getOutputDimension (GEOSWKTWriter *writer)
void | GEOSWKTWriter_setOld3D (GEOSWKTWriter *writer, int useOld3D)
WKB Reader and Writer
Functions for doing WKB I/O.
GEOSWKBReader * | GEOSWKBReader_create (void)
void | GEOSWKBReader_destroy (GEOSWKBReader *reader)
void | GEOSWKBReader_setFixStructure (GEOSWKBReader *reader, char doFix)
GEOSGeometry * | GEOSWKBReader_read (GEOSWKBReader *reader, const unsigned char *wkb, size_t size)
GEOSGeometry * | GEOSWKBReader_readHEX (GEOSWKBReader *reader, const unsigned char *hex, size_t size)
GEOSWKBWriter * | GEOSWKBWriter_create (void)
void | GEOSWKBWriter_destroy (GEOSWKBWriter *writer)
unsigned char * | GEOSWKBWriter_write (GEOSWKBWriter *writer, const GEOSGeometry *g, size_t *size)
unsigned char * | GEOSWKBWriter_writeHEX (GEOSWKBWriter *writer, const GEOSGeometry *g, size_t *size)
int | GEOSWKBWriter_getOutputDimension (const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setOutputDimension (GEOSWKBWriter *writer, int newDimension)
int | GEOSWKBWriter_getByteOrder (const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setByteOrder (GEOSWKBWriter *writer, int byteOrder)
int | GEOSWKBWriter_getFlavor (const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setFlavor (GEOSWKBWriter *writer, int flavor)
char | GEOSWKBWriter_getIncludeSRID (const GEOSWKBWriter *writer)
void | GEOSWKBWriter_setIncludeSRID (GEOSWKBWriter *writer, const char writeSRID)
GeoJSON Reader and Writer
Functions for doing GeoJSON I/O.
GEOSGeoJSONReader * | GEOSGeoJSONReader_create (void)
void | GEOSGeoJSONReader_destroy (GEOSGeoJSONReader *reader)
GEOSGeometry * | GEOSGeoJSONReader_readGeometry (GEOSGeoJSONReader *reader, const char *geojson)
GEOSGeoJSONWriter * | GEOSGeoJSONWriter_create (void)
void | GEOSGeoJSONWriter_destroy (GEOSGeoJSONWriter *writer)
char * | GEOSGeoJSONWriter_writeGeometry (GEOSGeoJSONWriter *writer, const GEOSGeometry *g, int indent)
void | GEOSGeoJSONWriter_setOutputDimension (GEOSGeoJSONWriter *writer, int dim)
int | GEOSGeoJSONWriter_getOutputDimension (GEOSGeoJSONWriter *writer)
DEPRECATED
Deprecated Functions. See description for replacement.
GEOSGeometry * | GEOSSingleSidedBuffer (const GEOSGeometry *g, double width, int quadsegs, int joinStyle, double mitreLimit, int leftSide)
GEOSGeometry * | GEOSSingleSidedBuffer_r (GEOSContextHandle_t handle, const GEOSGeometry *g, double width, int quadsegs, int joinStyle, double mitreLimit, int leftSide)
GEOSContextHandle_t | initGEOS_r (GEOSMessageHandler notice_function, GEOSMessageHandler error_function)
void | finishGEOS_r (GEOSContextHandle_t handle)
GEOSGeometry * | GEOSGeomFromWKT_r (GEOSContextHandle_t handle, const char *wkt)
char * | GEOSGeomToWKT_r (GEOSContextHandle_t handle, const GEOSGeometry *g)
int | GEOS_getWKBOutputDims_r (GEOSContextHandle_t handle)
int | GEOS_setWKBOutputDims_r (GEOSContextHandle_t handle, int newDims)
int | GEOS_getWKBByteOrder_r (GEOSContextHandle_t handle)
int | GEOS_setWKBByteOrder_r (GEOSContextHandle_t handle, int byteOrder)
GEOSGeometry * | GEOSGeomFromWKB_buf_r (GEOSContextHandle_t handle, const unsigned char *wkb, size_t size)
unsigned char * | GEOSGeomToWKB_buf_r (GEOSContextHandle_t handle, const GEOSGeometry *g, size_t *size)
GEOSGeometry * | GEOSGeomFromHEX_buf_r (GEOSContextHandle_t handle, const unsigned char *hex, size_t size)
unsigned char * | GEOSGeomToHEX_buf_r (GEOSContextHandle_t handle, const GEOSGeometry *g, size_t *size)
GEOSGeometry * | GEOSGeomFromWKT (const char *wkt)
char * | GEOSGeomToWKT (const GEOSGeometry *g)
int | GEOS_getWKBOutputDims (void)
int | GEOS_setWKBOutputDims (int newDims)
int | GEOS_getWKBByteOrder (void)
int | GEOS_setWKBByteOrder (int byteOrder)
GEOSGeometry * | GEOSGeomFromWKB_buf (const unsigned char *wkb, size_t size)
unsigned char * | GEOSGeomToWKB_buf (const GEOSGeometry *g, size_t *size)
GEOSGeometry * | GEOSGeomFromHEX_buf (const unsigned char *hex, size_t size)
unsigned char * | GEOSGeomToHEX_buf (const GEOSGeometry *g, size_t *size)
GEOSGeometry * | GEOSUnionCascaded (const GEOSGeometry *g)
GEOSGeometry * | GEOSUnionCascaded_r (GEOSContextHandle_t handle, const GEOSGeometry *g)

## Geometric Constructions

Functions for computing geometric constructions.
enum | GEOSPolygonHullParameterModes { GEOSHULL_PARAM_VERTEX_RATIO = 1 , GEOSHULL_PARAM_AREA_RATIO = 2 }
enum | GEOSVoronoiFlags { GEOS_VORONOI_ONLY_EDGES = 1 , GEOS_VORONOI_PRESERVE_ORDER = 2 }
GEOSGeometry * | GEOSEnvelope (const GEOSGeometry *g)
GEOSGeometry * | GEOSBoundary (const GEOSGeometry *g)
GEOSGeometry * | GEOSConvexHull (const GEOSGeometry *g)
GEOSGeometry * | GEOSConcaveHull (const GEOSGeometry *g, double ratio, unsigned int allowHoles)
GEOSGeometry * | GEOSConcaveHullByLength (const GEOSGeometry *g, double length, unsigned int allowHoles)
GEOSGeometry * | GEOSConcaveHullOfPolygons (const GEOSGeometry *g, double lengthRatio, unsigned int isTight, unsigned int isHolesAllowed)
GEOSGeometry * | GEOSPolygonHullSimplify (const GEOSGeometry *g, unsigned int isOuter, double vertexNumFraction)
GEOSGeometry * | GEOSPolygonHullSimplifyMode (const GEOSGeometry *g, unsigned int isOuter, unsigned int parameterMode, double parameter)
GEOSGeometry * | GEOSMinimumRotatedRectangle (const GEOSGeometry *g)
GEOSGeometry * | GEOSMaximumInscribedCircle (const GEOSGeometry *g, double tolerance)
GEOSGeometry * | GEOSLargestEmptyCircle (const GEOSGeometry *obstacles, const GEOSGeometry *boundary, double tolerance)
GEOSGeometry * | GEOSMinimumWidth (const GEOSGeometry *g)
GEOSGeometry * | GEOSPointOnSurface (const GEOSGeometry *g)
GEOSGeometry * | GEOSGetCentroid (const GEOSGeometry *g)
GEOSGeometry * | GEOSMinimumBoundingCircle (const GEOSGeometry *g, double *radius, GEOSGeometry **center)
GEOSGeometry * | GEOSDelaunayTriangulation (const GEOSGeometry *g, double tolerance, int onlyEdges)
GEOSGeometry * | GEOSConstrainedDelaunayTriangulation (const GEOSGeometry *g)
GEOSGeometry * | GEOSVoronoiDiagram (const GEOSGeometry *g, const GEOSGeometry *env, double tolerance, int flags)

## Clustering

Functions for clustering geometries
GEOSClusterInfo * | GEOSClusterDBSCAN (const GEOSGeometry *g, double eps, unsigned minPoints)
| GEOSClusterDBSCAN.
GEOSClusterInfo * | GEOSClusterGeometryDistance (const GEOSGeometry *g, double d)
| GEOSClusterGeometryDistance.
GEOSClusterInfo * | GEOSClusterGeometryIntersects (const GEOSGeometry *g)
| GEOSClusterGeometryIntersects.
GEOSClusterInfo * | GEOSClusterEnvelopeDistance (const GEOSGeometry *g, double d)
| GEOSClusterEnvelopeDistance.
GEOSClusterInfo * | GEOSClusterEnvelopeIntersects (const GEOSGeometry *g)
| GEOSClusterEnvelopeIntersects.
size_t | GEOSClusterInfo_getNumClusters (const GEOSClusterInfo *clusters)
| GEOSClusterInfo_getNumClusters.
size_t | GEOSClusterInfo_getClusterSize (const GEOSClusterInfo *clusters, size_t i)
| GEOSClusterInfo_getSize.
size_t * | GEOSClusterInfo_getClustersForInputs (const GEOSClusterInfo *clusters)
| GEOSClusterInfo_getClustersForInputs.
const size_t * | GEOSClusterInfo_getInputsForClusterN (const GEOSClusterInfo *clusters, size_t i)
| GEOSClusterInfo_getInputsForClusterN.
void | GEOSClusterInfo_destroy (GEOSClusterInfo *clusters)
| GEOSClusterInfo_destroy.

## Detailed Description

C API for the GEOS geometry algorithms library.

The C API is the supported API for using GEOS in your application/library/etc. The C API is kept stable, and deprecated function signatures are kept available over a long time period to allow transition time. While the C++ API is available, it may change at any time, and the ABI may not be stable between versions.

Important programming notes:

- Call initGEOS() before using the library functions.
- Call finishGEOS() when finished using the library.
- To avoid memory leaks, call GEOSGeom_destroy() on GEOSGeometry objects, and call GEOSFree() on returned char * strings and byte buffers (unless marked const).
- Functions ending with _r are thread safe (reentrant); see details in https://libgeos.org/development/rfcs/rfc03. To avoid accidental use of non-reentrant functions, define GEOS_USE_ONLY_R_API before including geos_c.h.

## Typedef Documentation

## GEOSBufferParams

typedef struct GEOSBufParams_t GEOSBufferParams

Parameter object for buffering.

See also
  GEOSBufferParams_create()
  GEOSBufferParams_destroy()

## GEOSClusterInfo

typedef struct GEOSClusterInfo_t GEOSClusterInfo

Object containing information about cluster of geometries.

See also
  GEOSClusterInfo_destroy()

## GEOSContextHandle_t

typedef struct GEOSContextHandle_HS* GEOSContextHandle_t

Type returned by GEOS_init_r(), for use with the functions ending in _r (the reentrant API).

Contexts must only be used from a single thread at a time.

## GEOSContextInterruptCallback

typedef int GEOSContextInterruptCallback(void *)

Callback function for use in interruption. The callback will be invoked at each possible interruption point and can be used to request interruption by returning a non-zero value.

See also
  GEOSContext_setInterruptCallback_r

Since
  3.14

## GEOSCoordSequence

typedef struct GEOSCoordSeq_t GEOSCoordSequence

Coordinate sequence type representing fixed-size lists of coordinates. Contains the list of vertices defining the location of a GEOSGeometry.

See also
  GEOSCoordSeq_create()
  GEOSCoordSeq_destroy()

## GEOSCoverageCleanParams

typedef struct GEOSCoverageCleanParams_t GEOSCoverageCleanParams

Parameter object for coverage cleaning options.

See also
  GEOSCoverageCleanParams_create()
  GEOSCoverageCleanParams_destroy()

## GEOSDistanceCallback

typedef int(* GEOSDistanceCallback) (const void *item1, const void *item2, double *distance, void *userdata)

Callback function for use in spatial index nearest neighbor calculations. Allows custom distance to be calculated between items in the index. Is passed two items, and sets the calculated distance between the items into the distance pointer. Extra data for the calculation can be passed via the userdata.

Parameters

  item1 | first of the pair of items to calculate distance between
  item2 | second of the pair of items to calculate distance between
  distance | the distance between the items here
  userdata | extra data for the calculation

Returns
  1 if distance calculation succeeds, 0 otherwise

See also
  GEOSSTRtree_nearest_generic
  GEOSSTRtree_iterate

## GEOSGeoJSONReader

typedef struct GEOSGeoJSONReader_t GEOSGeoJSONReader

Reader object to read GeoJSON format and construct a Geometry.

See also
  GEOSGeoJSONReader_create
  GEOSGeoJSONReader_create_r

## GEOSGeoJSONWriter

typedef struct GEOSGeoJSONWriter_t GEOSGeoJSONWriter

Writer object to turn a Geometry into GeoJSON.

See also
  GEOSGeoJSONReader_create
  GEOSGeoJSONReader_create_r

## GEOSGeometry

typedef struct GEOSGeom_t GEOSGeometry

The generic type for a geometry. A geometry can be a Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, or GeometryCollection. The geometry type can be read with GEOSGeomTypeId. Most functions in GEOS have GEOSGeometry * as either a parameter or a return type.

See also
  GEOSGeom_createPoint
  GEOSGeom_createLineString
  GEOSGeom_createPolygon
  GEOSGeom_createCollection
  GEOSGeom_destroy

## GEOSInterruptCallback

typedef void GEOSInterruptCallback(void)

Callback function for use in interruption. The callback will be invoked at each possible interruption point and can be used to request interruption.

See also
  GEOS_interruptRegisterCallback
  GEOS_interruptRequest
  GEOS_interruptCancel

## GEOSMakeValidParams

typedef struct GEOSMakeValidParams_t GEOSMakeValidParams

Parameter object for validity enforcement.

See also
  GEOSMakeValidParams_create()
  GEOSMakeValidParams_destroy()

## GEOSMessageHandler

typedef void(* GEOSMessageHandler) (GEOS_PRINTF_FORMAT const char *fmt,...) GEOS_PRINTF_FORMAT_ATTR(1

Callback function for passing GEOS error messages to parent process.

Set the GEOSMessageHandler function for error and notice messages using initGEOS or initGEOS_r.

Parameters

  fmt | the message format template

## GEOSMessageHandler_r

typedef void typedef void(* GEOSMessageHandler_r) (const char *message, void *userdata)

A GEOS message handler function.

Parameters

  message | the message contents
  userdata | the user data pointer that was passed to GEOS when registering this message handler.

See also
  GEOSContext_setErrorMessageHandler
  GEOSContext_setNoticeMessageHandler

## GEOSPreparedGeometry

typedef struct GEOSPrepGeom_t GEOSPreparedGeometry

Prepared geometry type.

See also
  GEOSPrepare()
  GEOSPreparedGeom_destroy()

## GEOSQueryCallback

typedef void(* GEOSQueryCallback) (void *item, void *userdata)

Callback function for use in spatial index search calls. Pass into the query function and handle query results as the index returns them.

See also
  GEOSSTRtree_query

## GEOSSTRtree

typedef struct GEOSSTRtree_t GEOSSTRtree

STRTree index.

See also
  GEOSSTRtree_create()
  GEOSSTRtree_destroy()

## GEOSTransformXYCallback

typedef int(* GEOSTransformXYCallback) (double *x, double *y, void *userdata)

Callback function for use in GEOSGeom_transformXY. Allows custom function to be applied to x and y values for each coordinate in a geometry. Z and M values are unchanged by this function. Extra data for the calculation can be passed via the userdata.

Parameters

  x | coordinate value to be updated
  y | coordinate value to be updated
  userdata | extra data for the calculation

Returns
  1 if calculation succeeded, 0 on failure

## GEOSTransformXYZCallback

typedef int(* GEOSTransformXYZCallback) (double *x, double *y, double *z, void *userdata)

Callback function for use in GEOSGeom_transformXYZ. Allows custom function to be applied to x, y and z values for each coordinate in a geometry. M values are unchanged by this function. Extra data for the calculation can be passed via the userdata.

Parameters

  x | coordinate value to be updated
  y | coordinate value to be updated
  z | coordinate value to be updated
  userdata | extra data for the calculation

Returns
  1 if calculation succeeded, 0 on failure

## GEOSWKBReader

typedef struct GEOSWKBReader_t GEOSWKBReader

Reader object to read Well-Known Binary (WKB) format and construct Geometry.

See also
  GEOSWKBReader_create
  GEOSWKBReader_create_r

## GEOSWKBWriter

typedef struct GEOSWKBWriter_t GEOSWKBWriter

Writer object to turn Geometry into Well-Known Binary (WKB).

See also
  GEOSWKBWriter_create
  GEOSWKBWriter_create_r

## GEOSWKTReader

typedef struct GEOSWKTReader_t GEOSWKTReader

Reader object to read Well-Known Text (WKT) format and construct Geometry.

See also
  GEOSWKTReader_create
  GEOSWKTReader_create_r

## GEOSWKTWriter

typedef struct GEOSWKTWriter_t GEOSWKTWriter

Writer object to turn Geometry into Well-Known Text (WKT).

See also
  GEOSWKTWriter_create
  GEOSWKTWriter_create_r

## Enumeration Type Documentation

## GEOSBufCapStyles

enum GEOSBufCapStyles

Cap styles control the ends of buffered lines.

See also
  GEOSBuffer

Enumerator
GEOSBUF_CAP_ROUND | End is rounded, with end point of original line in the centre of the round cap.
GEOSBUF_CAP_FLAT | End is flat, with end point of original line at the end of the buffer
GEOSBUF_CAP_SQUARE | End is flat, with end point of original line in the middle of a square enclosing that point

## GEOSBufJoinStyles

enum GEOSBufJoinStyles

Join styles control the buffer shape at bends in a line.

See also
  GEOSBuffer

Enumerator
GEOSBUF_JOIN_ROUND | Join is rounded, essentially each line is terminated in a round cap. Form round corner.
GEOSBUF_JOIN_MITRE | Join is flat, with line between buffer edges, through the join point. Forms flat corner.
GEOSBUF_JOIN_BEVEL | Join is the point at which the two buffer edges intersect. Forms sharp corner.

## GEOSGeomTypes

enum GEOSGeomTypes

Geometry type number, used by functions returning or consuming geometry types.

See also
  GEOSGeomType
  GEOSGeomTypeId

Enumerator
GEOS_POINT | Point
GEOS_LINESTRING | Linestring
GEOS_LINEARRING | Linear ring, used within polygons
GEOS_POLYGON | Polygon
GEOS_MULTIPOINT | Multipoint, a homogeneous collection of points
GEOS_MULTILINESTRING | Multilinestring, a homogeneous collection of linestrings
GEOS_MULTIPOLYGON | Multipolygon, a homogeneous collection of polygons
GEOS_GEOMETRYCOLLECTION | Geometry collection, a heterogeneous collection of geometry

## GEOSMakeValidMethods

enum GEOSMakeValidMethods

Algorithm to use when repairing invalid geometries.

See also
  GEOSMakeValidWithParams

Enumerator
GEOS_MAKE_VALID_LINEWORK | Original method, combines all rings into a set of noded lines and then extracts valid polygons from that linework.
GEOS_MAKE_VALID_STRUCTURE | Structured method, first makes all rings valid then merges shells and subtracts holes from shells to generate valid result. Assumes that holes and shells are correctly categorized.

## GEOSOverlapMerge

enum GEOSOverlapMerge

Overlap repair strategies.

See also
  GEOSCoverageCleanParams_setOverlapMergeStrategy

Enumerator
GEOS_MERGE_LONGEST_BORDER | Merge strategy that chooses polygon with longest common border
GEOS_MERGE_MAX_AREA | Merge strategy that chooses polygon with maximum area
GEOS_MERGE_MIN_AREA | Merge strategy that chooses polygon with minimum area
GEOS_MERGE_MIN_INDEX | Merge strategy that chooses polygon with smallest input index

## GEOSPolygonHullParameterModes

enum GEOSPolygonHullParameterModes

Controls the behavior of the GEOSPolygonHullSimplify parameter.

Enumerator
GEOSHULL_PARAM_VERTEX_RATIO | Fraction of input vertices retained
GEOSHULL_PARAM_AREA_RATIO | Ratio of simplified hull area to input area

## GEOSPrecisionRules

enum GEOSPrecisionRules

Controls the behavior of GEOSGeom_setPrecision() when altering the precision of a geometry.

Enumerator
GEOS_PREC_VALID_OUTPUT | The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed.
GEOS_PREC_NO_TOPO | Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called "GEOS_PREC_POINTWISE" - the current name is historical.)
GEOS_PREC_KEEP_COLLAPSED | Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed.

## GEOSRelateBoundaryNodeRules

enum GEOSRelateBoundaryNodeRules

Controls the behavior of the result of GEOSRelate when returning DE9IM results for two geometries.

Enumerator
GEOSRELATE_BNR_MOD2 | See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2()
GEOSRELATE_BNR_OGC | Same as GEOSRELATE_BNR_MOD2
GEOSRELATE_BNR_ENDPOINT | See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint()
GEOSRELATE_BNR_MULTIVALENT_ENDPOINT | See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint()
GEOSRELATE_BNR_MONOVALENT_ENDPOINT | See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint()

## GEOSValidFlags

enum GEOSValidFlags

Change behaviour of validity testing in GEOSisValidDetail

Enumerator
GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE | Allow self-touching rings to form a hole in a polygon.

## GEOSVoronoiFlags

enum GEOSVoronoiFlags

Change behaviour of GEOSVoronoiDiagram

Enumerator
GEOS_VORONOI_ONLY_EDGES | Return only edges of the Voronoi cells, as a MultiLineString
GEOS_VORONOI_PRESERVE_ORDER | Preserve order of inputs, such that the nth cell in the result corresponds to the nth vertex in the input. If this cannot be done, such as for inputs that contain repeated points, GEOSVoronoiDiagram will return NULL.

## GEOSWKBByteOrders

enum GEOSWKBByteOrders

Well-known binary byte orders used when writing to WKB.

See also
  GEOSWKBWriter_setByteOrder

Enumerator
GEOS_WKB_XDR | Big Endian
GEOS_WKB_NDR | Little Endian

## GEOSWKBFlavors

enum GEOSWKBFlavors

Well-known binary flavors to use when writing to WKB. ISO flavour is more standard. Extended flavour supports 3D and SRID embedding. GEOS reads both transparently.

See also
  GEOSWKBWriter_setFlavor

Enumerator
GEOS_WKB_EXTENDED | Extended
GEOS_WKB_ISO | ISO

## Function Documentation

## finishGEOS()

void finishGEOS | ( | void |  | ) |

extern

For non-reentrant code, call when all GEOS operations are complete, cleans up global resources.

Since
  3.1

## finishGEOS_r()

void finishGEOS_r | ( | GEOSContextHandle_t | handle | ) |

extern

Deprecated
  in 3.5.0, replaced by GEOS_finish_r()

## GEOS_finish_r()

void GEOS_finish_r | ( | GEOSContextHandle_t | handle | ) |

extern

Free the memory associated with a GEOSContextHandle_t when you are finished calling GEOS functions.

Parameters

  handle | to be freed

Since
  3.5

## GEOS_getWKBByteOrder()

int GEOS_getWKBByteOrder | ( | void |  | ) |

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_getByteOrder()

## GEOS_getWKBByteOrder_r()

int GEOS_getWKBByteOrder_r | ( | GEOSContextHandle_t | handle | ) |

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_getByteOrder_r()

## GEOS_getWKBOutputDims()

int GEOS_getWKBOutputDims | ( | void |  | ) |

extern

Deprecated
  use GEOSWKBWriter and GEOS_getWKBOutputDims()

## GEOS_getWKBOutputDims_r()

int GEOS_getWKBOutputDims_r | ( | GEOSContextHandle_t | handle | ) |

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_getOutputDimension_r()

## GEOS_init_r()

GEOSContextHandle_t GEOS_init_r | ( | void |  | ) |

extern

Allocate and initialize a context. Pass this context as the first argument when calling other *_r functions. Contexts must only be used from a single thread at a time.

Returns
  a new GEOS context.

Since
  3.5

## GEOS_interruptCancel()

void GEOS_interruptCancel | ( | void |  | ) |

extern

Cancel a pending interruption request

Since
  3.4

## GEOS_interruptRegisterCallback()

GEOSInterruptCallback * GEOS_interruptRegisterCallback | ( | GEOSInterruptCallback * | cb | ) |

extern

Register a function to be called when a possible interruption point is reached on any thread. The function may be used to request interruption.

Parameters

  cb | Callback function to invoke

Returns
  the previously registered callback, or NULL

See also
  GEOSInterruptCallback
  GEOSContext_setInterruptCallback_r

Since
  3.4

## GEOS_interruptRequest()

void GEOS_interruptRequest | ( | void |  | ) |

extern

Request safe interruption of operations. The next thread to check for an interrupt will be interrupted. To request interruption of a specific thread, instead call GEOS_interruptThread() from a callback executed by that thread.

Since
  3.4

## GEOS_interruptThread()

void GEOS_interruptThread | ( | void |  | ) |

extern

Interrupt the current thread.

Since
  3.14

## GEOS_printDouble()

int GEOS_printDouble | ( | double | d,
|  | unsigned int | precision,
|  | char * | result )

extern

Print the shortest representation of a double. Non-zero absolute values that are <1e-4 and >=1e+17 are formatted using scientific notation, and other values are formatted with positional notation with precision used for the max digits after decimal point.

Parameters

  d | The number to format.
  precision | The desired precision.
  result | The buffer to write the result to, with a suggested size 28.

Returns
  the length of the written string.

## GEOS_setWKBByteOrder()

int GEOS_setWKBByteOrder | ( | int | byteOrder | ) |

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_setByteOrder()

## GEOS_setWKBByteOrder_r()

int GEOS_setWKBByteOrder_r | ( | GEOSContextHandle_t | handle,
|  | int | byteOrder )

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_setByteOrder_r()

## GEOS_setWKBOutputDims()

int GEOS_setWKBOutputDims | ( | int | newDims | ) |

extern

Deprecated
  use GEOSWKBWriter and GEOS_setWKBOutputDims()

## GEOS_setWKBOutputDims_r()

int GEOS_setWKBOutputDims_r | ( | GEOSContextHandle_t | handle,
|  | int | newDims )

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_setOutputDimension_r()

## GEOSArea()

int GEOSArea | ( | const GEOSGeometry * | g,
|  | double * | area )

extern

Calculate the area of a geometry.

Parameters

  [in] | g | Input geometry
  [out] | area | Pointer to be filled in with area result

Returns
  1 on success, 0 on exception.

Since
  2.2

## GEOSArea_r()

int GEOSArea_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | area )

extern

See also
  GEOSArea

## GEOSBoundary()

GEOSGeometry * GEOSBoundary | ( | const GEOSGeometry * | g | ) |

extern

Returns the "boundary" of a geometry, as defined by the DE9IM:

- the boundary of a polygon is the linear rings dividing the exterior from the interior
- the boundary of a linestring is the end points
- the boundary of a point is the point

Parameters

  g | The input geometry

Returns
  A newly allocated geometry of the boundary. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSBoundary_r()

GEOSGeometry * GEOSBoundary_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSBoundary

## GEOSBuffer()

GEOSGeometry * GEOSBuffer | ( | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs )

extern

Buffer a geometry.

Parameters

  g | The input geometry to be buffered.
  width | The distance by which to expand the geometry (or contract) if the value is negative.
  quadsegs | The number of segments per quadrant to generate. More segments provides a more "precise" buffer at the expense of size.

Returns
  A GEOSGeometry of the buffered result. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSBuffer_r()

GEOSGeometry * GEOSBuffer_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs )

extern

See also
  GEOSBuffer

## GEOSBufferParams_create()

GEOSBufferParams * GEOSBufferParams_create | ( | void |  | ) |

extern

Create a default GEOSBufferParams object for controlling the shape of buffered generated by GEOSBuffer.

Returns
  A newly allocated GEOSBufferParams. NULL on exception. Caller is responsible for freeing with GEOSBufferParams_destroy().

Since
  3.3

## GEOSBufferParams_create_r()

GEOSBufferParams * GEOSBufferParams_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSBufferParams_create

## GEOSBufferParams_destroy()

void GEOSBufferParams_destroy | ( | GEOSBufferParams * | parms | ) |

extern

Destroy a GEOSBufferParams and free all associated memory.

Parameters

  parms | The object to destroy.

Since
  3.3

## GEOSBufferParams_destroy_r()

void GEOSBufferParams_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSBufferParams * | parms )

extern

See also
  GEOSBufferParams_destroy

## GEOSBufferParams_setEndCapStyle()

int GEOSBufferParams_setEndCapStyle | ( | GEOSBufferParams * | p,
|  | int | style )

extern

Set the end cap type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufCapStyles.

Returns
  0 on exception, 1 on success.

Since
  3.3

## GEOSBufferParams_setEndCapStyle_r()

int GEOSBufferParams_setEndCapStyle_r | ( | GEOSContextHandle_t | handle,
|  | GEOSBufferParams * | p,
|  | int | style )

extern

See also
  GEOSBufferParams_setEndCapStyle

## GEOSBufferParams_setJoinStyle()

int GEOSBufferParams_setJoinStyle | ( | GEOSBufferParams * | p,
|  | int | joinStyle )

extern

Set the join type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufJoinStyles.

Returns
  0 on exception, 1 on success.

Since
  3.3

## GEOSBufferParams_setJoinStyle_r()

int GEOSBufferParams_setJoinStyle_r | ( | GEOSContextHandle_t | handle,
|  | GEOSBufferParams * | p,
|  | int | joinStyle )

extern

See also
  GEOSBufferParams_setJoinStyle

## GEOSBufferParams_setMitreLimit()

int GEOSBufferParams_setMitreLimit | ( | GEOSBufferParams * | p,
|  | double | mitreLimit )

extern

Set the mitre limit of a GEOSBufferParams to the desired size. For acute angles, a mitre join can extend very very far from the input geometry, which is probably not desired. The mitre limit places an upper bound on that.

Parameters

  p | The GEOSBufferParams to operate on
  mitreLimit | The limit to set

Returns
  0 on exception, 1 on success.

Since
  3.3

## GEOSBufferParams_setMitreLimit_r()

int GEOSBufferParams_setMitreLimit_r | ( | GEOSContextHandle_t | handle,
|  | GEOSBufferParams * | p,
|  | double | mitreLimit )

extern

See also
  GEOSBufferParams_setMitreLimit

## GEOSBufferParams_setQuadrantSegments()

int GEOSBufferParams_setQuadrantSegments | ( | GEOSBufferParams * | p,
|  | int | quadSegs )

extern

Set the number of segments to use to stroke each quadrant of circular arcs generated by the buffering process. More segments means a smoother output, but with larger size.

Parameters

  p | The GEOSBufferParams to operate on
  quadSegs | Number of segments per quadrant

Returns
  0 on exception, 1 on success.

Since
  3.3

## GEOSBufferParams_setQuadrantSegments_r()

int GEOSBufferParams_setQuadrantSegments_r | ( | GEOSContextHandle_t | handle,
|  | GEOSBufferParams * | p,
|  | int | quadSegs )

extern

See also
  GEOSBufferParams_setQuadrantSegments

## GEOSBufferParams_setSingleSided()

int GEOSBufferParams_setSingleSided | ( | GEOSBufferParams * | p,
|  | int | singleSided )

extern

Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line.

See also
  geos::operation::buffer::BufferParameters::setSingleSided

Parameters

  p | The GEOSBufferParams to operate on
  singleSided | Set to 1 for single-sided output 0 otherwise

Returns
  0 on exception, 1 on success.

Since
  3.3

## GEOSBufferParams_setSingleSided_r()

int GEOSBufferParams_setSingleSided_r | ( | GEOSContextHandle_t | handle,
|  | GEOSBufferParams * | p,
|  | int | singleSided )

extern

See also
  GEOSBufferParams_setSingleSided

## GEOSBufferWithParams()

GEOSGeometry * GEOSBufferWithParams | ( | const GEOSGeometry * | g,
|  | const GEOSBufferParams * | p,
|  | double | width )

extern

Generates a buffer using the special parameters in the GEOSBufferParams

Parameters

  g | The geometry to buffer
  p | The parameters to apply to the buffer process
  width | The buffer distance

Returns
  The buffered geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSBufferWithParams_r()

GEOSGeometry * GEOSBufferWithParams_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | const GEOSBufferParams * | p,
|  | double | width )

extern

See also
  GEOSBufferWithParams

## GEOSBufferWithStyle()

GEOSGeometry * GEOSBufferWithStyle | ( | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs,
|  | int | endCapStyle,
|  | int | joinStyle,
|  | double | mitreLimit )

extern

Generate a buffer using the provided style parameters.

Parameters

  g | The geometry to buffer
  width | Width of the buffer
  quadsegs | Number of segments per quadrant
  endCapStyle | See GEOSBufCapStyles
  joinStyle | See GEOSBufJoinStyles
  mitreLimit | See GEOSBufferParams_setMitreLimit

Returns
  The buffered geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.2

## GEOSBufferWithStyle_r()

GEOSGeometry * GEOSBufferWithStyle_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs,
|  | int | endCapStyle,
|  | int | joinStyle,
|  | double | mitreLimit )

extern

See also
  GEOSBufferWithStyle

## GEOSBuildArea()

GEOSGeometry * GEOSBuildArea | ( | const GEOSGeometry * | g | ) |

extern

Perform a polygonization using all the linework, assuming that rings contained within rings are empty holes, rather then extra polygons.

Parameters

  g | The input linework

Returns
  The polygonal output Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::polygonize::BuildArea

Since
  3.8

## GEOSBuildArea_r()

GEOSGeometry * GEOSBuildArea_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSBuildArea

## GEOSClipByRect()

GEOSGeometry * GEOSClipByRect | ( | const GEOSGeometry * | g,
|  | double | xmin,
|  | double | ymin,
|  | double | xmax,
|  | double | ymax )

extern

Intersection optimized for a rectangular clipping polygon. Supposed to be faster than using GEOSIntersection(). Not guaranteed to return valid results.

Parameters

  g | The input geometry to be clipped
  xmin | Left bound of clipping rectangle
  ymin | Lower bound of clipping rectangle
  xmax | Right bound of clipping rectangle
  ymax | Upper bound of clipping rectangle

Returns
  The clipped geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::intersection::RectangleIntersection

Since
  3.5

## GEOSClipByRect_r()

GEOSGeometry * GEOSClipByRect_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | xmin,
|  | double | ymin,
|  | double | xmax,
|  | double | ymax )

extern

See also
  GEOSClipByRect

## GEOSClusterDBSCAN()

GEOSClusterInfo * GEOSClusterDBSCAN | ( | const GEOSGeometry * | g,
|  | double | eps,
|  | unsigned | minPoints )

extern

GEOSClusterDBSCAN.

Cluster geometries using the DBSCAN algorithm

Parameters

  g | a collection of geometries to be clustered
  eps | distance parameter for clustering
  minPoints | density parameter for clustering

Returns
  cluster information object

## GEOSClusterDBSCAN_r()

GEOSClusterInfo * GEOSClusterDBSCAN_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | eps,
|  | unsigned | minPoints )

extern

See also
  GEOSClusterDBSCAN

## GEOSClusterEnvelopeDistance()

GEOSClusterInfo * GEOSClusterEnvelopeDistance | ( | const GEOSGeometry * | g,
|  | double | d )

extern

GEOSClusterEnvelopeDistance.

Cluster geometries according to an envelope distance threshold

Parameters

  g | a collection of geometries to be clustered
  d | minimum envelope distance between geometries in the same cluster

Returns
  cluster information object

## GEOSClusterEnvelopeDistance_r()

GEOSClusterInfo * GEOSClusterEnvelopeDistance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | d )

extern

See also
  GEOSClusterEnvelopeDistance

## GEOSClusterEnvelopeIntersects()

GEOSClusterInfo * GEOSClusterEnvelopeIntersects | ( | const GEOSGeometry * | g | ) |

extern

GEOSClusterEnvelopeIntersects.

Cluster geometries whose envelopes intersect

Parameters

  g |

Returns
  cluster information object

## GEOSClusterEnvelopeIntersects_r()

GEOSClusterInfo * GEOSClusterEnvelopeIntersects_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSClusterEnvelopeIntersects

## GEOSClusterGeometryDistance()

GEOSClusterInfo * GEOSClusterGeometryDistance | ( | const GEOSGeometry * | g,
|  | double | d )

extern

GEOSClusterGeometryDistance.

Cluster geometries according to a distance threshold

Parameters

  g | a collection of geometries to be clustered
  d | minimum distance between geometries in the same cluster

Returns
  cluster information object

## GEOSClusterGeometryDistance_r()

GEOSClusterInfo * GEOSClusterGeometryDistance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | d )

extern

See also
  GEOSClusterGeometryDistance

## GEOSClusterGeometryIntersects()

GEOSClusterInfo * GEOSClusterGeometryIntersects | ( | const GEOSGeometry * | g | ) |

extern

GEOSClusterGeometryIntersects.

Cluster geometries that intersect

Parameters

  g | a collection of geometries to be clustered

Returns
  cluster information object

## GEOSClusterGeometryIntersects_r()

GEOSClusterInfo * GEOSClusterGeometryIntersects_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSClusterGeometryIntersects

## GEOSClusterInfo_destroy()

void GEOSClusterInfo_destroy | ( | GEOSClusterInfo * | clusters | ) |

extern

GEOSClusterInfo_destroy.

Destroy a cluster information object.

Parameters

  clusters | cluster information object

## GEOSClusterInfo_destroy_r()

void GEOSClusterInfo_destroy_r | ( | GEOSContextHandle_t | ,
|  | GEOSClusterInfo * | info )

extern

See also
  GEOSClusterInfo_destroy

## GEOSClusterInfo_getClustersForInputs()

size_t * GEOSClusterInfo_getClustersForInputs | ( | const GEOSClusterInfo * | clusters | ) |

extern

GEOSClusterInfo_getClustersForInputs.

Get the cluster index associated with each input to the clustering operation. Inputs that do are not associated with any cluster will have an index of GEOS_CLUSTER_NONE.

Parameters

  clusters | cluster information object

Returns
  an array of cluster indices, to be freed by the caller.

## GEOSClusterInfo_getClustersForInputs_r()

size_t * GEOSClusterInfo_getClustersForInputs_r | ( | GEOSContextHandle_t | ,
|  | const GEOSClusterInfo * | clusters )

extern

See also
  GEOSClusterInfo_getClustersForInputs

## GEOSClusterInfo_getClusterSize()

size_t GEOSClusterInfo_getClusterSize | ( | const GEOSClusterInfo * | clusters,
|  | size_t | i )

extern

GEOSClusterInfo_getSize.

Get the number of elements in the ith cluster (0-indexed)

Parameters

  clusters | cluster information object
  i | cluster for which a size will be returned

Returns
  number of elements in the cluster

## GEOSClusterInfo_getClusterSize_r()

size_t GEOSClusterInfo_getClusterSize_r | ( | GEOSContextHandle_t | ,
|  | const GEOSClusterInfo * | clusters,
|  | size_t | i )

extern

See also
  GEOSClusterInfo_getClusterSize

## GEOSClusterInfo_getInputsForClusterN()

const size_t * GEOSClusterInfo_getInputsForClusterN | ( | const GEOSClusterInfo * | clusters,
|  | size_t | i )

extern

GEOSClusterInfo_getInputsForClusterN.

Parameters

  clusters | cluster information object
  i | index of the cluster for which indices should be retrieved

Returns
  a pointer to an array of cluster indices. Size of the array is indicated by GEOSClusterInfo_getNumElements. The array is owner by the cluster information object and should not be modified or freed by the caller.

## GEOSClusterInfo_getInputsForClusterN_r()

const size_t * GEOSClusterInfo_getInputsForClusterN_r | ( | GEOSContextHandle_t | ,
|  | const GEOSClusterInfo * | clusters,
|  | size_t | i )

extern

See also
  GEOSClusterInfo_getInputsForClusterN

## GEOSClusterInfo_getNumClusters()

size_t GEOSClusterInfo_getNumClusters | ( | const GEOSClusterInfo * | clusters | ) |

extern

GEOSClusterInfo_getNumClusters.

Get the number of clusters identified by a clustering operation

Parameters

  clusters | cluster information object

Returns
  number of clusters identified

## GEOSClusterInfo_getNumClusters_r()

size_t GEOSClusterInfo_getNumClusters_r | ( | GEOSContextHandle_t | ,
|  | const GEOSClusterInfo * | clusters )

extern

See also
  GEOSClusterInfo_getNumClusters

## GEOSConcaveHull()

GEOSGeometry * GEOSConcaveHull | ( | const GEOSGeometry * | g,
|  | double | ratio,
|  | unsigned int | allowHoles )

extern

Returns a "concave hull" of a geometry. A concave hull is a polygon which contains all the points of the input, but is a better approximation than the convex hull to the area occupied by the input. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry.

A set of points has a sequence of hulls of increasing concaveness, determined by a numeric target parameter. The concave hull is constructed by removing the longest outer edges of the Delaunay Triangulation of the space between the polygons, until the target criterion parameter is reached. This can be expressed as a ratio between the lengths of the longest and shortest edges. 1 produces the convex hull; 0 produces a hull with maximum concaveness

Parameters

  g | The input geometry
  ratio | The edge length ratio value, between 0 and 1.
  allowHoles | When non-zero, the polygonal output may contain holes.

Returns
  A newly allocated geometry of the concave hull. NULL on exception.

Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::hull::ConcaveHull
  GEOSConcaveHullByLength
  GEOSConcaveHullOfPolygons
  GEOSConvexHull

Since
  3.11

## GEOSConcaveHull_r()

GEOSGeometry * GEOSConcaveHull_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | ratio,
|  | unsigned int | allowHoles )

extern

See also
  GEOSConcaveHull

## GEOSConcaveHullByLength()

GEOSGeometry * GEOSConcaveHullByLength | ( | const GEOSGeometry * | g,
|  | double | length,
|  | unsigned int | allowHoles )

extern

Returns a "concave hull" of a geometry. A concave hull is a polygon which contains all the points of the input, but is a better approximation than the convex hull to the area occupied by the input. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry.

A set of points has a sequence of hulls of increasing concaveness, determined by a numeric target parameter. The concave hull is constructed by removing the longest outer edges of the Delaunay Triangulation of the space between the polygons, until the specified maximm edge length is reached. A large value produces the convex hull, 0 produces the hull of maximum concaveness.

Parameters

  g | The input geometry
  length | The maximum edge length (0 or greater)
  allowHoles | When non-zero, the polygonal output may contain holes.

Returns
  A newly allocated geometry of the concave hull. NULL on exception.

Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::hull::ConcaveHull
  GEOSConcaveHull
  GEOSConcaveHullOfPolygons
  GEOSConvexHull

Since
  3.12

## GEOSConcaveHullByLength_r()

GEOSGeometry * GEOSConcaveHullByLength_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | ratio,
|  | unsigned int | allowHoles )

extern

See also
  GEOSConcaveHullByLength

## GEOSConcaveHullOfPolygons()

GEOSGeometry * GEOSConcaveHullOfPolygons | ( | const GEOSGeometry * | g,
|  | double | lengthRatio,
|  | unsigned int | isTight,
|  | unsigned int | isHolesAllowed )

extern

Constructs a concave hull of a set of polygons, respecting the polygons as constraints.

A concave hull is a (possibly) non-convex polygon containing all the input polygons. The computed hull "fills the gap" between the polygons, and does not intersect their interior. A set of polygons has a sequence of hulls of increasing concaveness, determined by a numeric target parameter.

The concave hull is constructed by removing the longest outer edges of the Delaunay Triangulation of the space between the polygons, until the target criterion parameter is reached. The "Maximum Edge Length" parameter limits the length of the longest edge between polygons to be no larger than this value. This can be expressed as a ratio between the lengths of the longest and shortest edges.

The input polygons must be a valid MultiPolygon (i.e. they must be non-overlapping).

Parameters

  g | the valid MultiPolygon geometry to process
  lengthRatio | specifies the Maximum Edge Length as a fraction of the difference between the longest and shortest edge lengths between the polygons. This normalizes the Maximum Edge Length to be scale-free. A value of 1 produces the convex hull; a value of 0 produces the original polygons.
  isHolesAllowed | is the concave hull allowed to contain holes?
  isTight | does the hull follow the outer boundaries of the input polygons.

Returns
  A newly allocated geometry of the concave hull. NULL on exception.

Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::hull::ConcaveHullOfPolygons
  GEOSConcaveHull
  GEOSConvexHull

Since
  3.11

## GEOSConcaveHullOfPolygons_r()

GEOSGeometry * GEOSConcaveHullOfPolygons_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | lengthRatio,
|  | unsigned int | isTight,
|  | unsigned int | isHolesAllowed )

extern

See also
  GEOSConcaveHullOfPolygons

## GEOSConstrainedDelaunayTriangulation()

GEOSGeometry * GEOSConstrainedDelaunayTriangulation | ( | const GEOSGeometry * | g | ) |

extern

Return a constrained Delaunay triangulation of the vertices of the given polygon(s). For non-polygonal inputs, returns an empty geometry collection.

Parameters

  g | the input geometry whose rings will be used as input

Returns
  A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.10

## GEOSConstrainedDelaunayTriangulation_r()

GEOSGeometry * GEOSConstrainedDelaunayTriangulation_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSConstrainedDelaunayTriangulation

## GEOSContains()

char GEOSContains | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if geometry g2 is completely within g1, but not wholly contained in the boundary of g1.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::contains

Since
  2.2

## GEOSContains_r()

char GEOSContains_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSContains

## GEOSContext_setErrorHandler_r()

GEOSMessageHandler GEOSContext_setErrorHandler_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSMessageHandler | ef )

extern

Set the notice handler callback function for run-time error messages.

Parameters

  extHandle | the GEOS context from GEOS_init_r
  ef | the handler callback

Returns
  the previously configured message handler or NULL if no message handler was configured

Since
  3.3

## GEOSContext_setErrorMessageHandler_r()

GEOSMessageHandler_r GEOSContext_setErrorMessageHandler_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSMessageHandler_r | ef,
|  | void * | userData )

extern

Sets an error message handler on the given GEOS context.

Parameters

  extHandle | the GEOS context
  ef | the message handler
  userData | optional user data pointer that will be passed to the message handler

Returns
  the previously configured message handler or NULL if no message handler was configured

Since
  3.5

## GEOSContext_setInterruptCallback_r()

GEOSContextInterruptCallback * GEOSContext_setInterruptCallback_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSContextInterruptCallback * | cb,
|  | void * | userData )

extern

Register a function to be called when a possible interruption point is reached in code executed in the specified context. The function can interrupt the thread if desired by returning True.

Parameters

  extHandle | the context returned by GEOS_init_r.
  cb | Callback function to invoke
  userData | optional data to be pe provided as argument to callback

Returns
  the previously registered callback, or NULL

See also
  GEOSContextInterruptCallback

Since
  3.14

## GEOSContext_setNoticeHandler_r()

GEOSMessageHandler GEOSContext_setNoticeHandler_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSMessageHandler | nf )

extern

Set the notice handler callback function for run-time notice messages.

Parameters

  extHandle | the context returned by GEOS_init_r.
  nf | the handler callback

Returns
  the previously configured message handler or NULL if no message handler was configured

Since
  3.3

## GEOSContext_setNoticeMessageHandler_r()

GEOSMessageHandler_r GEOSContext_setNoticeMessageHandler_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSMessageHandler_r | nf,
|  | void * | userData )

extern

Sets a notice message handler on the given GEOS context.

Parameters

  extHandle | the GEOS context from GEOS_init_r
  nf | the message handler
  userData | optional user data pointer that will be passed to the message handler

Returns
  the previously configured message handler or NULL if no message handler was configured

Since
  3.5

## GEOSConvexHull()

GEOSGeometry * GEOSConvexHull | ( | const GEOSGeometry * | g | ) |

extern

Returns convex hull of a geometry. The smallest convex Geometry that contains all the points in the input Geometry

Parameters

  g | The input geometry

Returns
  A newly allocated geometry of the convex hull. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  2.2

## GEOSConvexHull_r()

GEOSGeometry * GEOSConvexHull_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSConvexHull

## GEOSCoordSeq_clone()

GEOSCoordSequence * GEOSCoordSeq_clone | ( | const GEOSCoordSequence * | s | ) |

extern

Clone a coordinate sequence.

Parameters

  s | the coordinate sequence to clone

Returns
  a copy of the coordinate sequence or NULL on exception

Since
  2.2

## GEOSCoordSeq_clone_r()

GEOSCoordSequence * GEOSCoordSeq_clone_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s )

extern

See also
  GEOSCoordSeq_clone

## GEOSCoordSeq_copyFromArrays()

GEOSCoordSequence * GEOSCoordSeq_copyFromArrays | ( | const double * | x,
|  | const double * | y,
|  | const double * | z,
|  | const double * | m,
|  | unsigned int | size )

extern

Create a coordinate sequence by copying from arrays of doubles

Parameters

  x | array of x coordinates
  y | array of y coordinates
  z | array of z coordinates, or NULL
  m | array of m coordinates, or NULL
  size | length of each array

Returns
  the sequence or NULL on exception

Since
  3.10

## GEOSCoordSeq_copyFromArrays_r()

GEOSCoordSequence * GEOSCoordSeq_copyFromArrays_r | ( | GEOSContextHandle_t | handle,
|  | const double * | x,
|  | const double * | y,
|  | const double * | z,
|  | const double * | m,
|  | unsigned int | size )

extern

See also
  GEOSCoordSeq_copyFromArrays

## GEOSCoordSeq_copyFromBuffer()

GEOSCoordSequence * GEOSCoordSeq_copyFromBuffer | ( | const double * | buf,
|  | unsigned int | size,
|  | int | hasZ,
|  | int | hasM )

extern

Create a coordinate sequence by copying from an interleaved buffer of doubles (e.g., XYXY or XYZXYZ)

Parameters

  buf | pointer to buffer
  size | number of coordinates in the sequence
  hasZ | does buffer have Z values?
  hasM | does buffer have M values?

Returns
  the sequence or NULL on exception

Since
  3.10

## GEOSCoordSeq_copyFromBuffer_r()

GEOSCoordSequence * GEOSCoordSeq_copyFromBuffer_r | ( | GEOSContextHandle_t | handle,
|  | const double * | buf,
|  | unsigned int | size,
|  | int | hasZ,
|  | int | hasM )

extern

See also
  GEOSCoordSeq_copyFromBuffer

## GEOSCoordSeq_copyToArrays()

int GEOSCoordSeq_copyToArrays | ( | const GEOSCoordSequence * | s,
|  | double * | x,
|  | double * | y,
|  | double * | z,
|  | double * | m )

extern

Copy the contents of a coordinate sequence to arrays of doubles

Parameters

  s | sequence to copy
  x | array to which x values should be copied
  y | array to which y values should be copied
  z | array to which z values should be copied, or NULL
  m | array to which m values should be copied, or NULL

Returns
  1 on success, 0 on error

Since
  3.10

## GEOSCoordSeq_copyToArrays_r()

int GEOSCoordSeq_copyToArrays_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | double * | x,
|  | double * | y,
|  | double * | z,
|  | double * | m )

extern

See also
  GEOSCoordSeq_copyToArrays

## GEOSCoordSeq_copyToBuffer()

int GEOSCoordSeq_copyToBuffer | ( | const GEOSCoordSequence * | s,
|  | double * | buf,
|  | int | hasZ,
|  | int | hasM )

extern

Copy the contents of a coordinate sequence to an interleaved buffer of doubles (e.g., XYXY or XYZXYZ)

Parameters

  s | sequence to copy
  buf | buffer to which coordinates should be copied
  hasZ | copy Z values to buffer?
  hasM | copy M values to buffer?

Returns
  1 on success, 0 on error

Since
  3.10

## GEOSCoordSeq_copyToBuffer_r()

int GEOSCoordSeq_copyToBuffer_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | double * | buf,
|  | int | hasZ,
|  | int | hasM )

extern

See also
  GEOSCoordSeq_copyToBuffer

## GEOSCoordSeq_create()

GEOSCoordSequence * GEOSCoordSeq_create | ( | unsigned int | size,
|  | unsigned int | dims )

extern

Create a coordinate sequence.

Parameters

  size | number of coordinates in the sequence
  dims | dimensionality of the coordinates (2, 3 or 4)

Returns
  the sequence or NULL on exception

Since
  2.2

## GEOSCoordSeq_create_r()

GEOSCoordSequence * GEOSCoordSeq_create_r | ( | GEOSContextHandle_t | handle,
|  | unsigned int | size,
|  | unsigned int | dims )

extern

See also
  GEOSCoordSeq_create

## GEOSCoordSeq_createWithDimensions()

GEOSCoordSequence * GEOSCoordSeq_createWithDimensions | ( | unsigned int | size,
|  | int | hasZ,
|  | int | hasM )

extern

Create a coordinate sequence.

Parameters

  size | number of coordinates in the sequence
  hasZ | whether the sequence should store Z values
  hasM | whether the sequence should store M values

Returns
  the sequence or NULL on exception

Since
  3.14

## GEOSCoordSeq_createWithDimensions_r()

GEOSCoordSequence * GEOSCoordSeq_createWithDimensions_r | ( | GEOSContextHandle_t | handle,
|  | unsigned int | size,
|  | int | hasZ,
|  | int | hasM )

extern

See also
  GEOSCoordSeq_createWithDimensions

## GEOSCoordSeq_destroy()

void GEOSCoordSeq_destroy | ( | GEOSCoordSequence * | s | ) |

extern

Destroy a coordinate sequence, freeing all memory.

Parameters

  s | the coordinate sequence to destroy

Since
  2.2

## GEOSCoordSeq_destroy_r()

void GEOSCoordSeq_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSCoordSeq_destroy

## GEOSCoordSeq_getDimensions()

int GEOSCoordSeq_getDimensions | ( | const GEOSCoordSequence * | s,
|  | unsigned int * | dims )

extern

Get dimension info from a coordinate sequence.

Parameters

  [in] | s | the coordinate sequence
  [out] | dims | pointer where dimension value will be placed

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_getDimensions_r()

int GEOSCoordSeq_getDimensions_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int * | dims )

extern

See also
  GEOSCoordSeq_getDimensions

## GEOSCoordSeq_getM()

int GEOSCoordSeq_getM | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

Read M ordinate values from a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | pointer where ordinate value will be placed

Returns
  0 on exception

Since
  3.14

## GEOSCoordSeq_getM_r()

int GEOSCoordSeq_getM_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

See also
  GEOSCoordSeq_getM

## GEOSCoordSeq_getOrdinate()

int GEOSCoordSeq_getOrdinate | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | unsigned int | dim,
|  | double * | val )

extern

Read Nth ordinate value from a coordinate sequence.

Parameters

  [in] | s | the coordinate sequence
  [in] | idx | the index of the coordinate to alter, zero based
  [in] | dim | the dimension number of the ordinate to read, zero based
  [out] | val | pointer where ordinate value will be placed

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_getOrdinate_r()

int GEOSCoordSeq_getOrdinate_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | unsigned int | dim,
|  | double * | val )

extern

See also
  GEOSCoordSeq_getOrdinate

## GEOSCoordSeq_getSize()

int GEOSCoordSeq_getSize | ( | const GEOSCoordSequence * | s,
|  | unsigned int * | size )

extern

Get size info from a coordinate sequence.

Parameters

  [in] | s | the coordinate sequence
  [out] | size | pointer where size value will be placed

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_getSize_r()

int GEOSCoordSeq_getSize_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int * | size )

extern

See also
  GEOSCoordSeq_getSize

## GEOSCoordSeq_getX()

int GEOSCoordSeq_getX | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

Read X ordinate values from a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | pointer where ordinate value will be placed

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_getX_r()

int GEOSCoordSeq_getX_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

See also
  GEOSCoordSeq_getX

## GEOSCoordSeq_getXY()

int GEOSCoordSeq_getXY | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | x,
|  | double * | y )

extern

Read X and Y ordinate values from a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  x | pointer where ordinate X value will be placed
  y | pointer where ordinate Y value will be placed

Returns
  0 on exception

Since
  3.8

## GEOSCoordSeq_getXY_r()

int GEOSCoordSeq_getXY_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | x,
|  | double * | y )

extern

See also
  GEOSCoordSeq_getXY

## GEOSCoordSeq_getXYZ()

int GEOSCoordSeq_getXYZ | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | x,
|  | double * | y,
|  | double * | z )

extern

Read X and Y ordinate values from a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  x | pointer where ordinate X value will be placed
  y | pointer where ordinate Y value will be placed
  z | pointer where ordinate Z value will be placed

Returns
  0 on exception

Since
  3.8

## GEOSCoordSeq_getXYZ_r()

int GEOSCoordSeq_getXYZ_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | x,
|  | double * | y,
|  | double * | z )

extern

See also
  GEOSCoordSeq_getXYZ

## GEOSCoordSeq_getY()

int GEOSCoordSeq_getY | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

Read Y ordinate values from a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | pointer where ordinate value will be placed

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_getY_r()

int GEOSCoordSeq_getY_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

See also
  GEOSCoordSeq_getY

## GEOSCoordSeq_getZ()

int GEOSCoordSeq_getZ | ( | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

Read Z ordinate values from a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | pointer where ordinate value will be placed

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_getZ_r()

int GEOSCoordSeq_getZ_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double * | val )

extern

See also
  GEOSCoordSeq_getZ

## GEOSCoordSeq_hasM()

char GEOSCoordSeq_hasM | ( | GEOSCoordSequence * | s | ) |

extern

Tests whether the input coordinate sequence has M coordinates.

Parameters

  s | the coordinate sequence to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.14

## GEOSCoordSeq_hasM_r()

char GEOSCoordSeq_hasM_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSCoordSeq_hasM

## GEOSCoordSeq_hasZ()

char GEOSCoordSeq_hasZ | ( | GEOSCoordSequence * | s | ) |

extern

Tests whether the input coordinate sequence has Z coordinates.

Parameters

  s | the coordinate sequence to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.14

## GEOSCoordSeq_hasZ_r()

char GEOSCoordSeq_hasZ_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSCoordSeq_hasZ

## GEOSCoordSeq_isCCW()

int GEOSCoordSeq_isCCW | ( | const GEOSCoordSequence * | s,
|  | char * | is_ccw )

extern

Check orientation of a coordinate sequence. Closure of the sequence is assumed. Invalid (collapsed) or short (fewer than 4 points) sequences return false.

Parameters

  s | the coordinate sequence
  is_ccw | pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise

Returns
  0 on exception, 1 on success

Since
  3.7

## GEOSCoordSeq_isCCW_r()

int GEOSCoordSeq_isCCW_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSCoordSequence * | s,
|  | char * | is_ccw )

extern

See also
  GEOSCoordSeq_isCCW

## GEOSCoordSeq_setM()

int GEOSCoordSeq_setM | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

Set M ordinate values in a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | the value to set the ordinate to

Returns
  0 on exception

Since
  3.14

## GEOSCoordSeq_setM_r()

int GEOSCoordSeq_setM_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

See also
  GEOSCoordSeq_setM

## GEOSCoordSeq_setOrdinate()

int GEOSCoordSeq_setOrdinate | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | unsigned int | dim,
|  | double | val )

extern

Set Nth ordinate value in a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  dim | the dimension number of the ordinate to alter, zero based
  val | the value to set the ordinate to

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_setOrdinate_r()

int GEOSCoordSeq_setOrdinate_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | unsigned int | dim,
|  | double | val )

extern

See also
  GEOSCoordSeq_setOrdinate

## GEOSCoordSeq_setX()

int GEOSCoordSeq_setX | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

Set X ordinate values in a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | the value to set the ordinate to

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_setX_r()

int GEOSCoordSeq_setX_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

See also
  GEOSCoordSeq_setX

## GEOSCoordSeq_setXY()

int GEOSCoordSeq_setXY | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | x,
|  | double | y )

extern

Set X and Y ordinate values in a coordinate sequence simultaneously.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  x | the value to set the X ordinate to
  y | the value to set the Y ordinate to

Returns
  0 on exception

Since
  3.8

## GEOSCoordSeq_setXY_r()

int GEOSCoordSeq_setXY_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | x,
|  | double | y )

extern

See also
  GEOSCoordSeq_setXY

## GEOSCoordSeq_setXYZ()

int GEOSCoordSeq_setXYZ | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | x,
|  | double | y,
|  | double | z )

extern

Set X, Y and Z ordinate values in a coordinate sequence simultaneously.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  x | the value to set the X ordinate to
  y | the value to set the Y ordinate to
  z | the value to set the Z ordinate to

Returns
  0 on exception

Since
  3.8

## GEOSCoordSeq_setXYZ_r()

int GEOSCoordSeq_setXYZ_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | x,
|  | double | y,
|  | double | z )

extern

See also
  GEOSCoordSeq_setXYZ

## GEOSCoordSeq_setY()

int GEOSCoordSeq_setY | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

Set Y ordinate values in a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | the value to set the ordinate to

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_setY_r()

int GEOSCoordSeq_setY_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

See also
  GEOSCoordSeq_setY

## GEOSCoordSeq_setZ()

int GEOSCoordSeq_setZ | ( | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

Set Z ordinate values in a coordinate sequence.

Parameters

  s | the coordinate sequence
  idx | the index of the coordinate to alter, zero based
  val | the value to set the ordinate to

Returns
  0 on exception

Since
  2.2

## GEOSCoordSeq_setZ_r()

int GEOSCoordSeq_setZ_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s,
|  | unsigned int | idx,
|  | double | val )

extern

See also
  GEOSCoordSeq_setZ

## GEOSCoverageClean()

GEOSGeometry * GEOSCoverageClean | ( | const GEOSGeometry * | input | ) |

extern

See also
  GEOSCoverageCleanWithParams

## GEOSCoverageClean_r()

GEOSGeometry * GEOSCoverageClean_r | ( | GEOSContextHandle_t | extHandle,
|  | const GEOSGeometry * | input )

extern

See also
  GEOSCoverageClean

## GEOSCoverageCleanParams_create()

GEOSCoverageCleanParams * GEOSCoverageCleanParams_create | ( |  | ) |

extern

Create a default GEOSCoverageCleanParams object for controlling the way invalid polygon interactions are repaird by GEOSCoverageCleanWithParams.

Returns
  A newly allocated GEOSCoverageCleanParams. NULL on exception. Caller is responsible for freeing with GEOSCoverageCleanParams_destroy().

Since
  3.14

## GEOSCoverageCleanParams_create_r()

GEOSCoverageCleanParams * GEOSCoverageCleanParams_create_r | ( | GEOSContextHandle_t | extHandle | ) |

extern

See also
  GEOSCoverageCleanParams_create

## GEOSCoverageCleanParams_destroy()

void GEOSCoverageCleanParams_destroy | ( | GEOSCoverageCleanParams * | params | ) |

extern

Destroy a GEOSCoverageCleanParams and free all associated memory.

Parameters

  params | The object to destroy.

Since
  3.14

## GEOSCoverageCleanParams_destroy_r()

void GEOSCoverageCleanParams_destroy_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSCoverageCleanParams * | params )

extern

See also
  GEOSCoverageCleanParams_destroy

## GEOSCoverageCleanParams_setGapMaximumWidth()

int GEOSCoverageCleanParams_setGapMaximumWidth | ( | GEOSCoverageCleanParams * | params,
|  | double | gapMaximumWidth )

extern

Gaps which are wider than a given distance are merged with an adjacent polygon. Polygon width is determined as twice the radius of the MaximumInscribedCircle of the gap polygon. Gaps are merged with the adjacent polygon with longest shared border. Empty holes in input polygons are treated as gaps, and may be filled in. Gaps which are not fully enclosed ("inlets") are not removed.

The width of a gap is twice the radius of the Maximum Inscribed Circle in the gap polygon, A width of zero prevents gaps from being merged.

See also
  geos::coverage::CoverageCleaner::setGapMaximumWidth

Parameters

  params | The GEOSCoverageCleanParams to operate on
  gapMaximumWidth | Set to 0.0 for no snapping.

Returns
  0 on exception, 1 on success.

Since
  3.14

## GEOSCoverageCleanParams_setGapMaximumWidth_r()

int GEOSCoverageCleanParams_setGapMaximumWidth_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSCoverageCleanParams * | params,
|  | double | gapMaximumWidth )

extern

See also
  GEOSCoverageCleanParams_setGapMaximumWidth

## GEOSCoverageCleanParams_setOverlapMergeStrategy_r()

int GEOSCoverageCleanParams_setOverlapMergeStrategy_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSCoverageCleanParams * | params,
|  | int | overlapMergeStrategy )

extern

See also
  GEOSCoverageCleanParams_setOverlapMergeStrategy

## GEOSCoverageCleanParams_setSnappingDistance()

int GEOSCoverageCleanParams_setSnappingDistance | ( | GEOSCoverageCleanParams * | params,
|  | double | snappingDistance )

extern

Snapping to nearby vertices and line segment snapping is used to improve noding robustness and eliminate small errors in an efficient way, By default this uses a very small snapping distance based on the extent of the input data. The snapping distance may be specified explicitly. This can reduce the number of overlaps and gaps that need to be merged, and reduce the risk of spikes formed by merging gaps. However, a large snapping distance may introduce undesirable data alteration.

A distance of zero prevents snapping from being used.

See also
  geos::coverage::CoverageCleaner::setSnappingDistance

Parameters

  params | The GEOSCoverageCleanParams to operate on
  snappingDistance | Set to 0.0 for no snapping.

Returns
  0 on exception, 1 on success.

Since
  3.14

## GEOSCoverageCleanParams_setSnappingDistance_r()

int GEOSCoverageCleanParams_setSnappingDistance_r | ( | GEOSContextHandle_t | extHandle,
|  | GEOSCoverageCleanParams * | params,
|  | double | snappingDistance )

extern

See also
  GEOSCoverageCleanParams_setSnappingDistance

## GEOSCoverageCleanWithParams()

GEOSGeometry * GEOSCoverageCleanWithParams | ( | const GEOSGeometry * | input,
|  | const GEOSCoverageCleanParams * | params )

extern

Operates on a list of polygonal geometry with "exactly matching" edge geometry, to fix cases where the geometry does not in fact exactly match.

The input is a collection of polygons, and the output is a collection with the same number of cleaned polygons, in the same order as the input. Polygons that have collapsed during cleaning will be returned as empties.

Parameters

  input | The dirty polygonal coverage, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON.
  params | A GEOSCoverageCleanParams to control the options used in cleaning the coverage.

Returns
  A collection containing the cleaned geometries, or null on error. Where cleaning has resulted in polygon collapse, an EMPTY geometry will be returned as part of the collection.

Since
  3.14

## GEOSCoverageCleanWithParams_r()

GEOSGeometry * GEOSCoverageCleanWithParams_r | ( | GEOSContextHandle_t | extHandle,
|  | const GEOSGeometry * | input,
|  | const GEOSCoverageCleanParams * | params )

extern

See also
  GEOSCoverageCleanWithParams

## GEOSCoverageIsValid()

int GEOSCoverageIsValid | ( | const GEOSGeometry * | input,
|  | double | gapWidth,
|  | GEOSGeometry ** | invalidEdges )

extern

Analyze a coverage (represented as a collection of polygonal geometry with exactly matching edge geometry) to find places where the assumption of exactly matching edges is not met.

Parameters

  input | The polygonal coverage to access, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON.
  gapWidth | The maximum width of gaps to detect.
  invalidEdges | When there are invalidities in the coverage, this pointer will be set with a geometry collection of the same length as the input, with a MULTILINESTRING of the error edges for each invalid polygon, or an EMPTY where the polygon is a valid participant in the coverage. Pass NULL if you do not want the invalid edges returned.

Returns
  A value of 1 for a valid coverage, 0 for invalid and 2 for an exception or error. Invalidity includes polygons that overlap, that have gaps smaller than the gapWidth, or non-polygonal entries in the input collection.

Since
  3.12

## GEOSCoverageIsValid_r()

int GEOSCoverageIsValid_r | ( | GEOSContextHandle_t | extHandle,
|  | const GEOSGeometry * | input,
|  | double | gapWidth,
|  | GEOSGeometry ** | output )

extern

See also
  GEOSCoverageIsValid

## GEOSCoverageSimplifyVW()

GEOSGeometry * GEOSCoverageSimplifyVW | ( | const GEOSGeometry * | input,
|  | double | tolerance,
|  | int | preserveBoundary )

extern

Operates on a coverage (represented as a list of polygonal geometry with exactly matching edge geometry) to apply a Visvalingam–Whyatt simplification to the edges, reducing complexity in proportion with the provided tolerance, while retaining a valid coverage (no edges will cross or touch after the simplification). Geometries never disappear, but they may be simplified down to just a triangle. Also, some invalid geoms (such as Polygons which have too few non-repeated points) will be returned unchanged. If the input dataset is not a valid coverage due to overlaps, it will still be simplified, but invalid topology such as crossing edges will still be invalid.

Parameters

  input | The polygonal coverage to access, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON.
  tolerance | A tolerance parameter in linear units.
  preserveBoundary | Use 1 to preserve the outside edges of the coverage without simplification, 0 to allow them to be simplified.

Returns
  A collection containing the simplified geometries, or null on error.

Since
  3.12

## GEOSCoverageSimplifyVW_r()

GEOSGeometry * GEOSCoverageSimplifyVW_r | ( | GEOSContextHandle_t | extHandle,
|  | const GEOSGeometry * | input,
|  | double | tolerance,
|  | int | preserveBoundary )

extern

See also
  GEOSCoverageSimplifyVW

## GEOSCoverageUnion()

GEOSGeometry * GEOSCoverageUnion | ( | const GEOSGeometry * | g | ) |

extern

Optimized union algorithm for polygonal inputs that are correctly noded and do not overlap. It may generate an error (return NULL) for inputs that do not satisfy this constraint, however this is not guaranteed.

Parameters

  g | The input geometry

Returns
  A geometry that covers all the points of the input geometry. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.8

## GEOSCoverageUnion_r()

GEOSGeometry * GEOSCoverageUnion_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSCoverageUnion

## GEOSCoveredBy()

char GEOSCoveredBy | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if geometry g1 is covered by g2, which is the case if every point of g1 lies in g2.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::coveredBy

Since
  3.3

## GEOSCoveredBy_r()

char GEOSCoveredBy_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSCoveredBy

## GEOSCovers()

char GEOSCovers | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if geometry g1 covers g2, which is the case if every point of g2 lies in g1.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::covers

Since
  3.3

## GEOSCovers_r()

char GEOSCovers_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSCovers

## GEOSCrosses()

char GEOSCrosses | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if two geometries interiors intersect but their boundaries do not. Most useful for finding line crosses cases.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::crosses

Since
  2.2

## GEOSCrosses_r()

char GEOSCrosses_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSCrosses

## GEOSDelaunayTriangulation()

GEOSGeometry * GEOSDelaunayTriangulation | ( | const GEOSGeometry * | g,
|  | double | tolerance,
|  | int | onlyEdges )

extern

Return a Delaunay triangulation of the vertices of the given geometry.

Parameters

  g | the input geometry whose vertices will be used as "sites"
  tolerance | optional snapping tolerance to use for improved robustness
  onlyEdges | if non-zero will return a MultiLineString, otherwise it will return a GeometryCollection containing triangular Polygons.

Returns
  A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.4

## GEOSDelaunayTriangulation_r()

GEOSGeometry * GEOSDelaunayTriangulation_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | tolerance,
|  | int | onlyEdges )

extern

See also
  GEOSDelaunayTriangulation

## GEOSDensify()

GEOSGeometry * GEOSDensify | ( | const GEOSGeometry * | g,
|  | double | tolerance )

extern

Densifies a geometry using a given distance tolerance. Additional vertices will be added to every line segment that is greater this tolerance; these vertices will evenly subdivide that segment. Only linear components of input geometry are densified.

Parameters

  g | The geometry to densify
  tolerance | the distance tolerance to densify

Returns
  The densified geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.10

## GEOSDensify_r()

GEOSGeometry * GEOSDensify_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | tolerance )

extern

See also
  GEOSDensify

## GEOSDifference()

GEOSGeometry * GEOSDifference | ( | const GEOSGeometry * | ga,
|  | const GEOSGeometry * | gb )

extern

Returns the difference of two geometries A and B: the set of points that fall within A but not within B.

Parameters

  ga | the base geometry
  gb | the geometry to subtract from it

Returns
  A newly allocated geometry of the difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  2.2

## GEOSDifference_r()

GEOSGeometry * GEOSDifference_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSDifference

## GEOSDifferencePrec()

GEOSGeometry * GEOSDifferencePrec | ( | const GEOSGeometry * | ga,
|  | const GEOSGeometry * | gb,
|  | double | gridSize )

extern

Returns the difference of two geometries A and B: the set of points that fall within A but not within B. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry.

Parameters

  ga | one of the geometries
  gb | the other geometry
  gridSize | the cell size of the precision grid

Returns
  A newly allocated geometry of the difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  3.9

## GEOSDifferencePrec_r()

GEOSGeometry * GEOSDifferencePrec_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | gridSize )

extern

See also
  GEOSDifferencePrec

## GEOSDisjoint()

char GEOSDisjoint | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if two geometries have no point in common.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::disjoint

Since
  2.2

## GEOSDisjoint_r()

char GEOSDisjoint_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSDisjoint

## GEOSDisjointSubsetUnion()

GEOSGeometry * GEOSDisjointSubsetUnion | ( | const GEOSGeometry * | g | ) |

extern

Optimized union algorithm for inputs that can be divided into subsets that do not intersect. If there is only one such subset, performance can be expected to be worse than GEOSUnionaryUnion.

Parameters

  g | The input geometry

Returns
  A newly allocated geometry of the union, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.12

## GEOSDisjointSubsetUnion_r()

GEOSGeometry * GEOSDisjointSubsetUnion_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSDisjointSubsetUnion

## GEOSDistance()

int GEOSDistance | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

Calculate the distance between two geometries.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry
  [out] | dist | Pointer to be filled in with distance result

Returns
  1 on success, 0 on exception.

Since
  2.2

## GEOSDistance_r()

int GEOSDistance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

See also
  GEOSDistance

## GEOSDistanceIndexed()

int GEOSDistanceIndexed | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

Calculate the distance between two geometries, using the indexed facet distance, which first indexes the geometries internally, then calculates the distance. Useful when one or both geometries is very large.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry
  [out] | dist | Pointer to be filled in with distance result

Returns
  1 on success, 0 on exception.

See also
  geos::operation::distance:;IndexedFacetDistance

Since
  3.7

## GEOSDistanceIndexed_r()

int GEOSDistanceIndexed_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

See also
  GEOSDistanceIndexed

## GEOSDistanceWithin()

char GEOSDistanceWithin | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | dist )

extern

Test whether the distance between two geometries is within the given dist.

Parameters

  g1 | Input geometry
  g2 | Input geometry
  dist | The max distance

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.10

## GEOSDistanceWithin_r()

char GEOSDistanceWithin_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | dist )

extern

See also
  GEOSDistanceWithin

## GEOSEnvelope()

GEOSGeometry * GEOSEnvelope | ( | const GEOSGeometry * | g | ) |

extern

Returns minimum rectangular polygon or point that contains the geometry, or an empty point for empty inputs.

Parameters

  g | The geometry to calculate an envelope for

Returns
  A newly allocated polygonal envelope or point. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSEnvelope_r()

GEOSGeometry * GEOSEnvelope_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSEnvelope

## GEOSEquals()

char GEOSEquals | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if two geometries contain the same set of points in the plane.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::equals

Since
  2.2

## GEOSEquals_r()

char GEOSEquals_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSEquals

## GEOSEqualsExact()

char GEOSEqualsExact | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | tolerance )

extern

Determine pointwise equality of two geometries, by checking that they have identical structure and that each vertex of g2 is within the distance tolerance of the corresponding vertex in g1. Z and M values are ignored by GEOSEqualsExact, and this function may return true for inputs with different dimensionality. Unlike GEOSEquals(), geometries that are topologically equivalent but have different representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not considered equal by GEOSEqualsExact().

Parameters

  g1 | Input geometry
  g2 | Input geometry
  tolerance | Tolerance to determine vertex equality

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSNormalize()

Since
  3.0

## GEOSEqualsExact_r()

char GEOSEqualsExact_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | tolerance )

extern

See also
  GEOSEqualsExact

## GEOSEqualsIdentical()

char GEOSEqualsIdentical | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Determine pointwise equality of two geometries by checking that the structure, ordering, and values of all vertices are identical in all dimensions. NaN values are considered to be equal to other NaN values.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.12

## GEOSEqualsIdentical_r()

char GEOSEqualsIdentical_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSEqualsIdentical

## GEOSFrechetDistance()

int GEOSFrechetDistance | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

Calculate the Frechet distance between two geometries, a similarity measure for linear features.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry
  [out] | dist | Pointer to be filled in with distance result

Returns
  1 on success, 0 on exception.

See also
  geos::algorithm::distance::DiscreteFrechetDistance

Since
  3.7

## GEOSFrechetDistance_r()

int GEOSFrechetDistance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

See also
  GEOSFrechetDistance

## GEOSFrechetDistanceDensify()

int GEOSFrechetDistanceDensify | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | densifyFrac,
|  | double * | dist )

extern

Calculate the Frechet distance between two geometries, a similarity measure for linear features. The inputs can be densified to provide a more accurate result.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry
  [in] | densifyFrac | The largest % of the overall line length that any given two-point segment should be
  [out] | dist | Pointer to be filled in with distance result

Returns
  1 on success, 0 on exception.

See also
  geos::algorithm::distance::DiscreteFrechetDistance

Since
  3.7

## GEOSFrechetDistanceDensify_r()

int GEOSFrechetDistanceDensify_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | densifyFrac,
|  | double * | dist )

extern

See also
  GEOSFrechetDistanceDensify

## GEOSFree()

void GEOSFree | ( | void * | buffer | ) |

extern

Free strings and byte buffers returned by functions such as GEOSWKBWriter_write(), GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc. If passed a null pointer the function does nothing.

Parameters

  buffer | The memory to free (may be null)

Since
  3.1

## GEOSFree_r()

void GEOSFree_r | ( | GEOSContextHandle_t | handle,
|  | void * | buffer )

extern

See also
  GEOSFree

## GEOSGeoJSONReader_create()

GEOSGeoJSONReader * GEOSGeoJSONReader_create | ( | void |  | ) |

extern

Allocate a new GEOSGeoJSONReader.

Returns
  a new reader. Caller must free with GEOSGeoJSONReader_destroy()

Since
  3.10

## GEOSGeoJSONReader_create_r()

GEOSGeoJSONReader * GEOSGeoJSONReader_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeoJSONReader_create

## GEOSGeoJSONReader_destroy()

void GEOSGeoJSONReader_destroy | ( | GEOSGeoJSONReader * | reader | ) |

extern

Free the memory associated with a GEOSGeoJSONReader.

Parameters

  reader | The reader to destroy.

Since
  3.10

## GEOSGeoJSONReader_destroy_r()

void GEOSGeoJSONReader_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeoJSONReader * | reader )

extern

See also
  GEOSGeoJSONReader_destroy

## GEOSGeoJSONReader_readGeometry()

GEOSGeometry * GEOSGeoJSONReader_readGeometry | ( | GEOSGeoJSONReader * | reader,
|  | const char * | geojson )

extern

Use a reader to parse a GeoJSON string. A single geometry or Feature is parsed as a geometry. A FeatureCollection is parsed as a GeometryCollection. Feature properties are not read.

Parameters

  reader | A GeoJSON reader object, caller retains ownership
  geojson | The json string to parse, caller retains ownership

Returns
  A GEOSGeometry, caller to free with GEOSGeom_destroy())

Since
  3.10

## GEOSGeoJSONReader_readGeometry_r()

GEOSGeometry * GEOSGeoJSONReader_readGeometry_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeoJSONReader * | reader,
|  | const char * | geojson )

extern

See also
  GEOSGeoJSONReader_read

## GEOSGeoJSONWriter_create()

GEOSGeoJSONWriter * GEOSGeoJSONWriter_create | ( | void |  | ) |

extern

Allocate a new GEOSGeoJSONWriter.

Returns
  a new writer. Caller must free with GEOSGeoJSONWriter_destroy()

Since
  3.10

## GEOSGeoJSONWriter_create_r()

GEOSGeoJSONWriter * GEOSGeoJSONWriter_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeoJSONWriter_create

## GEOSGeoJSONWriter_destroy()

void GEOSGeoJSONWriter_destroy | ( | GEOSGeoJSONWriter * | writer | ) |

extern

Free the memory associated with a GEOSGeoJSONWriter.

Parameters

  writer | The writer to destroy.

Since
  3.10

## GEOSGeoJSONWriter_destroy_r()

void GEOSGeoJSONWriter_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeoJSONWriter * | writer )

extern

See also
  GEOSGeoJSONWriter_destroy

## GEOSGeoJSONWriter_getOutputDimension()

int GEOSGeoJSONWriter_getOutputDimension | ( | GEOSGeoJSONWriter * | writer | ) |

extern

Reads the current output dimension from a GEOSGeoJSONWriter.

Parameters

  writer | A GEOSGeoJSONWriter.

Returns
  The current dimension.

Since
  3.14

## GEOSGeoJSONWriter_getOutputDimension_r()

int GEOSGeoJSONWriter_getOutputDimension_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeoJSONWriter * | writer )

extern

See also
  GEOSGeoJSONWriter_getOutputDimension

## GEOSGeoJSONWriter_setOutputDimension()

void GEOSGeoJSONWriter_setOutputDimension | ( | GEOSGeoJSONWriter * | writer,
|  | int | dim )

extern

Set the output dimensionality of the writer. Either 2 or 3 dimensions.

Parameters

  writer | A GEOSGeoJSONWriter.
  dim | The dimensionality desired.

Since
  3.14

## GEOSGeoJSONWriter_setOutputDimension_r()

void GEOSGeoJSONWriter_setOutputDimension_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeoJSONWriter * | writer,
|  | int | dim )

extern

See also
  GEOSGeoJSONWriter_setOutputDimension

## GEOSGeoJSONWriter_writeGeometry()

char * GEOSGeoJSONWriter_writeGeometry | ( | GEOSGeoJSONWriter * | writer,
|  | const GEOSGeometry * | g,
|  | int | indent )

extern

Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON Feature or FeatureCollection is unsupported through the GEOS C API.

Parameters

  writer | A GeoJSON reader object, caller retains ownership.
  g | The geometry to convert, caller retains ownership.
  indent | The indentation used. Use -1 for no formatting.

Returns
  A char pointer, caller to free with GEOSFree())

Since
  3.10

## GEOSGeoJSONWriter_writeGeometry_r()

char * GEOSGeoJSONWriter_writeGeometry_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeoJSONWriter * | writer,
|  | const GEOSGeometry * | g,
|  | int | indent )

extern

See also
  GEOSGeoJSONWriter_writeGeometry

## GEOSGeom_clone()

GEOSGeometry * GEOSGeom_clone | ( | const GEOSGeometry * | g | ) |

extern

Create a new copy of the input geometry.

Parameters

  g | The geometry to copy

Returns
  A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSGeom_clone_r()

GEOSGeometry * GEOSGeom_clone_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_clone

## GEOSGeom_createCircularString()

GEOSGeometry * GEOSGeom_createCircularString | ( | GEOSCoordSequence * | s | ) |

extern

Creates a CircularString geometry.

Parameters

  s | Input coordinate sequence, ownership passes to the geometry

Returns
  A newly allocated CircularString geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.13

## GEOSGeom_createCircularString_r()

GEOSGeometry * GEOSGeom_createCircularString_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSGeom_createCircularString

## GEOSGeom_createCollection()

GEOSGeometry * GEOSGeom_createCollection | ( | int | type,
|  | GEOSGeometry ** | geoms,
|  | unsigned int | ngeoms )

extern

Create a geometry collection.

Parameters

  type | The geometry type, enumerated by GEOSGeomTypes
  geoms | A list of geometries that will form the collection
  ngeoms | The number of geometries in the geoms list

Returns
  A newly allocated geometry collection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Note
  The geoms argument is an array of GEOSGeometry* objects. The caller retains ownership of the containing array, but the ownership of the pointed-to objects is transferred to the returned GEOSGeometry.

Since
  2.2

## GEOSGeom_createCollection_r()

GEOSGeometry * GEOSGeom_createCollection_r | ( | GEOSContextHandle_t | handle,
|  | int | type,
|  | GEOSGeometry ** | geoms,
|  | unsigned int | ngeoms )

extern

See also
  GEOSGeom_createCollection

## GEOSGeom_createCompoundCurve()

GEOSGeometry * GEOSGeom_createCompoundCurve | ( | GEOSGeometry ** | curves,
|  | unsigned int | ncurves )

extern

Creates a CompoundCurve geometry.

Parameters

  curves | A list of geometries that will form the CompoundCurve
  ncurves | The number of geometries in the curves list

Returns
  A newly allocated CompoundCurve geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.13

## GEOSGeom_createCompoundCurve_r()

GEOSGeometry * GEOSGeom_createCompoundCurve_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry ** | curves,
|  | unsigned int | ncurves )

extern

See also
  GEOSGeom_createCompoundCurve

## GEOSGeom_createCurvePolygon()

GEOSGeometry * GEOSGeom_createCurvePolygon | ( | GEOSGeometry * | shell,
|  | GEOSGeometry ** | holes,
|  | unsigned int | nholes )

extern

Creates a CurvePolygon geometry from ring geometries.

Parameters

  shell | A ring that is the exterior ring of the polygon.
  holes | An array of rings that are the holes.
  nholes | The number of rings in the holes array.

Returns
  A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Note
  The holes argument is an array of GEOSGeometry* objects. The caller retains ownership of the containing array, but the ownership of the pointed-to objects is transferred to the returned GEOSGeometry.

Since
  3.13

## GEOSGeom_createCurvePolygon_r()

GEOSGeometry * GEOSGeom_createCurvePolygon_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | shell,
|  | GEOSGeometry ** | holes,
|  | unsigned int | nholes )

extern

See also
  GEOSGeom_createCurvePolygon

## GEOSGeom_createEmptyCircularString()

GEOSGeometry * GEOSGeom_createEmptyCircularString | ( |  | ) |

extern

Creates an empty CircularString geometry.

Returns
  A newly allocated CircularString geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.13

## GEOSGeom_createEmptyCircularString_r()

GEOSGeometry * GEOSGeom_createEmptyCircularString_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeom_createEmptyCircularString

## GEOSGeom_createEmptyCollection()

GEOSGeometry * GEOSGeom_createEmptyCollection | ( | int | type | ) |

extern

Create an empty geometry collection.

Parameters

  type | The geometry type, enumerated by GEOSGeomTypes

Returns
  A newly allocated empty geometry collection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSGeom_createEmptyCollection_r()

GEOSGeometry * GEOSGeom_createEmptyCollection_r | ( | GEOSContextHandle_t | handle,
|  | int | type )

extern

See also
  GEOSGeom_createEmptyCollection

## GEOSGeom_createEmptyCompoundCurve()

GEOSGeometry * GEOSGeom_createEmptyCompoundCurve | ( |  | ) |

extern

Creates an empty CompoundCurve geometry.

Returns
  A newly allocated CompoundCurve geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.13

## GEOSGeom_createEmptyCompoundCurve_r()

GEOSGeometry * GEOSGeom_createEmptyCompoundCurve_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeom_createEmptyCompoundCurve

## GEOSGeom_createEmptyCurvePolygon()

GEOSGeometry * GEOSGeom_createEmptyCurvePolygon | ( |  | ) |

extern

Creates an empty CurvePolygon geometry.

Returns
  A newly allocated CurvePolygon geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.13

## GEOSGeom_createEmptyCurvePolygon_r()

GEOSGeometry * GEOSGeom_createEmptyCurvePolygon_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeom_createEmptyCurvePolygon

## GEOSGeom_createEmptyLineString()

GEOSGeometry * GEOSGeom_createEmptyLineString | ( | void |  | ) |

extern

Creates an emptylinestring geometry.

Returns
  A newly allocated linestring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSGeom_createEmptyLineString_r()

GEOSGeometry * GEOSGeom_createEmptyLineString_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeom_createEmptyLineString

## GEOSGeom_createEmptyPoint()

GEOSGeometry * GEOSGeom_createEmptyPoint | ( | void |  | ) |

extern

Creates an empty point.

Returns
  A newly allocated empty point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSGeom_createEmptyPoint_r()

GEOSGeometry * GEOSGeom_createEmptyPoint_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeom_createEmptyPoint

## GEOSGeom_createEmptyPolygon()

GEOSGeometry * GEOSGeom_createEmptyPolygon | ( | void |  | ) |

extern

Creates an empty polygon geometry.

Returns
  A newly allocated empty polygon geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSGeom_createEmptyPolygon_r()

GEOSGeometry * GEOSGeom_createEmptyPolygon_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSGeom_createEmptyPolygon

## GEOSGeom_createLinearRing()

GEOSGeometry * GEOSGeom_createLinearRing | ( | GEOSCoordSequence * | s | ) |

extern

Creates a linear ring geometry, for use in a polygon.

Parameters

  s | Input coordinate sequence, ownership passes to the geometry

Returns
  A newly allocated linear ring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSGeom_createLinearRing_r()

GEOSGeometry * GEOSGeom_createLinearRing_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSGeom_createLinearRing

## GEOSGeom_createLineString()

GEOSGeometry * GEOSGeom_createLineString | ( | GEOSCoordSequence * | s | ) |

extern

Creates a linestring geometry.

Parameters

  s | Input coordinate sequence, ownership passes to the geometry

Returns
  A newly allocated linestring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSGeom_createLineString_r()

GEOSGeometry * GEOSGeom_createLineString_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSGeom_createLineString

## GEOSGeom_createPoint()

GEOSGeometry * GEOSGeom_createPoint | ( | GEOSCoordSequence * | s | ) |

extern

Creates a point geometry from a coordinate sequence.

Parameters

  s | Input coordinate sequence, ownership passes to the geometry

Returns
  A newly allocated point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  2.2

## GEOSGeom_createPoint_r()

GEOSGeometry * GEOSGeom_createPoint_r | ( | GEOSContextHandle_t | handle,
|  | GEOSCoordSequence * | s )

extern

See also
  GEOSGeom_createPoint

## GEOSGeom_createPointFromXY()

GEOSGeometry * GEOSGeom_createPointFromXY | ( | double | x,
|  | double | y )

extern

Creates a point geometry from a pair of coordinates.

Parameters

  x | The X coordinate
  y | The Y coordinate

Returns
  A newly allocated point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.8

## GEOSGeom_createPointFromXY_r()

GEOSGeometry * GEOSGeom_createPointFromXY_r | ( | GEOSContextHandle_t | handle,
|  | double | x,
|  | double | y )

extern

See also
  GEOSGeom_createPointFromXY

## GEOSGeom_createPolygon()

GEOSGeometry * GEOSGeom_createPolygon | ( | GEOSGeometry * | shell,
|  | GEOSGeometry ** | holes,
|  | unsigned int | nholes )

extern

Creates a polygon geometry from linear ring geometries.

Parameters

  shell | A linear ring that is the exterior ring of the polygon.
  holes | An array of linear rings that are the holes.
  nholes | The number of rings in the holes array.

Returns
  A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Note
  The holes argument is an array of GEOSGeometry* objects. The caller retains ownership of the containing array, but the ownership of the pointed-to objects is transferred to the returned GEOSGeometry.

Since
  2.2

## GEOSGeom_createPolygon_r()

GEOSGeometry * GEOSGeom_createPolygon_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | shell,
|  | GEOSGeometry ** | holes,
|  | unsigned int | nholes )

extern

See also
  GEOSGeom_createPolygon

## GEOSGeom_createRectangle()

GEOSGeometry * GEOSGeom_createRectangle | ( | double | xmin,
|  | double | ymin,
|  | double | xmax,
|  | double | ymax )

extern

Create a rectangular polygon from bounding coordinates. Will return a point geometry if width and height are 0.

Parameters

  xmin | Left bound of envelope
  ymin | Lower bound of envelope
  xmax | Right bound of envelope
  ymax | Upper bound of envelope

Since
  3.11

## GEOSGeom_createRectangle_r()

GEOSGeometry * GEOSGeom_createRectangle_r | ( | GEOSContextHandle_t | handle,
|  | double | xmin,
|  | double | ymin,
|  | double | xmax,
|  | double | ymax )

extern

See also
  GEOSGeom_createRectangle

## GEOSGeom_destroy()

void GEOSGeom_destroy | ( | GEOSGeometry * | g | ) |

extern

Release the memory associated with a geometry.

Parameters

  g | The geometry to be destroyed.

Since
  2.2

## GEOSGeom_destroy_r()

void GEOSGeom_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | g )

extern

See also
  GEOSGeom_destroy

## GEOSGeom_extractUniquePoints()

GEOSGeometry * GEOSGeom_extractUniquePoints | ( | const GEOSGeometry * | g | ) |

extern

Return all distinct vertices of input geometry as a MultiPoint. Note that only 2 dimensions of the vertices are considered when testing for equality.

Parameters

  g | The input geometry

Returns
  The distinct points Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSGeom_extractUniquePoints_r()

GEOSGeometry * GEOSGeom_extractUniquePoints_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_extractUniquePoints

## GEOSGeom_getCoordinateDimension()

int GEOSGeom_getCoordinateDimension | ( | const GEOSGeometry * | g | ) |

extern

Return the cartesian dimension of the geometry.

- 2 for XY data
- 3 for XYZ data

Parameters

  g | Input geometry

Returns
  The dimension

Since
  3.3

## GEOSGeom_getCoordinateDimension_r()

int GEOSGeom_getCoordinateDimension_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_getCoordinateDimension

## GEOSGeom_getCoordSeq()

const GEOSCoordSequence * GEOSGeom_getCoordSeq | ( | const GEOSGeometry * | g | ) |

extern

Return the coordinate sequence underlying the given geometry (Must be a LineString, LinearRing or Point). Do not directly free the coordinate sequence, it is owned by the parent geometry.

Parameters

  g | Input geometry

Returns
  Coordinate sequence or NULL on exception.

Since
  2.2

## GEOSGeom_getCoordSeq_r()

const GEOSCoordSequence * GEOSGeom_getCoordSeq_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_getCoordSeq

## GEOSGeom_getDimensions()

int GEOSGeom_getDimensions | ( | const GEOSGeometry * | g | ) |

extern

Return the planar dimensionality of the geometry.

- 0 for point, multipoint
- 1 for linestring, multilinestring
- 2 for polygon, multipolygon

See also
  geos::geom::Dimension::DimensionType

Parameters

  g | Input geometry

Returns
  The dimensionality

Since
  2.2

## GEOSGeom_getDimensions_r()

int GEOSGeom_getDimensions_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_getDimensions

## GEOSGeom_getExtent()

int GEOSGeom_getExtent | ( | const GEOSGeometry * | g,
|  | double * | xmin,
|  | double * | ymin,
|  | double * | xmax,
|  | double * | ymax )

extern

Finds the extent (minimum and maximum X and Y value) of the geometry. Raises an exception for empty geometry input.

Parameters

  [in] | g | Input geometry
  [out] | xmin | Pointer to place result for minimum X value
  [out] | ymin | Pointer to place result for minimum Y value
  [out] | xmax | Pointer to place result for maximum X value
  [out] | ymax | Pointer to place result for maximum Y value

Returns
  1 on success, 0 on exception

Since
  3.11

## GEOSGeom_getExtent_r()

int GEOSGeom_getExtent_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | xmin,
|  | double * | ymin,
|  | double * | xmax,
|  | double * | ymax )

extern

See also
  GEOSGeom_getExtent

## GEOSGeom_getPrecision()

double GEOSGeom_getPrecision | ( | const GEOSGeometry * | g | ) |

extern

Read the currently set precision value from the geometry and returns the grid size if it is a fixed precision or 0.0 if it is full floating point precision.

Parameters

  g | Input geometry

Returns
  The grid size, or -1 on exception

Since
  3.6

## GEOSGeom_getPrecision_r()

double GEOSGeom_getPrecision_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_getPrecision

## GEOSGeom_getUserData()

void * GEOSGeom_getUserData | ( | const GEOSGeometry * | g | ) |

extern

Return the anonymous "user data" for this geometry. User data must be managed by the caller, and is not freed when the geometry is destroyed.

Parameters

  g | Input geometry

Returns
  A void* to the user data, caller is responsible for casting to the appropriate type.

Since
  3.6

## GEOSGeom_getUserData_r()

void * GEOSGeom_getUserData_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeom_getUserData

## GEOSGeom_getXMax()

int GEOSGeom_getXMax | ( | const GEOSGeometry * | g,
|  | double * | value )

extern

Finds the maximum X value in the geometry.

Parameters

  [in] | g | Input geometry
  [out] | value | Pointer to place result

Returns
  0 on exception

Since
  3.7

## GEOSGeom_getXMax_r()

int GEOSGeom_getXMax_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | value )

extern

See also
  GEOSGeom_getXMax

## GEOSGeom_getXMin()

int GEOSGeom_getXMin | ( | const GEOSGeometry * | g,
|  | double * | value )

extern

Finds the minimum X value in the geometry.

Parameters

  [in] | g | Input geometry
  [out] | value | Pointer to place result

Returns
  0 on exception

Since
  3.7

## GEOSGeom_getXMin_r()

int GEOSGeom_getXMin_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | value )

extern

See also
  GEOSGeom_getXMin

## GEOSGeom_getYMax()

int GEOSGeom_getYMax | ( | const GEOSGeometry * | g,
|  | double * | value )

extern

Finds the maximum Y value in the geometry.

Parameters

  [in] | g | Input geometry
  [out] | value | Pointer to place result

Returns
  0 on exception

Since
  3.7

## GEOSGeom_getYMax_r()

int GEOSGeom_getYMax_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | value )

extern

See also
  GEOSGeom_getYMax

## GEOSGeom_getYMin()

int GEOSGeom_getYMin | ( | const GEOSGeometry * | g,
|  | double * | value )

extern

Finds the minimum Y value in the geometry.

Parameters

  [in] | g | Input geometry
  [out] | value | Pointer to place result

Returns
  0 on exception

Since
  3.7

## GEOSGeom_getYMin_r()

int GEOSGeom_getYMin_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | value )

extern

See also
  GEOSGeom_getYMin

## GEOSGeom_releaseCollection()

GEOSGeometry ** GEOSGeom_releaseCollection | ( | GEOSGeometry * | collection,
|  | unsigned int * | ngeoms )

extern

Release the sub-geometries of a collection for management. by the caller. The input collection remains as an empty collection, that the caller is responsible for destroying. The output geometries are also the responsibility of the caller, as is the containing array, which must be freed with GEOSFree().

Parameters

  collection | The collection that will have its components released.
  ngeoms | A pointer to a variable that will be filled with the size of the output array.

Returns
  A newly allocated array of GEOSGeometry pointers.

Note
  The caller is responsible for freeing the returned array with GEOSFree() and all the elements with GEOSGeom_destroy(). If called with an empty collection, null will be returned and ngeoms set to zero.

Since
  3.12

## GEOSGeom_releaseCollection_r()

GEOSGeometry ** GEOSGeom_releaseCollection_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | collection,
|  | unsigned int * | ngeoms )

extern

See also
  GEOSGeom_releaseCollection

## GEOSGeom_setPrecision()

GEOSGeometry * GEOSGeom_setPrecision | ( | const GEOSGeometry * | g,
|  | double | gridSize,
|  | int | flags )

extern

Change the coordinate precision of a geometry. This will affect the precision of the existing geometry as well as any geometries derived from this geometry using overlay functions. The output will be a valid GEOSGeometry.

Note that operations will always be performed in the precision of the geometry with higher precision (smaller "gridSize"). That same precision will be attached to the operation outputs.

In the Default and GEOS_PREC_KEEP_COLLAPSED modes invalid input may cause an error to occur, unless the invalidity is below the scale of the requested precision

There are only 3 modes. The GEOS_PREC_NO_TOPO mode takes precedence over GEOS_PREC_KEEP_COLLAPSED. So the combination GEOS_PREC_NO_TOPO || GEOS_PREC_KEEP_COLLAPSED has the same semantics as GEOS_PREC_NO_TOPO

Parameters

  g | Input geometry
  gridSize | cell size of grid to round coordinates to, or 0 for FLOATING precision
  flags | The bitwise OR of members of the GEOSPrecisionRules enum

Returns
  The precision reduced result. Caller must free with GEOSGeom_destroy() NULL on exception.

Since
  3.6

## GEOSGeom_setPrecision_r()

GEOSGeometry * GEOSGeom_setPrecision_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | gridSize,
|  | int | flags )

extern

See also
  GEOSGeom_setPrecision

## GEOSGeom_setUserData()

void GEOSGeom_setUserData | ( | GEOSGeometry * | g,
|  | void * | userData )

extern

Set the anonymous "user data" for this geometry.

Parameters

  g | Input geometry
  userData | Void pointer to user data

Since
  3.6

## GEOSGeom_setUserData_r()

void GEOSGeom_setUserData_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | g,
|  | void * | userData )

extern

See also
  GEOSGeom_setUserData

## GEOSGeom_transformXY()

GEOSGeometry * GEOSGeom_transformXY | ( | const GEOSGeometry * | g,
|  | GEOSTransformXYCallback | callback,
|  | void * | userdata )

extern

Apply XY coordinate transform callback to all coordinates in a copy of input geometry. If the callback returns an error, returned geometry will be NULL. Z and M values, if present, are not modified by this function.

Parameters

  [in] | g | Input geometry
  [in] | callback | a function to be executed for each coordinate in the geometry. The callback takes 3 parameters: x and y coordinate values to be updated and a void userdata pointer.
  | userdata | an optional pointer to pe passed to 'callback' as an argument

Returns
  a copy of the input geometry with transformed coordinates. Caller must free with GEOSGeom_destroy().

Since
  3.11

## GEOSGeom_transformXY_r()

GEOSGeometry * GEOSGeom_transformXY_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | GEOSTransformXYCallback | callback,
|  | void * | userdata )

extern

See also
  GEOSGeom_transformXY

## GEOSGeom_transformXYZ()

GEOSGeometry * GEOSGeom_transformXYZ | ( | const GEOSGeometry * | g,
|  | GEOSTransformXYZCallback | callback,
|  | void * | userdata )

extern

Apply XYZ coordinate transform callback to all coordinates in a copy of input geometry. If the callback returns an error, returned geometry will be NULL. M values, if present, are not modified by this function.

Parameters

  [in] | g | Input geometry
  [in] | callback | a function to be executed for each coordinate in the geometry. The callback takes 4 parameters: x, y and z coordinate values to be updated and a void userdata pointer.
  | userdata | an optional pointer to pe passed to 'callback' as an argument

Returns
  a copy of the input geometry with transformed coordinates. Caller must free with GEOSGeom_destroy().

Since
  3.13

## GEOSGeom_transformXYZ_r()

GEOSGeometry * GEOSGeom_transformXYZ_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | GEOSTransformXYZCallback | callback,
|  | void * | userdata )

extern

See also
  GEOSGeom_transformXYZ

## GEOSGeomFromHEX_buf()

GEOSGeometry * GEOSGeomFromHEX_buf | ( | const unsigned char * | hex,
|  | size_t | size )

extern

Deprecated
  use GEOSWKBReader and GEOSWKBWriter_readHEX()

## GEOSGeomFromHEX_buf_r()

GEOSGeometry * GEOSGeomFromHEX_buf_r | ( | GEOSContextHandle_t | handle,
|  | const unsigned char * | hex,
|  | size_t | size )

extern

Deprecated
  use GEOSWKBReader and GEOSWKBReader_readHEX_r()

## GEOSGeomFromWKB_buf()

GEOSGeometry * GEOSGeomFromWKB_buf | ( | const unsigned char * | wkb,
|  | size_t | size )

extern

Deprecated
  use GEOSWKBReader and GEOSWKBWriter_read()

## GEOSGeomFromWKB_buf_r()

GEOSGeometry * GEOSGeomFromWKB_buf_r | ( | GEOSContextHandle_t | handle,
|  | const unsigned char * | wkb,
|  | size_t | size )

extern

Deprecated
  use GEOSWKBReader and GEOSWKBReader_read_r()

## GEOSGeomFromWKT()

GEOSGeometry * GEOSGeomFromWKT | ( | const char * | wkt | ) |

extern

Deprecated
  use GEOSWKTReader and GEOSWKTReader_read_r()

## GEOSGeomFromWKT_r()

GEOSGeometry * GEOSGeomFromWKT_r | ( | GEOSContextHandle_t | handle,
|  | const char * | wkt )

extern

Deprecated
  use GEOSWKTReader and GEOSWKTReader_read_r()

## GEOSGeomGetEndPoint()

GEOSGeometry * GEOSGeomGetEndPoint | ( | const GEOSGeometry * | g | ) |

extern

Return the last point of a LineString

Parameters

  g | Input geometry, must be a LineString

Returns
  A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception.

Since
  3.3

## GEOSGeomGetEndPoint_r()

GEOSGeometry * GEOSGeomGetEndPoint_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeomGetEndPoint

## GEOSGeomGetLength()

int GEOSGeomGetLength | ( | const GEOSGeometry * | g,
|  | double * | length )

extern

Calculate the length of a LineString. Only works for LineString inputs, returns exception otherwise.

Parameters

  [in] | g | Input geometry
  [out] | length | Pointer to be filled in with length result

Returns
  1 on success, 0 on exception.

Since
  3.3

## GEOSGeomGetLength_r()

int GEOSGeomGetLength_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | length )

extern

See also
  GEOSGeomGetLength

## GEOSGeomGetM()

int GEOSGeomGetM | ( | const GEOSGeometry * | g,
|  | double * | m )

extern

Returns the M coordinate, for a Point input, or an exception otherwise.

Parameters

  [in] | g | Input Point geometry
  [out] | m | Pointer to hold return value

Returns
  1 on success, 0 on exception

Since
  3.12

## GEOSGeomGetM_r()

int GEOSGeomGetM_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | m )

extern

See also
  GEOSGeomGetM

## GEOSGeomGetNumPoints()

int GEOSGeomGetNumPoints | ( | const GEOSGeometry * | g | ) |

extern

Returns the number of points, for a LineString input, or an exception otherwise.

Parameters

  g | Input LineString geometry

Returns
  Number of points, -1 on exception

Since
  2.2

## GEOSGeomGetNumPoints_r()

int GEOSGeomGetNumPoints_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeomGetNumPoints

## GEOSGeomGetPointN()

GEOSGeometry * GEOSGeomGetPointN | ( | const GEOSGeometry * | g,
|  | int | n )

extern

Return the N'th point of a LineString

Parameters

  g | Input geometry, must be a LineString
  n | Index of desired point (zero based)

Returns
  A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception.

Since
  3.3

## GEOSGeomGetPointN_r()

GEOSGeometry * GEOSGeomGetPointN_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | int | n )

extern

See also
  GEOSGeomGetPointN

## GEOSGeomGetStartPoint()

GEOSGeometry * GEOSGeomGetStartPoint | ( | const GEOSGeometry * | g | ) |

extern

Return the first point of a LineString

Parameters

  g | Input geometry, must be a LineString

Returns
  A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception.

Since
  3.3

## GEOSGeomGetStartPoint_r()

GEOSGeometry * GEOSGeomGetStartPoint_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeomGetStartPoint

## GEOSGeomGetX()

int GEOSGeomGetX | ( | const GEOSGeometry * | g,
|  | double * | x )

extern

Returns the X coordinate, for a Point input, or an exception otherwise.

Parameters

  [in] | g | Input Point geometry
  [out] | x | Pointer to hold return value

Returns
  1 on success, 0 on exception

Since
  2.2

## GEOSGeomGetX_r()

int GEOSGeomGetX_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | x )

extern

See also
  GEOSGeomGetX

## GEOSGeomGetY()

int GEOSGeomGetY | ( | const GEOSGeometry * | g,
|  | double * | y )

extern

Returns the Y coordinate, for a Point input, or an exception otherwise.

Parameters

  [in] | g | Input Point geometry
  [out] | y | Pointer to hold return value

Returns
  1 on success, 0 on exception

Since
  2.2

## GEOSGeomGetY_r()

int GEOSGeomGetY_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | y )

extern

See also
  GEOSGeomGetY

## GEOSGeomGetZ()

int GEOSGeomGetZ | ( | const GEOSGeometry * | g,
|  | double * | z )

extern

Returns the Z coordinate, for a Point input, or an exception otherwise.

Parameters

  [in] | g | Input Point geometry
  [out] | z | Pointer to hold return value

Returns
  1 on success, 0 on exception

Since
  3.7

## GEOSGeomGetZ_r()

int GEOSGeomGetZ_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | z )

extern

See also
  GEOSGeomGetZ

## GEOSGeomToHEX_buf()

unsigned char * GEOSGeomToHEX_buf | ( | const GEOSGeometry * | g,
|  | size_t * | size )

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_writeHEX()

## GEOSGeomToHEX_buf_r()

unsigned char * GEOSGeomToHEX_buf_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | size_t * | size )

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_writeHEX_r()

## GEOSGeomToWKB_buf()

unsigned char * GEOSGeomToWKB_buf | ( | const GEOSGeometry * | g,
|  | size_t * | size )

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_write()

## GEOSGeomToWKB_buf_r()

unsigned char * GEOSGeomToWKB_buf_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | size_t * | size )

extern

Deprecated
  use GEOSWKBWriter and GEOSWKBWriter_write_r()

## GEOSGeomToWKT()

char * GEOSGeomToWKT | ( | const GEOSGeometry * | g | ) |

extern

Deprecated
  use GEOSWKTWriter and GEOSWKTWriter_write()

## GEOSGeomToWKT_r()

char * GEOSGeomToWKT_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

Deprecated
  use GEOSWKTWriter and GEOSWKTWriter_write_r()

## GEOSGeomType()

char * GEOSGeomType | ( | const GEOSGeometry * | g | ) |

extern

Returns the geometry type string for this geometry. eg: "GeometryCollection", "LineString"

Parameters

  g | Input geometry

Returns
  A string with the geometry type. Caller must free with GEOSFree(). NULL on exception.

Since
  2.2

## GEOSGeomType_r()

char * GEOSGeomType_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeomType

## GEOSGeomTypeId()

int GEOSGeomTypeId | ( | const GEOSGeometry * | g | ) |

extern

Returns the GEOSGeomTypeId number for this geometry.

Parameters

  g | Input geometry

Returns
  The geometry type number, or -1 on exception.

Since
  2.2

## GEOSGeomTypeId_r()

int GEOSGeomTypeId_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGeomTypeId

## GEOSGetCentroid()

GEOSGeometry * GEOSGetCentroid | ( | const GEOSGeometry * | g | ) |

extern

Returns a point at the center of mass of the input.

Parameters

  g | The input geometry

Returns
  A point at the center of mass of the input Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::Centroid

Since
  2.2

## GEOSGetCentroid_r()

GEOSGeometry * GEOSGetCentroid_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGetCentroid

## GEOSGetExteriorRing()

const GEOSGeometry * GEOSGetExteriorRing | ( | const GEOSGeometry * | g | ) |

extern

Get the external ring of a Polygon.

Note
  Returned object is a pointer to internal storage: it must NOT be destroyed directly.

Parameters

  g | Input Polygon geometry

Returns
  LinearRing geometry. Owned by parent geometry, do not free. NULL on exception.

Since
  2.2

## GEOSGetExteriorRing_r()

const GEOSGeometry * GEOSGetExteriorRing_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGetExteriorRing

## GEOSGetGeometryN()

const GEOSGeometry * GEOSGetGeometryN | ( | const GEOSGeometry * | g,
|  | int | n )

extern

Returns the specified sub-geometry of a collection. For a simple geometry, returns a pointer to the input. Returned object is a pointer to internal storage: it must NOT be destroyed directly.

Parameters

  g | Input geometry
  n | Sub-geometry index, zero-based

Returns
  A const GEOSGeometry, do not free! It will be freed when the parent is freed. Returns NULL on exception.

Note
  Up to GEOS 3.2.0 the input geometry must be a Collection, in later versions it doesn't matter (getGeometryN(0) for a single will return the input).

Since
  2.2

## GEOSGetGeometryN_r()

const GEOSGeometry * GEOSGetGeometryN_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | int | n )

extern

See also
  GEOSGetGeometryN

## GEOSGetInteriorRingN()

const GEOSGeometry * GEOSGetInteriorRingN | ( | const GEOSGeometry * | g,
|  | int | n )

extern

Returns the N'th ring for a Polygon input.

Note
  Returned object is a pointer to internal storage: it must NOT be destroyed directly.

Parameters

  g | Input Polygon geometry
  n | Index of the desired ring

Returns
  LinearRing geometry. Owned by parent geometry, do not free. NULL on exception.

Since
  2.2

## GEOSGetInteriorRingN_r()

const GEOSGeometry * GEOSGetInteriorRingN_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | int | n )

extern

See also
  GEOSGetInteriorRingN

## GEOSGetNumCoordinates()

int GEOSGetNumCoordinates | ( | const GEOSGeometry * | g | ) |

extern

Get the total number of points in a geometry, of any type.

Parameters

  g | Input geometry

Returns
  Number of points in the geometry. -1 on exception.

Since
  2.2

## GEOSGetNumCoordinates_r()

int GEOSGetNumCoordinates_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGetNumCoordinates

## GEOSGetNumGeometries()

int GEOSGetNumGeometries | ( | const GEOSGeometry * | g | ) |

extern

Returns the number of sub-geometries immediately under a multi-geometry or collection or 1 for a simple geometry. For nested collections, remember to check if returned sub-geometries are themselves also collections. Empty collection or multi-geometry types return 0, and empty simple geometry types return 1.

Parameters

  g | Input geometry

Returns
  Number of direct children in this collection

Warning
  For GEOS < 3.2 this function may crash when fed simple geometries

Since
  2.2

## GEOSGetNumGeometries_r()

int GEOSGetNumGeometries_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGetNumGeometries

## GEOSGetNumInteriorRings()

int GEOSGetNumInteriorRings | ( | const GEOSGeometry * | g | ) |

extern

Returns the number of interior rings, for a Polygon input, or an exception otherwise.

Parameters

  g | Input Polygon geometry

Returns
  Number of interior rings, -1 on exception

Since
  2.2

## GEOSGetNumInteriorRings_r()

int GEOSGetNumInteriorRings_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGetNumInteriorRings

## GEOSGetSRID()

int GEOSGetSRID | ( | const GEOSGeometry * | g | ) |

extern

Returns the "spatial reference id" (SRID) for this geometry.

Parameters

  g | Input geometry

Returns
  SRID number or 0 if unknown / not set.

Since
  2.2

## GEOSGetSRID_r()

int GEOSGetSRID_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSGetSRID

## GEOSGridIntersectionFractions()

int GEOSGridIntersectionFractions | ( | const GEOSGeometry * | g,
|  | double | xmin,
|  | double | ymin,
|  | double | xmax,
|  | double | ymax,
|  | unsigned | nx,
|  | unsigned | ny,
|  | float * | buf )

extern

Determine the fraction of each cell in a rectangular grid that is covered by a polygon.

Parameters

  g | The input geometry
  xmin | Left bound of grd
  ymin | Lower bound of grid
  xmax | Right bound of grid
  ymax | Upper bound of grid
  nx | number of columns in grid
  ny | number of rows in grid
  buf | a buffer of size nx*ny to which the grid cell coverage fractions will be written in row-major order

Returns
  1 if the operation was successful, 0 on exception

Since
  3.14.0

## GEOSGridIntersectionFractions_r()

int GEOSGridIntersectionFractions_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | xmin,
|  | double | ymin,
|  | double | xmax,
|  | double | ymax,
|  | unsigned | nx,
|  | unsigned | ny,
|  | float * | buf )

extern

See also
  GEOSGridIntersectionFractions

## GEOSHasM()

char GEOSHasM | ( | const GEOSGeometry * | g | ) |

extern

Tests whether the input geometry has M coordinates.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.12

## GEOSHasM_r()

char GEOSHasM_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSHasM

## GEOSHasZ()

char GEOSHasZ | ( | const GEOSGeometry * | g | ) |

extern

Tests whether the input geometry has Z coordinates.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  2.2

## GEOSHasZ_r()

char GEOSHasZ_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSHasZ

## GEOSHausdorffDistance()

int GEOSHausdorffDistance | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

Calculate the Hausdorff distance between two geometries. Hausdorff distance is the largest distance between two geometries.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry
  [out] | dist | Pointer to be filled in with distance result

Returns
  1 on success, 0 on exception.

See also
  geos::algorithm::distance::DiscreteHausdorffDistance

Since
  3.2

## GEOSHausdorffDistance_r()

int GEOSHausdorffDistance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

See also
  GEOSHausdorffDistance

## GEOSHausdorffDistanceDensify()

int GEOSHausdorffDistanceDensify | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | densifyFrac,
|  | double * | dist )

extern

Calculate a more precise Hausdorff distance between two geometries, by densifying the inputs before computation. Hausdorff distance is the largest distance between two geometries.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry
  [in] | densifyFrac | The largest % of the overall line length that any given two-point segment should be
  [out] | dist | Pointer to be filled in with distance result

Returns
  1 on success, 0 on exception.

See also
  geos::algorithm::distance::DiscreteHausdorffDistance

Since
  3.2

## GEOSHausdorffDistanceDensify_r()

int GEOSHausdorffDistanceDensify_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | densifyFrac,
|  | double * | dist )

extern

See also
  GEOSHausdorffDistanceDensify

## GEOSHilbertCode()

int GEOSHilbertCode | ( | const GEOSGeometry * | geom,
|  | const GEOSGeometry * | extent,
|  | unsigned int | level,
|  | unsigned int * | code )

extern

Calculate the Hilbert code of the centroid of a geometry relative to an extent. This allows sorting geometries in a deterministic way, such that similar Hilbert codes are likely to be near each other in two-dimensional space. The caller must ensure that the geometry is contained within the extent.

Parameters

  [in] | geom | Input geometry, must be non-empty
  [in] | extent | Extent within which to calculate the Hilbert code for geom
  [in] | level | The level of precision of the Hilbert curve, up to 16
  [out] | code | Pointer to be filled in with Hilbert code result

Returns
  1 on success, 0 on exception.

Since
  3.11

## GEOSHilbertCode_r()

int GEOSHilbertCode_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | geom,
|  | const GEOSGeometry * | extent,
|  | unsigned int | level,
|  | unsigned int * | code )

extern

See also
  GEOSHilbertCode

## GEOSInterpolate()

GEOSGeometry * GEOSInterpolate | ( | const GEOSGeometry * | line,
|  | double | d )

extern

Measuring from start of line, return point that is distance the start. Line parameter must be a LineString. The returned point is not guaranteed to intersect the line due to limitations of floating point calculations.

Parameters

  line | linear target of projection
  d | distance from start of line to created point

Returns
  The point GEOSGeometry that is distance from the start of line. Caller takes ownership of returned geometry.

Since
  3.2

## GEOSInterpolate_r()

GEOSGeometry * GEOSInterpolate_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | line,
|  | double | d )

extern

See also
  GEOSInterpolate

## GEOSInterpolateNormalized()

GEOSGeometry * GEOSInterpolateNormalized | ( | const GEOSGeometry * | line,
|  | double | proportion )

extern

Measuring from start of line, return point that is a proportion the start. Line parameter must be a LineString.

Parameters

  line | linear target of projection
  proportion | The proportion from the start of line to created point

Returns
  The point GEOSGeometry that is distance from the start of line. Caller takes ownership of returned geometry.

Since
  3.2

## GEOSInterpolateNormalized_r()

GEOSGeometry * GEOSInterpolateNormalized_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | d )

extern

See also
  GEOSInterpolateNormalized

## GEOSIntersection()

GEOSGeometry * GEOSIntersection | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Returns the intersection of two geometries: the set of points that fall within both geometries.

Parameters

  g1 | one of the geometries
  g2 | the other geometry

Returns
  A newly allocated geometry of the intersection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  2.2

## GEOSIntersection_r()

GEOSGeometry * GEOSIntersection_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSIntersection

## GEOSIntersectionPrec()

GEOSGeometry * GEOSIntersectionPrec | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | gridSize )

extern

Returns the intersection of two geometries: the set of points that fall within both geometries. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry.

Parameters

  g1 | one of the geometries
  g2 | the other geometry
  gridSize | the cell size of the precision grid

Returns
  A newly allocated geometry of the intersection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  3.9

## GEOSIntersectionPrec_r()

GEOSGeometry * GEOSIntersectionPrec_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | gridSize )

extern

See also
  GEOSIntersectionPrec

## GEOSIntersects()

char GEOSIntersects | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if two geometries intersect.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::intersects

Since
  2.2

## GEOSIntersects_r()

char GEOSIntersects_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSIntersects

## GEOSisClosed()

char GEOSisClosed | ( | const GEOSGeometry * | g | ) |

extern

Tests whether the input geometry is closed. A closed geometry is a linestring or multilinestring with the start and end points being the same.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.3

## GEOSisClosed_r()

char GEOSisClosed_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSisClosed

## GEOSisEmpty()

char GEOSisEmpty | ( | const GEOSGeometry * | g | ) |

extern

Tests whether the input geometry is empty. If the geometry or any component is non-empty, the geometry is non-empty. An empty geometry has no boundary or interior.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  2.2

## GEOSisEmpty_r()

char GEOSisEmpty_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSisEmpty

## GEOSisRing()

char GEOSisRing | ( | const GEOSGeometry * | g | ) |

extern

Tests whether the input geometry is a ring. Rings are linestrings, without self-intersections, with start and end point being identical.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  2.2

## GEOSisRing_r()

char GEOSisRing_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSisRing

## GEOSisSimple()

char GEOSisSimple | ( | const GEOSGeometry * | g | ) |

extern

Tests whether the input geometry is "simple". Mostly relevant for linestrings. A "simple" linestring has no self-intersections.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

Since
  2.2

## GEOSisSimple_r()

char GEOSisSimple_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSisSimple

## GEOSisSimpleDetail()

char GEOSisSimpleDetail | ( | const GEOSGeometry * | g,
|  | int | findAllLocations,
|  | GEOSGeometry ** | locations )

extern

In one step, calculate and return whether a geometry is simple and one more more points at which the geometry self-intersects at interior points. Caller has the responsibility to destroy 'location' with GEOSGeom_destroy()

Parameters

  g | The geometry to test
  findAllLocations | Whether to return all self-intersection locations, or just one
  locations | A pointer in which the location GEOSGeometry will be placed

Returns
  1 when simple, 0 when non-simple, 2 on exception

Since
  3.14

## GEOSisSimpleDetail_r()

char GEOSisSimpleDetail_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | int | findAllLocations,
|  | GEOSGeometry ** | location )

extern

See also
  GEOSisSimpleDetail

## GEOSisValid()

char GEOSisValid | ( | const GEOSGeometry * | g | ) |

extern

Check the validity of the provided geometry.

- All points are valid.
- All non-zero-length linestrings are valid.
- Polygon rings must be non-self-intersecting, and interior rings contained within exterior rings.
- Multi-polygon components may not touch or overlap.

Parameters

  g | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::operation::valid::isValidOp

Since
  2.2

## GEOSisValid_r()

char GEOSisValid_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSisValid

## GEOSisValidDetail()

char GEOSisValidDetail | ( | const GEOSGeometry * | g,
|  | int | flags,
|  | char ** | reason,
|  | GEOSGeometry ** | location )

extern

In one step, calculate and return the validity, the human readable validity reason and a point at which validity rules are broken. Caller has the responsibility to destroy 'reason' with GEOSFree() and 'location' with GEOSGeom_destroy()

Parameters

  g | The geometry to test
  flags | A value from the GEOSValidFlags enum
  reason | A pointer in which the reason string will be places
  location | A pointer in which the location GEOSGeometry will be placed

Returns
  1 when valid, 0 when invalid, 2 on exception

Since
  3.3

## GEOSisValidDetail_r()

char GEOSisValidDetail_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | int | flags,
|  | char ** | reason,
|  | GEOSGeometry ** | location )

extern

See also
  GEOSisValidDetail

## GEOSisValidReason()

char * GEOSisValidReason | ( | const GEOSGeometry * | g | ) |

extern

Return the human readable reason a geometry is invalid, "Valid Geometry" string otherwise, or NULL on exception.

Parameters

  g | The geometry to test

Returns
  A string with the reason, NULL on exception. Caller must GEOSFree() their result.

Since
  3.1

## GEOSisValidReason_r()

char * GEOSisValidReason_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSisValidReason

## GEOSLargestEmptyCircle()

GEOSGeometry * GEOSLargestEmptyCircle | ( | const GEOSGeometry * | obstacles,
|  | const GEOSGeometry * | boundary,
|  | double | tolerance )

extern

Constructs the "largest empty circle" (LEC) for a set of obstacle geometries and within a polygonal boundary, with accuracy to to a specified distance tolerance. The obstacles may be any collection of points, lines and polygons. The LEC is the largest circle whose interior does not intersect with any obstacle. and which has its center inside the given boundary. If no boundary is provided, the convex hull of the obstacles is used. The LEC center is the point in the interior of the boundary which has the farthest distance from the obstacles (up to the given distance tolerance). The LEC is determined by the center point and a point indicating the circle radius (which will lie on an obstacle).
To compute an LEC which lies wholly within a polygonal boundary, include the boundary of the polygon(s) as a linear obstacle.
The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes.
Returns the LEC radius as a two-point linestring, with the start point at the center of the inscribed circle and the end on the boundary of the circle.

Parameters

  obstacles | The geometries that the LEC must not cross
  boundary | The area to contain the LEC center (may be null or empty)
  tolerance | Stop the algorithm when the search area is smaller than this tolerance

Returns
  A newly allocated geometry of the LEC radius line. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::construct::LargestEmptyCircle

Since
  3.9

## GEOSLargestEmptyCircle_r()

GEOSGeometry * GEOSLargestEmptyCircle_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | const GEOSGeometry * | boundary,
|  | double | tolerance )

extern

See also
  GEOSLargestEmptyCircle

## GEOSLength()

int GEOSLength | ( | const GEOSGeometry * | g,
|  | double * | length )

extern

Calculate the length of a geometry.

Parameters

  [in] | g | Input geometry
  [out] | length | Pointer to be filled in with length result

Returns
  1 on success, 0 on exception.

Since
  2.2

## GEOSLength_r()

int GEOSLength_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | length )

extern

See also
  GEOSLength

## GEOSLineMerge()

GEOSGeometry * GEOSLineMerge | ( | const GEOSGeometry * | g | ) |

extern

Merges a set of LineStrings, joining them at nodes which have cardinality 2. Lines may have their direction reversed.

Parameters

  g | The input linework

Returns
  The merged linework. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::linemerge::LineMerger

Since
  2.2

## GEOSLineMerge_r()

GEOSGeometry * GEOSLineMerge_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSLineMerge

## GEOSLineMergeDirected()

GEOSGeometry * GEOSLineMergeDirected | ( | const GEOSGeometry * | g | ) |

extern

Merges a set of LineStrings, joining them at nodes which have cardinality 2. and where the lines have the same direction. This means that lines do not have their direction reversed.

Parameters

  g | The input linework

Returns
  The merged linework. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::linemerge::LineMerger

Since
  3.11

## GEOSLineMergeDirected_r()

GEOSGeometry * GEOSLineMergeDirected_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSLineMergeDirected

## GEOSLineSubstring()

GEOSGeometry * GEOSLineSubstring | ( | const GEOSGeometry * | g,
|  | double | start_fraction,
|  | double | end_fraction )

extern

Computes the line which is the section of the input LineString starting and ending at the given length fractions.

Parameters

  g | The input LineString
  start_fraction | start fraction (0-1) along the length of g
  end_fraction | end fraction (0-1) along the length of g

Returns
  selected substring. Caller is responsible for freeing with GEOSGeom_destroy()

Since
  3.12

## GEOSLineSubstring_r()

GEOSGeometry * GEOSLineSubstring_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | start_fraction,
|  | double | end_fdraction )

extern

See also
  GEOSLineSubstring

## GEOSMakeValid()

GEOSGeometry * GEOSMakeValid | ( | const GEOSGeometry * | g | ) |

extern

Repair an invalid geometry, returning a valid output.

Parameters

  g | The geometry to repair

Returns
  The repaired geometry. Caller must free with GEOSGeom_destroy().

Since
  3.8

## GEOSMakeValid_r()

GEOSGeometry * GEOSMakeValid_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSMakeValid

## GEOSMakeValidParams_create()

GEOSMakeValidParams * GEOSMakeValidParams_create | ( | void |  | ) |

extern

Create a GEOSMakeValidParams to hold the desired parameters to control the algorithm and behavior of the validation process.

Returns
  a parameter object

See also
  GEOSMakeValidWithParams

Since
  3.10

## GEOSMakeValidParams_create_r()

GEOSMakeValidParams * GEOSMakeValidParams_create_r | ( | GEOSContextHandle_t | extHandle | ) |

extern

See also
  GEOSMakeValidParams_create

## GEOSMakeValidParams_destroy()

void GEOSMakeValidParams_destroy | ( | GEOSMakeValidParams * | parms | ) |

extern

Destroy a GEOSMakeValidParams.

Parameters

  parms | the object to destroy

See also
  GEOSMakeValidWithParams

Since
  3.10

## GEOSMakeValidParams_destroy_r()

void GEOSMakeValidParams_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSMakeValidParams * | parms )

extern

See also
  GEOSMakeValidParams_destroy

## GEOSMakeValidParams_setKeepCollapsed()

int GEOSMakeValidParams_setKeepCollapsed | ( | GEOSMakeValidParams * | p,
|  | int | keepCollapsed )

extern

When this parameter is nn-zero, the GEOS_MAKE_VALID_STRUCTURE method will keep components that have collapsed into a lower dimensionality. For example, a ring collapsing to a line, or a line collapsing to a point.

Returns
  0 on exception, 1 on success.

See also
  GEOSMakeValidWithParams

Since
  3.10

## GEOSMakeValidParams_setKeepCollapsed_r()

int GEOSMakeValidParams_setKeepCollapsed_r | ( | GEOSContextHandle_t | handle,
|  | GEOSMakeValidParams * | p,
|  | int | style )

extern

See also
  GEOSMakeValidParams_setKeepCollapsed

## GEOSMakeValidParams_setMethod()

int GEOSMakeValidParams_setMethod | ( | GEOSMakeValidParams * | p,
|  | enum GEOSMakeValidMethods | method )

extern

Set the GEOSMakeValidMethods to use in making the geometry valid.

Returns
  0 on exception, 1 on success.

See also
  GEOSMakeValidWithParams

Since
  3.10

## GEOSMakeValidParams_setMethod_r()

int GEOSMakeValidParams_setMethod_r | ( | GEOSContextHandle_t | handle,
|  | GEOSMakeValidParams * | p,
|  | enum GEOSMakeValidMethods | method )

extern

See also
  GEOSMakeValidParams_setMethod

## GEOSMakeValidWithParams()

GEOSGeometry * GEOSMakeValidWithParams | ( | const GEOSGeometry * | g,
|  | const GEOSMakeValidParams * | makeValidParams )

extern

Repair an invalid geometry, returning a valid output, using the indicated GEOSMakeValidMethods algorithm and options.

Parameters

  g | is the geometry to test.
  makeValidParams | is a GEOSMakeValidParams with the desired parameters set on it.

Returns
  A repaired geometry. Caller must free with GEOSGeom_destroy().

See also
  GEOSMakeValidParams_create
  GEOSMakeValidParams_destroy
  GEOSMakeValidParams_setMethod
  GEOSMakeValidParams_setKeepCollapsed

Since
  3.10

## GEOSMakeValidWithParams_r()

GEOSGeometry * GEOSMakeValidWithParams_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | const GEOSMakeValidParams * | makeValidParams )

extern

See also
  GEOSMakeValidWithParams

## GEOSMaximumInscribedCircle()

GEOSGeometry * GEOSMaximumInscribedCircle | ( | const GEOSGeometry * | g,
|  | double | tolerance )

extern

Constructs the "maximum inscribed circle" (MIC) for a polygonal geometry, up to a specified tolerance. The MIC is determined by a point in the interior of the area which has the farthest distance from the area boundary, along with a boundary point at that distance. In the context of geography the center of the MIC is known as the "pole of inaccessibility". A cartographic use case is to determine a suitable point to place a map label within a polygon. The radius length of the MIC is a measure of how "narrow" a polygon is. It is the distance at which the negative buffer becomes empty. The class supports polygons with holes and multipolygons. The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes. Returns a two-point linestring, with one point at the center of the inscribed circle and the other on the boundary of the inscribed circle.

Parameters

  g | Input geometry
  tolerance | Stop the algorithm when the search area is smaller than this tolerance

Returns
  A newly allocated geometry of the MIC. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::construct::MaximumInscribedCircle

Since
  3.9

## GEOSMaximumInscribedCircle_r()

GEOSGeometry * GEOSMaximumInscribedCircle_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | tolerance )

extern

See also
  GEOSMaximumInscribedCircle

## GEOSMinimumBoundingCircle()

GEOSGeometry * GEOSMinimumBoundingCircle | ( | const GEOSGeometry * | g,
|  | double * | radius,
|  | GEOSGeometry ** | center )

extern

Returns a geometry which represents the "minimum bounding circle", the smallest circle that contains the input.

Parameters

  [in] | g | The input geometry
  [out] | radius | Pointer will be filled with output radius.
  [out] | center | Pointer will be filled with output circle center. Caller must free.

Returns
  The circle geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::MinimumBoundingCircle::getCircle

Since
  3.8

## GEOSMinimumBoundingCircle_r()

GEOSGeometry * GEOSMinimumBoundingCircle_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | radius,
|  | GEOSGeometry ** | center )

extern

See also
  GEOSMinimumBoundingCircle

## GEOSMinimumClearance()

int GEOSMinimumClearance | ( | const GEOSGeometry * | g,
|  | double * | d )

extern

Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with repeated points. If a geometry has a minimum clearance of 'eps', it can be said that:

- No two distinct vertices in the geometry are separated by less than 'eps'
- No vertex is closer than 'eps' to a line segment of which it is not an endpoint.

If the minimum clearance cannot be defined for a geometry (such as with a single point, or a multipoint whose points are identical, a value of Infinity will be calculated.

Parameters

  g | the input geometry
  d | a double to which the result can be stored

Returns
  0 if no exception occurred. 2 if an exception occurred.

See also
  geos::precision::MinimumClearance

Since
  3.6

## GEOSMinimumClearance_r()

int GEOSMinimumClearance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double * | distance )

extern

See also
  GEOSMinimumClearance

## GEOSMinimumClearanceLine()

GEOSGeometry * GEOSMinimumClearanceLine | ( | const GEOSGeometry * | g | ) |

extern

Returns a LineString whose endpoints define the minimum clearance of a geometry. If the geometry has no minimum clearance, an empty LineString will be returned.

Parameters

  g | the input geometry

Returns
  a linestring geometry, or NULL if an exception occurred. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::precision::MinimumClearance

Since
  3.6

## GEOSMinimumClearanceLine_r()

GEOSGeometry * GEOSMinimumClearanceLine_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSMinimumClearanceLine

## GEOSMinimumRotatedRectangle()

GEOSGeometry * GEOSMinimumRotatedRectangle | ( | const GEOSGeometry * | g | ) |

extern

Returns the minimum rotated rectangular POLYGON which encloses the input geometry. The rectangle has width equal to the minimum diameter, and a longer length. If the convex hill of the input is degenerate (a line or point) a linestring or point is returned. The minimum rotated rectangle can be used as an extremely generalized representation for the given geometry.

Parameters

  g | The input geometry

Returns
  A newly allocated geometry of the rotated envelope. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.6

## GEOSMinimumRotatedRectangle_r()

GEOSGeometry * GEOSMinimumRotatedRectangle_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSMinimumRotatedRectangle

## GEOSMinimumWidth()

GEOSGeometry * GEOSMinimumWidth | ( | const GEOSGeometry * | g | ) |

extern

Returns a linestring geometry which represents the minimum diameter of the geometry. The minimum diameter is defined to be the width of the smallest band that contains the geometry, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the geometry can be moved through, with a single rotation.

Parameters

  g | The input geometry

Returns
  A newly allocated geometry of the LEC. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::MinimumDiameter

Since
  3.6

## GEOSMinimumWidth_r()

GEOSGeometry * GEOSMinimumWidth_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSMinimumWidth

## GEOSNearestPoints()

GEOSCoordSequence * GEOSNearestPoints | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

The closest points of the two geometries. The first point comes from g1 geometry and the second point comes from g2.

Parameters

  [in] | g1 | Input geometry
  [in] | g2 | Input geometry

Returns
  A coordinate sequence with the two points, or NULL on exception. Caller must free with GEOSCoordSeq_destroy().

Since
  3.5

## GEOSNearestPoints_r()

GEOSCoordSequence * GEOSNearestPoints_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSNearestPoints

## GEOSNode()

GEOSGeometry * GEOSNode | ( | const GEOSGeometry * | g | ) |

extern

For linear inputs, returns a new geometry in which no lines cross each other, and all touching occurs at end points.

Parameters

  g | The input geometry

Returns
  The noded geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::noding::GeometryNoder::node

Since
  3.4

## GEOSNode_r()

GEOSGeometry * GEOSNode_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSNode

## GEOSNormalize()

int GEOSNormalize | ( | GEOSGeometry * | g | ) |

extern

Organize the elements, rings, and coordinate order of geometries in a consistent way, so that geometries that represent the same object can be easily compared. Modifies the geometry in-place.

Normalization ensures the following:

- Lines are oriented to have smallest coordinate first (apart from duplicate endpoints)
- Rings start with their smallest coordinate (using XY ordering)
- Polygon shell rings are oriented CW, and holes CCW
- Collection elements are sorted by their first coordinate

Use before calling GEOSEqualsExact to avoid false "not equal" results.

Parameters

  g | Input geometry

Returns
  0 on success or -1 on exception

Since
  3.0

## GEOSNormalize_r()

int GEOSNormalize_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | g )

extern

See also
  GEOSNormalize

## GEOSOffsetCurve()

GEOSGeometry * GEOSOffsetCurve | ( | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs,
|  | int | joinStyle,
|  | double | mitreLimit )

extern

Generates offset curve line(s) for a geometry. Handles all geometry types as input.

- For a LineString the result is a LineString.
- For a Point the result is an empty LineString.
- For a Polygon the result is the boundary lines(s) of the polygon buffered to the offset distance (which may be a MultiLineString).
- For a collection the result is a collection of the element offset curves.
  Parameters

    g | The linear geometry to offset from
    width | Distance to offset from the curve. Negative for a right-side offset. Positive for a left-side offset.
    quadsegs | Number of segments per quadrant
    joinStyle | See GEOSBufJoinStyles
    mitreLimit | See GEOSBufferParams_setMitreLimit

  Returns
    The offset geometry. Returns NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().
  See also
    geos::operation::buffer::BufferBuilder::bufferLineSingleSided
  Since
    3.3

## GEOSOffsetCurve_r()

GEOSGeometry * GEOSOffsetCurve_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs,
|  | int | joinStyle,
|  | double | mitreLimit )

extern

See also
  GEOSOffsetCurve

## GEOSOrientationIndex()

int GEOSOrientationIndex | ( | double | Ax,
|  | double | Ay,
|  | double | Bx,
|  | double | By,
|  | double | Px,
|  | double | Py )

extern

For the points formed by the six input ordinates, walking from A to B and then to P.

Parameters

  Ax | X coordinate of A
  Ay | Y coordinate of A
  Bx | X coordinate of B
  By | Y coordinate of B
  Px | X coordinate of P
  Py | Y coordinate of P

Returns
  -1 if reaching P takes a counter-clockwise (left) turn, 1 if reaching P takes a clockwise (right) turn, 0 if P is collinear with A-B

Since
  3.3

## GEOSOrientationIndex_r()

int GEOSOrientationIndex_r | ( | GEOSContextHandle_t | handle,
|  | double | Ax,
|  | double | Ay,
|  | double | Bx,
|  | double | By,
|  | double | Px,
|  | double | Py )

extern

See also
  GEOSOrientationIndex

## GEOSOrientPolygons()

int GEOSOrientPolygons | ( | GEOSGeometry * | g,
|  | int | exteriorCW )

extern

Enforce a ring orientation on all polygonal elements in the input geometry. Non-polygonal geometries will not be modified.

Parameters

  g | Input geometry
  exteriorCW | if 1, exterior rings will be clockwise and interior rings will be counter-clockwise

Returns
  0 on success or -1 on exception

Since
  3.12

## GEOSOrientPolygons_r()

int GEOSOrientPolygons_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | g,
|  | int | exteriorCW )

extern

See also
  GEOSOrientPolygons

## GEOSOverlaps()

char GEOSOverlaps | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if two geometries share interiors but are neither within nor contained.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::overlaps

Since
  2.2

## GEOSOverlaps_r()

char GEOSOverlaps_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSOverlaps

## GEOSPointOnSurface()

GEOSGeometry * GEOSPointOnSurface | ( | const GEOSGeometry * | g | ) |

extern

Returns a point that is inside the boundary of a polygonal geometry.

Parameters

  g | The input geometry

Returns
  A point that is inside the input Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::algorithm::InteriorPointArea

Since
  2.2

## GEOSPointOnSurface_r()

GEOSGeometry * GEOSPointOnSurface_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSPointOnSurface

## GEOSPolygonHullSimplify()

GEOSGeometry * GEOSPolygonHullSimplify | ( | const GEOSGeometry * | g,
|  | unsigned int | isOuter,
|  | double | vertexNumFraction )

extern

Computes a boundary-respecting hull of a polygonal geometry, with hull shape determined by a target parameter specifying the fraction of the input vertices retained in the result. Larger values produce less concave results. A value of 1 produces the convex hull; a value of 0 produces the original geometry. An outer hull is computed if the parameter is positive, an inner hull is computed if it is negative.

Parameters

  g | the polygonal geometry to process
  isOuter | indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)
  vertexNumFraction | the target fraction of the count of input vertices to retain in result

Returns
  A newly allocated geometry of the concave hull. NULL on exception.

Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::simplify::PolygonHullSimplifier

Since
  3.11

## GEOSPolygonHullSimplify_r()

GEOSGeometry * GEOSPolygonHullSimplify_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | unsigned int | isOuter,
|  | double | vertexNumFraction )

extern

See also
  GEOSPolygonHullSimplify

## GEOSPolygonHullSimplifyMode()

GEOSGeometry * GEOSPolygonHullSimplifyMode | ( | const GEOSGeometry * | g,
|  | unsigned int | isOuter,
|  | unsigned int | parameterMode,
|  | double | parameter )

extern

Computes a topology-preserving simplified hull of a polygonal geometry, with hull shape determined by the parameter, controlled by a parameter mode, which is one defined in GEOSPolygonHullParameterModes. Larger values compute less concave results and a value of 0 produces the original geometry. Either outer or inner hulls can be computed.

Parameters

  g | the polygonal geometry to process
  isOuter | indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)
  parameterMode | the interpretation to apply to the parameter argument; see GEOSPolygonHullParameterModes
  parameter | the target ratio of area difference to original area

Returns
  A newly allocated geometry of the concave hull. NULL on exception.

Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::simplify::PolygonHullSimplifier
  GEOSPolygonHullParameterModes
  GEOSPolygonHullSimplify

Since
  3.11

## GEOSPolygonHullSimplifyMode_r()

GEOSGeometry * GEOSPolygonHullSimplifyMode_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | unsigned int | isOuter,
|  | unsigned int | parameterMode,
|  | double | parameter )

extern

See also
  GEOSPolygonHullSimplifyMode

## GEOSPolygonize()

GEOSGeometry * GEOSPolygonize | ( | const GEOSGeometry *const | geoms[],
|  | unsigned int | ngeoms )

extern

Polygonizes a set of Geometries which contain linework that represents the edges of a planar graph.

All types of Geometry are accepted as input; the constituent linework is extracted as the edges to be polygonized.

The edges must be correctly noded; that is, they must only meet at their endpoints and not overlap anywhere. If your edges are not already noded, run them through GEOSUnaryUnion() first. Polygonization will accept incorrectly noded input but will not form polygons from non-noded edges, and reports them as errors.

The Polygonizer reports the following kinds of errors:

- Dangles - edges which have one or both ends which are not incident on another edge endpoint
- Cut Edges - edges which are connected at both ends but which do not form part of a polygon
- Invalid Ring Lines - edges which form rings which are invalid (e.g. the component lines contain a self-intersection)

Errors are reported to output parameters "cuts", "dangles" and "invalid" (if not-null). Formed polygons are returned as a collection. NULL is returned on exception. All returned geometries must be destroyed by caller.

The GEOSPolygonize_valid() variant allows extracting only polygons which form a valid polygonal result. The set of extracted polygons is guaranteed to be edge-disjoint. This is useful when it is known that the input lines form a valid polygonal geometry (which may include holes or nested polygons).

Parameters

  geoms | Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects.
  ngeoms | Size of the geoms array.

Returns
  The polygonal output geometry. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::polygonize::Polygonizer

Since
  2.2

## GEOSPolygonize_full()

GEOSGeometry * GEOSPolygonize_full | ( | const GEOSGeometry * | input,
|  | GEOSGeometry ** | cuts,
|  | GEOSGeometry ** | dangles,
|  | GEOSGeometry ** | invalid )

extern

Perform the polygonization as GEOSPolygonize() and return the polygonal result as well as all extra outputs.

Parameters

  [in] | input | A single geometry with all the input lines to polygonize.
  [out] | cuts | Pointer to hold "cut edges", connected on both ends but not part of output. Caller must free.
  [out] | dangles | Pointer to hold "dangles", connected one end but not part of output. Caller must free.
  [out] | invalid | Pointer to hold invalid outputs, polygons formed but not valid. Caller must free.

Returns
  The polygonal valid output Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::polygonize::Polygonizer

Since
  3.3

## GEOSPolygonize_full_r()

GEOSGeometry * GEOSPolygonize_full_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | input,
|  | GEOSGeometry ** | cuts,
|  | GEOSGeometry ** | dangles,
|  | GEOSGeometry ** | invalidRings )

extern

See also
  GEOSPolygonize_full

## GEOSPolygonize_r()

GEOSGeometry * GEOSPolygonize_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry *const | geoms[],
|  | unsigned int | ngeoms )

extern

See also
  GEOSPolygonize

## GEOSPolygonize_valid()

GEOSGeometry * GEOSPolygonize_valid | ( | const GEOSGeometry *const | geoms[],
|  | unsigned int | ngeoms )

extern

Has the same polygonizing behavior as GEOSPolygonize(), but returns a result which is a valid polygonal geometry. The result will not contain any edge-adjacent elements.

Parameters

  geoms | Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects.
  ngeoms | Size of the geoms array.

Returns
  The polygonal output geometry. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::polygonize::Polygonizer
  GEOSBuildArea()

Since
  3.8

## GEOSPolygonize_valid_r()

GEOSGeometry * GEOSPolygonize_valid_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry *const | geoms[],
|  | unsigned int | ngems )

extern

See also
  GEOSPolygonize_valid

## GEOSPolygonizer_getCutEdges()

GEOSGeometry * GEOSPolygonizer_getCutEdges | ( | const GEOSGeometry *const | geoms[],
|  | unsigned int | ngeoms )

extern

Perform the polygonization as GEOSPolygonize() but return only the "cut edges", the linear features that are connected at both ends, do not participate in the final polygon.

Parameters

  geoms | Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects.
  ngeoms | Size of the geoms array.

Returns
  The "cut edges" Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::polygonize::Polygonizer

Since
  3.1

## GEOSPolygonizer_getCutEdges_r()

GEOSGeometry * GEOSPolygonizer_getCutEdges_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry *const | geoms[],
|  | unsigned int | ngeoms )

extern

See also
  GEOSPolygonizer_getCutEdges

## GEOSPrepare()

const GEOSPreparedGeometry * GEOSPrepare | ( | const GEOSGeometry * | g | ) |

extern

Create a Prepared Geometry. The caller retains ownership of the base geometry, and after processing is complete, must free both the prepared and the base geometry. (Ideally, destroy the prepared geometry first, as it has an internal reference to the base geometry.)

Parameters

  g | The base geometry to wrap in a prepared geometry.

Returns
  A prepared geometry. Caller is responsible for freeing with GEOSPreparedGeom_destroy()

Since
  3.1

## GEOSPrepare_r()

const GEOSPreparedGeometry * GEOSPrepare_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSPrepare

## GEOSPreparedContains()

char GEOSPreparedContains | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSContains

Since
  3.1

## GEOSPreparedContains_r()

char GEOSPreparedContains_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedContains

## GEOSPreparedContainsProperly()

char GEOSPreparedContainsProperly | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained properly.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSContainsProperly

Since
  3.1

## GEOSPreparedContainsProperly_r()

char GEOSPreparedContainsProperly_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedContainsProperly

## GEOSPreparedContainsXY()

char GEOSPreparedContainsXY | ( | const GEOSPreparedGeometry * | pg1,
|  | double | x,
|  | double | y )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided point is contained.

Parameters

  pg1 | The prepared geometry
  x | x coordinate of point to test
  y | y coordinate of point to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSContains

Since
  3.12

## GEOSPreparedContainsXY_r()

char GEOSPreparedContainsXY_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | double | x,
|  | double | y )

extern

See also
  GEOSPreparedContainsXY

## GEOSPreparedCoveredBy()

char GEOSPreparedCoveredBy | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is covered by.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSCoveredBy

Since
  3.3

## GEOSPreparedCoveredBy_r()

char GEOSPreparedCoveredBy_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedCoveredBy

## GEOSPreparedCovers()

char GEOSPreparedCovers | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry covers.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSCovers

Since
  3.1

## GEOSPreparedCovers_r()

char GEOSPreparedCovers_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedCovers

## GEOSPreparedCrosses()

char GEOSPreparedCrosses | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry crosses.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSCrosses

Since
  3.3

## GEOSPreparedCrosses_r()

char GEOSPreparedCrosses_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedCrosses

## GEOSPreparedDisjoint()

char GEOSPreparedDisjoint | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is disjoint.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSDisjoint

Since
  3.3

## GEOSPreparedDisjoint_r()

char GEOSPreparedDisjoint_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedDisjoint

## GEOSPreparedDistance()

int GEOSPreparedDistance | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

Use a GEOSPreparedGeometry do a high performance calculation to find the distance between the prepared and provided geometry. Useful for situations where one geometry is large and static and needs to be tested against a large number of other geometries.

Parameters

  [in] | pg1 | The prepared geometry
  [in] | g2 | The geometry to test
  [out] | dist | Pointer to store the result in

Returns
  1 on success

Since
  3.9

## GEOSPreparedDistance_r()

int GEOSPreparedDistance_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2,
|  | double * | dist )

extern

See also
  GEOSPreparedDistance

## GEOSPreparedDistanceWithin()

char GEOSPreparedDistanceWithin | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2,
|  | double | dist )

extern

Use a GEOSPreparedGeometry do a high performance calculation to find whether the prepared and provided geometry are within the given max distance. Useful for situations where one geometry is large and static and needs to be tested against a large number of other geometries.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test
  dist | The max distance

Returns
  1 on success

Since
  3.10

## GEOSPreparedDistanceWithin_r()

char GEOSPreparedDistanceWithin_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2,
|  | double | dist )

extern

See also
  GEOSPreparedDistanceWithin

## GEOSPreparedGeom_destroy()

void GEOSPreparedGeom_destroy | ( | const GEOSPreparedGeometry * | g | ) |

extern

Free the memory associated with a GEOSPreparedGeometry. Caller must separately free the base GEOSGeometry used to create the prepared geometry.

Parameters

  g | Prepared geometry to destroy.

Since
  3.1

## GEOSPreparedGeom_destroy_r()

void GEOSPreparedGeom_destroy_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | g )

extern

See also
  GEOSPreparedGeom_destroy

## GEOSPreparedIntersects()

char GEOSPreparedIntersects | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry intersects.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSIntersects

Since
  3.1

## GEOSPreparedIntersects_r()

char GEOSPreparedIntersects_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedIntersects

## GEOSPreparedIntersectsXY()

char GEOSPreparedIntersectsXY | ( | const GEOSPreparedGeometry * | pg1,
|  | double | x,
|  | double | y )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided point intersects.

Parameters

  pg1 | The prepared geometry
  x | x coordinate of point to test
  y | y coordinate of point to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSIntersects

Since
  3.12

## GEOSPreparedIntersectsXY_r()

char GEOSPreparedIntersectsXY_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | double | x,
|  | double | y )

extern

See also
  GEOSPreparedIntersectsXY

## GEOSPreparedNearestPoints()

GEOSCoordSequence * GEOSPreparedNearestPoints | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation to find the nearest points between the prepared and provided geometry.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  A coordinate sequence containing the nearest points, or NULL on exception. The first point in the sequence is from the prepared geometry, and the seconds is from the other argument.

Since
  3.9

## GEOSPreparedNearestPoints_r()

GEOSCoordSequence * GEOSPreparedNearestPoints_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedNearestPoints

## GEOSPreparedOverlaps()

char GEOSPreparedOverlaps | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry overlaps.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSOverlaps

Since
  3.3

## GEOSPreparedOverlaps_r()

char GEOSPreparedOverlaps_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedOverlaps

## GEOSPreparedRelate()

char * GEOSPreparedRelate | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high-performance calculation of the DE9IM relationship between the prepared and provided geometry.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  The DE9IM string

See also
  GEOSPrepare
  GEOSRelate
  GEOSPreparedRelatePattern

Since
  3.13

## GEOSPreparedRelate_r()

char * GEOSPreparedRelate_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedRelate

## GEOSPreparedRelatePattern()

char GEOSPreparedRelatePattern | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2,
|  | const char * | imPattern )

extern

Use a GEOSPreparedGeometry do a high-performance calculation of the DE9IM relationship between the prepared and provided geometry, and compare the relationship to the provided DE9IM pattern. Returns true if the patterns are consistent and false otherwise.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test
  imPattern | The DE9IM pattern to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSPrepare
  GEOSRelatePattern
  GEOSPreparedRelate

Since
  3.13

## GEOSPreparedRelatePattern_r()

char GEOSPreparedRelatePattern_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2,
|  | const char * | im )

extern

See also
  GEOSPreparedRelatePattern

## GEOSPreparedTouches()

char GEOSPreparedTouches | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry touches.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSTouches

Since
  3.3

## GEOSPreparedTouches_r()

char GEOSPreparedTouches_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedTouches

## GEOSPreparedWithin()

char GEOSPreparedWithin | ( | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is within.

Parameters

  pg1 | The prepared geometry
  g2 | The geometry to test

Returns
  1 on true, 0 on false, 2 on exception

See also
  GEOSWithin

Since
  3.3

## GEOSPreparedWithin_r()

char GEOSPreparedWithin_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSPreparedGeometry * | pg1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSPreparedWithin

## GEOSProject()

double GEOSProject | ( | const GEOSGeometry * | line,
|  | const GEOSGeometry * | point )

extern

Distance of point projected onto line from the start of the line.

Parameters

  line | linear target of projection
  point | point to be projected onto 'g'

Returns
  distance along line that point projects to, -1 on exception

Note
  Line parameter must be a LineString.

Since
  3.2

## GEOSProject_r()

double GEOSProject_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | line,
|  | const GEOSGeometry * | point )

extern

See also
  GEOSProject

## GEOSProjectNormalized()

double GEOSProjectNormalized | ( | const GEOSGeometry * | line,
|  | const GEOSGeometry * | point )

extern

Project point to line and calculate the proportion of the line the point is from the start. For example, a point that projects to the middle of a line would be return 0.5.

Parameters

  line | linear target of projection
  point | the point to project

Returns
  The proportion of the overall line length that the projected point falls at.

Since
  3.2

## GEOSProjectNormalized_r()

double GEOSProjectNormalized_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | const GEOSGeometry * | p )

extern

See also
  GEOSProjectNormalized

## GEOSRelate()

char * GEOSRelate | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Calculate the DE9IM string for this geometry pair. The result is a 9-character string containing dimension symbols in the set "012F".

See also
  geos::geom::Geometry::relate

Parameters

  g1 | First geometry in pair
  g2 | Second geometry in pair

Returns
  DE9IM string. Caller is responsible for freeing with GEOSFree(). NULL on exception

Since
  2.2

## GEOSRelate_r()

char * GEOSRelate_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSRelate

## GEOSRelateBoundaryNodeRule()

char * GEOSRelateBoundaryNodeRule | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | int | bnr )

extern

Calculate the DE9IM string for this geometry pair, using the supplied GEOSRelateBoundaryNodeRules.

See also
  geos::geom::Geometry::relate
  geos::algorithm::BoundaryNodeRule

Parameters

  g1 | First geometry in pair
  g2 | Second geometry in pair
  bnr | A member of the GEOSRelateBoundaryNodeRules enum

Returns
  DE9IM string. Caller is responsible for freeing with GEOSFree(). NULL on exception

Since
  3.3

## GEOSRelateBoundaryNodeRule_r()

char * GEOSRelateBoundaryNodeRule_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | int | bnr )

extern

See also
  GEOSRelateBoundaryNodeRule

## GEOSRelatePattern()

char GEOSRelatePattern | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | const char * | imPattern )

extern

Calculate the DE9IM string for a geometry pair and compare against a DE9IM pattern. Returns true if the computed matrix matches the pattern. The pattern is a 9-character string containing symbols in the set "012TF*". "012F" match the corresponding dimension symbol; "T" matches any non-empty dimension; "*" matches any dimension.

See also
  geos::geom::Geometry::relate

Parameters

  g1 | First geometry in pair
  g2 | Second geometry in pair
  imPattern | DE9IM pattern to match

Returns
  1 on true, 0 on false, 2 on exception

Since
  2.2

## GEOSRelatePattern_r()

char GEOSRelatePattern_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | const char * | imPattern )

extern

See also
  GEOSRelatePattern

## GEOSRelatePatternMatch()

char GEOSRelatePatternMatch | ( | const char * | intMatrix,
|  | const char * | imPattern )

extern

Compare a DE9IM string to a pattern and return true if they are consistent.

Parameters

  intMatrix | DE9IM string (contains symbols "012F")
  imPattern | Pattern to match to (may also contain symbols "T" and "*")

Returns
  1 on true, 0 on false, 2 on exception

Since
  3.3

## GEOSRelatePatternMatch_r()

char GEOSRelatePatternMatch_r | ( | GEOSContextHandle_t | handle,
|  | const char * | intMatrix,
|  | const char * | imPattern )

extern

See also
  GEOSRelatePatternMatch

## GEOSRemoveRepeatedPoints()

GEOSGeometry * GEOSRemoveRepeatedPoints | ( | const GEOSGeometry * | g,
|  | double | tolerance )

extern

Works from start of each coordinate sequence in the geometry, retaining points that are further away from the previous retained point than the tolerance value.

Removing repeated points with a non-zero tolerance may result in an invalid geometry being returned. Be sure to check and repair validity.

Returns
  A geometry with all points within the tolerance of each other removed.

Parameters

  g | The geometry to filter
  tolerance | Remove all points within this distance of each other. Use 0.0 to remove only exactly repeated points.

See also
  GEOSMakeValidWithParams

Since
  3.11

## GEOSRemoveRepeatedPoints_r()

GEOSGeometry * GEOSRemoveRepeatedPoints_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | tolerance )

extern

See also
  GEOSRemoveRepeatedPoints

## GEOSReverse()

GEOSGeometry * GEOSReverse | ( | const GEOSGeometry * | g | ) |

extern

For geometries with coordinate sequences, reverses the order of the sequences. Converts CCW rings to CW. Reverses direction of LineStrings.

Parameters

  g | The input geometry

Returns
  The reversed geometry Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.7

## GEOSReverse_r()

GEOSGeometry * GEOSReverse_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSReverse

## GEOSSegmentIntersection()

int GEOSSegmentIntersection | ( | double | ax0,
|  | double | ay0,
|  | double | ax1,
|  | double | ay1,
|  | double | bx0,
|  | double | by0,
|  | double | bx1,
|  | double | by1,
|  | double * | cx,
|  | double * | cy )

extern

Computes the coordinate where two line segments intersect, if any

Parameters

  [in] | ax0 | x-coordinate of 1st point in 1st segment
  [in] | ay0 | y-coordinate of 1st point in 1st segment
  [in] | ax1 | x-coordinate of 2nd point in 1st segment
  [in] | ay1 | y-coordinate of 2nd point in 1st segment
  [in] | bx0 | x-coordinate of 1st point in 2nd segment
  [in] | by0 | y-coordinate of 1st point in 2nd segment
  [in] | bx1 | x-coordinate of 2nd point in 2nd segment
  [in] | by1 | y-coordinate of 2nd point in 2nd segment
  [out] | cx | x-coordinate of intersection point
  [out] | cy | y-coordinate of intersection point

Returns
  0 on error, 1 on success, -1 if segments do not intersect

Since
  3.7

## GEOSSegmentIntersection_r()

int GEOSSegmentIntersection_r | ( | GEOSContextHandle_t | extHandle,
|  | double | ax0,
|  | double | ay0,
|  | double | ax1,
|  | double | ay1,
|  | double | bx0,
|  | double | by0,
|  | double | bx1,
|  | double | by1,
|  | double * | cx,
|  | double * | cy )

extern

See also
  GEOSSegmentIntersection

## GEOSSetSRID()

void GEOSSetSRID | ( | GEOSGeometry * | g,
|  | int | SRID )

extern

Set the "spatial reference id" (SRID) for this geometry.

Parameters

  g | Input geometry
  SRID | SRID number or 0 for unknown SRID.

Since
  2.2

## GEOSSetSRID_r()

void GEOSSetSRID_r | ( | GEOSContextHandle_t | handle,
|  | GEOSGeometry * | g,
|  | int | SRID )

extern

See also
  GEOSSetSRID

## GEOSSharedPaths()

GEOSGeometry * GEOSSharedPaths | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Find paths shared between the two given lineal geometries.

Returns a GeometryCollection having two elements:

- first element is a MultiLineString containing shared paths having the same direction on both inputs
- second element is a MultiLineString containing shared paths having the opposite direction on the two inputs

Parameters

  g1 | An input geometry
  g2 | An input geometry

Returns
  The shared paths Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::sharedpaths::SharedPathsOp

Since
  3.3

## GEOSSharedPaths_r()

GEOSGeometry * GEOSSharedPaths_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSSharedPaths

## GEOSSimplify()

GEOSGeometry * GEOSSimplify | ( | const GEOSGeometry * | g,
|  | double | tolerance )

extern

Apply the Douglas/Peucker algorithm to the coordinate sequences of the input geometry. Removes "unnecessary" vertices, vertices that are co-linear within the tolerance distance.

Parameters

  g | The input geometry
  tolerance | The tolerance to apply. Larger tolerance leads to simpler output.

Returns
  The simplified geometry Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::simplify::DouglasPeuckerSimplifier

Since
  3.0

## GEOSSimplify_r()

GEOSGeometry * GEOSSimplify_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | tolerance )

extern

See also
  GEOSSimplify

## GEOSSingleSidedBuffer()

GEOSGeometry * GEOSSingleSidedBuffer | ( | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs,
|  | int | joinStyle,
|  | double | mitreLimit,
|  | int | leftSide )

extern

Deprecated
  in 3.3.0, use GEOSOffsetCurve() instead

## GEOSSingleSidedBuffer_r()

GEOSGeometry * GEOSSingleSidedBuffer_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | width,
|  | int | quadsegs,
|  | int | joinStyle,
|  | double | mitreLimit,
|  | int | leftSide )

extern

Deprecated
  in 3.3.0, use GEOSOffsetCurve() instead

## GEOSSnap()

GEOSGeometry * GEOSSnap | ( | const GEOSGeometry * | input,
|  | const GEOSGeometry * | snap_target,
|  | double | tolerance )

extern

Snaps the vertices and segments of the first geometry to vertices of the second geometry within the given tolerance.

Where possible, this operation tries to avoid creating invalid geometries; however, it does not guarantee that output geometries will be valid. It is the responsibility of the caller to check for and handle invalid geometries.

Because too much snapping can result in invalid topology being created, heuristics are used to determine the number and location of snapped vertices that are likely safe to snap. These heuristics may omit some potential snaps that are otherwise within the tolerance.

Parameters

  input | An input geometry
  snap_target | A geometry to snap the input to
  tolerance | Snapping tolerance

Returns
  The snapped version of the input. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.3

## GEOSSnap_r()

GEOSGeometry * GEOSSnap_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | tolerance )

extern

See also
  GEOSSnap

## GEOSSTRtree_build()

int GEOSSTRtree_build | ( | GEOSSTRtree * | tree | ) |

extern

Construct an STRtree from items that have been inserted. Once constructed, no more items may be inserted into the tree. Functions that require a constructed tree will build it automatically, so there is no need to call GEOSSTRtree_build unless it is desired to explicitly construct the tree in a certain section of code or using a certain thread.

Parameters

  tree | the GEOSSTRtree to apply the build to

Returns
  1 on success, 0 on error

Since
  3.12

## GEOSSTRtree_build_r()

int GEOSSTRtree_build_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree )

extern

See also
  GEOSSTRtree_build

## GEOSSTRtree_create()

GEOSSTRtree * GEOSSTRtree_create | ( | size_t | nodeCapacity | ) |

extern

Create a new GEOSSTRtree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional spatial data.

Parameters

  nodeCapacity | The maximum number of child nodes that a node may have. The minimum recommended capacity value is 4. If unsure, use a default node capacity of 10.

Returns
  a pointer to the created tree

Since
  3.2

## GEOSSTRtree_create_r()

GEOSSTRtree * GEOSSTRtree_create_r | ( | GEOSContextHandle_t | handle,
|  | size_t | nodeCapacity )

extern

See also
  GEOSSTRtree_create

## GEOSSTRtree_destroy()

void GEOSSTRtree_destroy | ( | GEOSSTRtree * | tree | ) |

extern

Frees all the memory associated with a GEOSSTRtree. Only the tree is freed. The geometries and items fed into GEOSSTRtree_insert() are not owned by the tree, and are still left to the caller to manage.

Parameters

  tree | the GEOSSTRtree to destroy

Since
  3.2

## GEOSSTRtree_destroy_r()

void GEOSSTRtree_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree )

extern

See also
  GEOSSTRtree_destroy

## GEOSSTRtree_insert()

void GEOSSTRtree_insert | ( | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | g,
|  | void * | item )

extern

Insert an item into an GEOSSTRtree

Parameters

  tree | the GEOSSTRtree in which the item should be inserted
  g | a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be copied into the tree and the caller may destroy g while the tree is still in use. Before GEOS 3.9, g must be retained until the tree is destroyed.
  item | the item to insert into the tree

Note
  The tree does not take ownership of the geometry or the item.

Since
  3.2

## GEOSSTRtree_insert_r()

void GEOSSTRtree_insert_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | g,
|  | void * | item )

extern

See also
  GEOSSTRtree_insert

## GEOSSTRtree_iterate()

void GEOSSTRtree_iterate | ( | GEOSSTRtree * | tree,
|  | GEOSQueryCallback | callback,
|  | void * | userdata )

extern

Iterate over all items in the GEOSSTRtree. This will not cause the tree to be constructed.

Parameters

  tree | the STRtree over which to iterate
  callback | a function to be executed for each item in the tree.
  userdata | payload to pass the callback function.

Since
  3.2

## GEOSSTRtree_iterate_r()

void GEOSSTRtree_iterate_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree,
|  | GEOSQueryCallback | callback,
|  | void * | userdata )

extern

See also
  GEOSSTRtree_iterate

## GEOSSTRtree_nearest()

const GEOSGeometry * GEOSSTRtree_nearest | ( | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | geom )

extern

Returns the nearest item in the GEOSSTRtree to the supplied geometry. All items in the tree MUST be of type GEOSGeometry. If this is not the case, use GEOSSTRtree_nearest_generic() instead. The tree will automatically be constructed if necessary, after which no more items may be added.

Parameters

  tree | the GEOSSTRtree to search
  geom | the geometry with which the tree should be queried

Returns
  a const pointer to the nearest GEOSGeometry in the tree to 'geom', or NULL in case of exception

Since
  3.6

## GEOSSTRtree_nearest_generic()

const void * GEOSSTRtree_nearest_generic | ( | GEOSSTRtree * | tree,
|  | const void * | item,
|  | const GEOSGeometry * | itemEnvelope,
|  | GEOSDistanceCallback | distancefn,
|  | void * | userdata )

extern

Returns the nearest item in the GEOSSTRtree to the supplied item The tree will automatically be constructed if necessary, after which no more items may be added.

Parameters

  tree | the STRtree to search
  item | the item with which the tree should be queried
  itemEnvelope | a GEOSGeometry having the bounding box of 'item'
  distancefn | a function that can compute the distance between two items in the STRtree. The function should return zero in case of error, and should store the computed distance to the location pointed to by the distance argument. The computed distance between two items must not exceed the Cartesian distance between their envelopes.
  userdata | optional pointer to arbitrary data; will be passed to distancefn each time it is called.

Returns
  a const pointer to the nearest item in the tree to item, or NULL in case of exception

Since
  3.6

## GEOSSTRtree_nearest_generic_r()

const void * GEOSSTRtree_nearest_generic_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree,
|  | const void * | item,
|  | const GEOSGeometry * | itemEnvelope,
|  | GEOSDistanceCallback | distancefn,
|  | void * | userdata )

extern

See also
  GEOSSTRtree_nearest_generic

## GEOSSTRtree_nearest_r()

const GEOSGeometry * GEOSSTRtree_nearest_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | geom )

extern

See also
  GEOSSTRtree_nearest

## GEOSSTRtree_query()

void GEOSSTRtree_query | ( | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | g,
|  | GEOSQueryCallback | callback,
|  | void * | userdata )

extern

Query a GEOSSTRtree for items intersecting a specified envelope. The tree will automatically be constructed if necessary, after which no more items may be added.

Parameters

  tree | the GEOSSTRtree to search
  g | a GEOSGeomety from which a query envelope will be extracted
  callback | a function to be executed for each item in the tree whose envelope intersects the envelope of 'g'. The callback function should take two parameters: a void pointer representing the located item in the tree, and a void userdata pointer.
  userdata | an optional pointer to pe passed to callback as an argument

Since
  3.2

## GEOSSTRtree_query_r()

void GEOSSTRtree_query_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | g,
|  | GEOSQueryCallback | callback,
|  | void * | userdata )

extern

See also
  GEOSSTRtree_query

## GEOSSTRtree_remove()

char GEOSSTRtree_remove | ( | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | g,
|  | void * | item )

extern

Removes an item from the GEOSSTRtree The tree will automatically be constructed if necessary, after which no more items may be added.

Parameters

  tree | the STRtree from which to remove an item
  g | the envelope of the item to remove
  item | the item to remove

Returns
  0 if the item was not removed; 1 if the item was removed; 2 if an exception occurred

Since
  3.2

## GEOSSTRtree_remove_r()

char GEOSSTRtree_remove_r | ( | GEOSContextHandle_t | handle,
|  | GEOSSTRtree * | tree,
|  | const GEOSGeometry * | g,
|  | void * | item )

extern

See also
  GEOSSTRtree_remove

## GEOSSymDifference()

GEOSGeometry * GEOSSymDifference | ( | const GEOSGeometry * | ga,
|  | const GEOSGeometry * | gb )

extern

Returns the symmetric difference of two geometries A and B: the set of points that fall in A but not within B and the set of points that fall in B but not in A.

Parameters

  ga | geometry A
  gb | geometry B

Returns
  A newly allocated geometry of the symmetric difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  2.2

## GEOSSymDifference_r()

GEOSGeometry * GEOSSymDifference_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSSymDifference

## GEOSSymDifferencePrec()

GEOSGeometry * GEOSSymDifferencePrec | ( | const GEOSGeometry * | ga,
|  | const GEOSGeometry * | gb,
|  | double | gridSize )

extern

Returns the symmetric difference of two geometries A and B: the set of points that fall in A but not within B and the set of points that fall in B but not in A. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry.

Parameters

  ga | one of the geometries
  gb | the other geometry
  gridSize | the cell size of the precision grid

Returns
  A newly allocated geometry of the symmetric difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  3.9

## GEOSSymDifferencePrec_r()

GEOSGeometry * GEOSSymDifferencePrec_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | gridSize )

extern

See also
  GEOSSymDifferencePrec

## GEOSTopologyPreserveSimplify()

GEOSGeometry * GEOSTopologyPreserveSimplify | ( | const GEOSGeometry * | g,
|  | double | tolerance )

extern

Apply the Douglas/Peucker algorithm to the coordinate sequences of the input geometry. Removes "unnecessary" vertices, vertices that are co-linear within the tolerance distance. Returns a valid output geometry, checking for collapses, ring-intersections, etc and attempting to avoid. More computationally expensive than GEOSSimplify()

Parameters

  g | The input geometry
  tolerance | The tolerance to apply. Larger tolerance leads to simpler output.

Returns
  The simplified geometry Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::simplify::DouglasPeuckerSimplifier

Since
  3.0

## GEOSTopologyPreserveSimplify_r()

GEOSGeometry * GEOSTopologyPreserveSimplify_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | tolerance )

extern

See also
  GEOSTopologyPreserveSimplify

## GEOSTouches()

char GEOSTouches | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if two geometries share boundaries at one or more points, but do not have interior points in common.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::touches

Since
  2.2

## GEOSTouches_r()

char GEOSTouches_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSTouches

## GEOSUnaryUnion()

GEOSGeometry * GEOSUnaryUnion | ( | const GEOSGeometry * | g | ) |

extern

Returns the union of all components of a single geometry. Usually used to convert a collection into the smallest set of polygons that cover the same area.

Parameters

  g | The input geometry

Returns
  A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  3.3

## GEOSUnaryUnion_r()

GEOSGeometry * GEOSUnaryUnion_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSUnaryUnion

## GEOSUnaryUnionPrec()

GEOSGeometry * GEOSUnaryUnionPrec | ( | const GEOSGeometry * | g,
|  | double | gridSize )

extern

Returns the union of all components of a single geometry. Usually used to convert a collection into the smallest set of polygons that cover the same area. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry.

Parameters

  g | input geometry
  gridSize | the cell size of the precision grid

Returns
  A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  3.9

## GEOSUnaryUnionPrec_r()

GEOSGeometry * GEOSUnaryUnionPrec_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g,
|  | double | gridSize )

extern

See also
  GEOSUnaryUnionPrec

## GEOSUnion()

GEOSGeometry * GEOSUnion | ( | const GEOSGeometry * | ga,
|  | const GEOSGeometry * | gb )

extern

Returns the union of two geometries A and B: the set of points that fall in A or within B.

Parameters

  ga | geometry A
  gb | geometry B

Returns
  A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  2.2

## GEOSUnion_r()

GEOSGeometry * GEOSUnion_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSUnion

## GEOSUnionCascaded()

GEOSGeometry * GEOSUnionCascaded | ( | const GEOSGeometry * | g | ) |

extern

Deprecated
  in 3.3.0: use GEOSUnaryUnion() instead

## GEOSUnionCascaded_r()

GEOSGeometry * GEOSUnionCascaded_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g )

extern

Deprecated
  in 3.3.0: use GEOSUnaryUnion_r() instead

## GEOSUnionPrec()

GEOSGeometry * GEOSUnionPrec | ( | const GEOSGeometry * | ga,
|  | const GEOSGeometry * | gb,
|  | double | gridSize )

extern

Returns the union of two geometries A and B: the set of points that fall in A or within B. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry.

Parameters

  ga | one of the geometries
  gb | the other geometry
  gridSize | the cell size of the precision grid

Returns
  A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

See also
  geos::operation::overlayng::OverlayNG

Since
  3.9

## GEOSUnionPrec_r()

GEOSGeometry * GEOSUnionPrec_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2,
|  | double | gridSize )

extern

See also
  GEOSUnionPrec

## GEOSversion()

const char * GEOSversion | ( | void |  | ) |

extern

Returns the current GEOS version string. eg: "3.10.0" This function does not have a reentrant variant and is available if GEOS_USE_ONLY_R_API is defined.

Returns
  version string

Since
  2.2

## GEOSVoronoiDiagram()

GEOSGeometry * GEOSVoronoiDiagram | ( | const GEOSGeometry * | g,
|  | const GEOSGeometry * | env,
|  | double | tolerance,
|  | int | flags )

extern

Returns the Voronoi polygons or edges of the vertices of the given geometry.

Parameters

  g | the input geometry whose vertices will be used as sites.
  tolerance | snapping tolerance to use for improved robustness. A tolerance of 0.0 specifies that no snapping will take place. This argument can be finicky and is known to cause the algorithm to fail in several cases. If you're using tolerance and getting a failure, try setting it to 0.0.
  flags | A value from the GEOSVoronoiFlags enum
  env | clipping envelope for the returned diagram, automatically determined if env is NULL. The diagram will be clipped to the larger of this envelope or an envelope surrounding the sites.

Returns
  A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy().

Since
  3.5

## GEOSVoronoiDiagram_r()

GEOSGeometry * GEOSVoronoiDiagram_r | ( | GEOSContextHandle_t | extHandle,
|  | const GEOSGeometry * | g,
|  | const GEOSGeometry * | env,
|  | double | tolerance,
|  | int | flags )

extern

See also
  GEOSVoronoiDiagram

## GEOSWithin()

char GEOSWithin | ( | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

Tests if geometry g1 is completely within g2, but not wholly contained in the boundary of g2.

Parameters

  g1 | Input geometry
  g2 | Input geometry

Returns
  1 on true, 0 on false, 2 on exception

See also
  geos::geom::Geometry::within

Since
  2.2

## GEOSWithin_r()

char GEOSWithin_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSGeometry * | g1,
|  | const GEOSGeometry * | g2 )

extern

See also
  GEOSWithin

## GEOSWKBReader_create()

GEOSWKBReader * GEOSWKBReader_create | ( | void |  | ) |

extern

Allocate a new GEOSWKBReader.

Returns
  a new reader. Caller must free with GEOSWKBReader_destroy()

Since
  3.0

## GEOSWKBReader_create_r()

GEOSWKBReader * GEOSWKBReader_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSWKBReader_create

## GEOSWKBReader_destroy()

void GEOSWKBReader_destroy | ( | GEOSWKBReader * | reader | ) |

extern

Free the memory associated with a GEOSWKBReader.

Parameters

  reader | The reader to destroy.

Since
  3.0

## GEOSWKBReader_destroy_r()

void GEOSWKBReader_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBReader * | reader )

extern

See also
  GEOSWKBReader_destroy

## GEOSWKBReader_read()

GEOSGeometry * GEOSWKBReader_read | ( | GEOSWKBReader * | reader,
|  | const unsigned char * | wkb,
|  | size_t | size )

extern

Read a geometry from a well-known binary buffer.

Parameters

  reader | A GEOSWKBReader
  wkb | A pointer to the buffer to read from
  size | The number of bytes of data in the buffer

Returns
  A GEOSGeometry built from the WKB, or NULL on exception.

Since
  3.0

## GEOSWKBReader_read_r()

GEOSGeometry * GEOSWKBReader_read_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBReader * | reader,
|  | const unsigned char * | wkb,
|  | size_t | size )

extern

See also
  GEOSWKBReader_read

## GEOSWKBReader_readHEX()

GEOSGeometry * GEOSWKBReader_readHEX | ( | GEOSWKBReader * | reader,
|  | const unsigned char * | hex,
|  | size_t | size )

extern

Read a geometry from a hex encoded well-known binary buffer.

Parameters

  reader | A GEOSWKBReader
  hex | A pointer to the buffer to read from
  size | The number of bytes of data in the buffer

Returns
  A GEOSGeometry built from the HEX WKB, or NULL on exception.

Since
  3.0

## GEOSWKBReader_readHEX_r()

GEOSGeometry * GEOSWKBReader_readHEX_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBReader * | reader,
|  | const unsigned char * | hex,
|  | size_t | size )

extern

See also
  GEOSWKBReader_readHEX

## GEOSWKBReader_setFixStructure()

void GEOSWKBReader_setFixStructure | ( | GEOSWKBReader * | reader,
|  | char | doFix )

extern

Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading.

Parameters

  reader | A WKB reader object, caller retains ownership
  doFix | Set to 1 to repair, 0 for no repair (default).

Since
  3.11

## GEOSWKBReader_setFixStructure_r()

void GEOSWKBReader_setFixStructure_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBReader * | reader,
|  | char | doFix )

extern

See also
  GEOSWKBReader_setFixStructure

## GEOSWKBWriter_create()

GEOSWKBWriter * GEOSWKBWriter_create | ( | void |  | ) |

extern

Allocate a new GEOSWKBWriter.

Returns
  a new writer. Caller must free with GEOSWKBWriter_destroy()

Since
  3.0

## GEOSWKBWriter_create_r()

GEOSWKBWriter * GEOSWKBWriter_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSWKBWriter_create

## GEOSWKBWriter_destroy()

void GEOSWKBWriter_destroy | ( | GEOSWKBWriter * | writer | ) |

extern

Free the memory associated with a GEOSWKBWriter.

Parameters

  writer | The writer to destroy.

Since
  3.0

## GEOSWKBWriter_destroy_r()

void GEOSWKBWriter_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer )

extern

See also
  GEOSWKBWriter_destroy

## GEOSWKBWriter_getByteOrder()

int GEOSWKBWriter_getByteOrder | ( | const GEOSWKBWriter * | writer | ) |

extern

Find whether the writer will use WKB byte order that is big or little endian. The return value is a member of GEOSWKBByteOrders.

Parameters

  writer | The writer to read byte order from

Returns
  The current byte order

Since
  3.0

## GEOSWKBWriter_getByteOrder_r()

int GEOSWKBWriter_getByteOrder_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSWKBWriter * | writer )

extern

See also
  GEOSWKBWriter_getByteOrder

## GEOSWKBWriter_getFlavor()

int GEOSWKBWriter_getFlavor | ( | const GEOSWKBWriter * | writer | ) |

extern

Find whether the writer will use WKB that is ISO flavor or "extended" flavor. The flavor determines how extra dimensionality is encoded with the type number, and whether SRID can be included in the WKB. ISO flavor does not support SRID embedding. ISO flavor is "more standard" for 3D output. GEOS can read both flavors. The return value is a member of GEOSWKBFlavors.

Parameters

  writer | The writer to read flavor from

Returns
  The current flavor

Since
  3.10

## GEOSWKBWriter_getFlavor_r()

int GEOSWKBWriter_getFlavor_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSWKBWriter * | writer )

extern

See also
  GEOSWKBWriter_getFlavor

## GEOSWKBWriter_getIncludeSRID()

char GEOSWKBWriter_getIncludeSRID | ( | const GEOSWKBWriter * | writer | ) |

extern

Read the current SRID embedding value from the writer.

Parameters

  writer | The writer to check SRID value on

Since
  3.0

## GEOSWKBWriter_getIncludeSRID_r()

char GEOSWKBWriter_getIncludeSRID_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSWKBWriter * | writer )

extern

See also
  GEOSWKBWriter_getIncludeSRID

## GEOSWKBWriter_getOutputDimension()

int GEOSWKBWriter_getOutputDimension | ( | const GEOSWKBWriter * | writer | ) |

extern

Read the current output dimension of the writer. Either 2, 3, or 4 dimensions. Return current number of dimensions.

Parameters

  writer | The writer to read from.

Returns
  Number of dimensions (2, 3, or 4)

Since
  3.0

## GEOSWKBWriter_getOutputDimension_r()

int GEOSWKBWriter_getOutputDimension_r | ( | GEOSContextHandle_t | handle,
|  | const GEOSWKBWriter * | writer )

extern

See also
  GEOSWKBWriter_getOutputDimension

## GEOSWKBWriter_setByteOrder()

void GEOSWKBWriter_setByteOrder | ( | GEOSWKBWriter * | writer,
|  | int | byteOrder )

extern

Set the output byte order of the writer, using a value from GEOSWKBByteOrders enum.

Parameters

  writer | The writer to set byte order on
  byteOrder | Desired byte order

Since
  3.0

## GEOSWKBWriter_setByteOrder_r()

void GEOSWKBWriter_setByteOrder_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer,
|  | int | byteOrder )

extern

See also
  GEOSWKBWriter_setByteOrder

## GEOSWKBWriter_setFlavor()

void GEOSWKBWriter_setFlavor | ( | GEOSWKBWriter * | writer,
|  | int | flavor )

extern

Set the output flavor of the writer, using a value from GEOSWKBFlavors enum.

Parameters

  writer | The writer to set flavor on
  flavor | Desired flavor

Since
  3.10

## GEOSWKBWriter_setFlavor_r()

void GEOSWKBWriter_setFlavor_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer,
|  | int | flavor )

extern

See also
  GEOSWKBWriter_setFlavor

## GEOSWKBWriter_setIncludeSRID()

void GEOSWKBWriter_setIncludeSRID | ( | GEOSWKBWriter * | writer,
|  | const char | writeSRID )

extern

Specify whether SRID values should be output in WKB. Many WKB readers do not support SRID values, use with caution.

Parameters

  writer | The writer to set SRID output on
  writeSRID | Set to 1 to include SRID, 0 otherwise

Since
  3.0

## GEOSWKBWriter_setIncludeSRID_r()

void GEOSWKBWriter_setIncludeSRID_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer,
|  | const char | writeSRID )

extern

See also
  GEOSWKBWriter_setIncludeSRID

## GEOSWKBWriter_setOutputDimension()

void GEOSWKBWriter_setOutputDimension | ( | GEOSWKBWriter * | writer,
|  | int | newDimension )

extern

Set the output dimensionality of the writer. Either 2, 3, or 4 dimensions. Default since GEOS 3.12 is 4.

Parameters

  writer | The writer to read from.
  newDimension | The dimensionality desired

Since
  3.0

## GEOSWKBWriter_setOutputDimension_r()

void GEOSWKBWriter_setOutputDimension_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer,
|  | int | newDimension )

extern

See also
  GEOSWKBWriter_setOutputDimension

## GEOSWKBWriter_write()

unsigned char * GEOSWKBWriter_write | ( | GEOSWKBWriter * | writer,
|  | const GEOSGeometry * | g,
|  | size_t * | size )

extern

Write out the WKB representation of a geometry.

Parameters

  writer | The GEOSWKBWriter controlling the writing.
  g | Geometry to convert to WKB
  size | Pointer to write the size of the final output WKB to

Returns
  The WKB representation. Caller must free with GEOSFree()

Since
  3.0

## GEOSWKBWriter_write_r()

unsigned char * GEOSWKBWriter_write_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer,
|  | const GEOSGeometry * | g,
|  | size_t * | size )

extern

See also
  GEOSWKBWriter_write

## GEOSWKBWriter_writeHEX()

unsigned char * GEOSWKBWriter_writeHEX | ( | GEOSWKBWriter * | writer,
|  | const GEOSGeometry * | g,
|  | size_t * | size )

extern

Write out the hex WKB representation of a geometry.

Parameters

  writer | The GEOSWKBWriter controlling the writing.
  g | Geometry to convert to WKB
  size | Pointer to write the size of the final output WKB to

Returns
  The HEX WKB representation. Caller must free with GEOSFree()

Since
  3.0

## GEOSWKBWriter_writeHEX_r()

unsigned char * GEOSWKBWriter_writeHEX_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKBWriter * | writer,
|  | const GEOSGeometry * | g,
|  | size_t * | size )

extern

See also
  GEOSWKBWriter_writeHEX

## GEOSWKTReader_create()

GEOSWKTReader * GEOSWKTReader_create | ( | void |  | ) |

extern

Allocate a new GEOSWKTReader.

Returns
  a new reader. Caller must free with GEOSWKTReader_destroy()

Since
  3.0

## GEOSWKTReader_create_r()

GEOSWKTReader * GEOSWKTReader_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSWKTReader_create

## GEOSWKTReader_destroy()

void GEOSWKTReader_destroy | ( | GEOSWKTReader * | reader | ) |

extern

Free the memory associated with a GEOSWKTReader.

Parameters

  reader | The reader to destroy.

Since
  3.0

## GEOSWKTReader_destroy_r()

void GEOSWKTReader_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTReader * | reader )

extern

See also
  GEOSWKTReader_destroy

## GEOSWKTReader_read()

GEOSGeometry * GEOSWKTReader_read | ( | GEOSWKTReader * | reader,
|  | const char * | wkt )

extern

Use a reader to parse the well-known text representation of a geometry, and return an allocated geometry.

Parameters

  reader | A WKT reader object, caller retains ownership
  wkt | The WKT string to parse, caller retains ownership

Returns
  A GEOSGeometry, caller to free with GEOSGeom_destroy())

Since
  3.0

## GEOSWKTReader_read_r()

GEOSGeometry * GEOSWKTReader_read_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTReader * | reader,
|  | const char * | wkt )

extern

See also
  GEOSWKTReader_read

## GEOSWKTReader_setFixStructure()

void GEOSWKTReader_setFixStructure | ( | GEOSWKTReader * | reader,
|  | char | doFix )

extern

Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading.

Parameters

  reader | A WKT reader object, caller retains ownership
  doFix | Set to 1 to repair, 0 for no repair (default).

Since
  3.11

## GEOSWKTReader_setFixStructure_r()

void GEOSWKTReader_setFixStructure_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTReader * | reader,
|  | char | doFix )

extern

See also
  GEOSWKTReader_setFixStructure

## GEOSWKTWriter_create()

GEOSWKTWriter * GEOSWKTWriter_create | ( | void |  | ) |

extern

Allocate a new GEOSWKTWriter.

Returns
  a new writer. Caller must free with GEOSWKTWriter_destroy()

Since
  3.0

## GEOSWKTWriter_create_r()

GEOSWKTWriter * GEOSWKTWriter_create_r | ( | GEOSContextHandle_t | handle | ) |

extern

See also
  GEOSWKTReader_create

## GEOSWKTWriter_destroy()

void GEOSWKTWriter_destroy | ( | GEOSWKTWriter * | writer | ) |

extern

Free the memory associated with a GEOSWKTWriter.

Parameters

  writer | The writer to destroy.

Since
  3.0

## GEOSWKTWriter_destroy_r()

void GEOSWKTWriter_destroy_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer )

extern

See also
  GEOSWKTWriter_destroy

## GEOSWKTWriter_getOutputDimension()

int GEOSWKTWriter_getOutputDimension | ( | GEOSWKTWriter * | writer | ) |

extern

Reads the current output dimension from a GEOSWKTWriter.

Parameters

  writer | A GEOSWKTWriter.

Returns
  The current dimension.

Since
  3.3

## GEOSWKTWriter_getOutputDimension_r()

int GEOSWKTWriter_getOutputDimension_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer )

extern

See also
  GEOSWKTWriter_getOutputDimension

## GEOSWKTWriter_setOld3D()

void GEOSWKTWriter_setOld3D | ( | GEOSWKTWriter * | writer,
|  | int | useOld3D )

extern

Sets the format for 3D outputs. The "old 3D" format does not include a Z dimension tag, e.g. "POINT (1 2 3)", except for XYM, e.g. "POINT M (1 2 3)". Geometries with XYZM coordinates do not add any dimensionality tags, e.g. "POINT (1 2 3 4)".

Parameters

  writer | A GEOSWKTWriter.
  useOld3D | True to use the old format, false is the default.

Since
  3.3

## GEOSWKTWriter_setOld3D_r()

void GEOSWKTWriter_setOld3D_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer,
|  | int | useOld3D )

extern

See also
  GEOSWKTWriter_setOld3D

## GEOSWKTWriter_setOutputDimension()

void GEOSWKTWriter_setOutputDimension | ( | GEOSWKTWriter * | writer,
|  | int | dim )

extern

Set the output dimensionality of the writer. Either 2, 3, or 4 dimensions. Default since GEOS 3.12 is 4.

Parameters

  writer | A GEOSWKTWriter.
  dim | The dimensionality desired.

Since
  3.3

## GEOSWKTWriter_setOutputDimension_r()

void GEOSWKTWriter_setOutputDimension_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer,
|  | int | dim )

extern

See also
  GEOSWKTWriter_setOutputDimension

## GEOSWKTWriter_setRoundingPrecision()

void GEOSWKTWriter_setRoundingPrecision | ( | GEOSWKTWriter * | writer,
|  | int | precision )

extern

Sets the number places after the decimal to output in WKT.

Parameters

  writer | A GEOSWKTWriter.
  precision | The desired precision, default 16.

Since
  3.3

## GEOSWKTWriter_setRoundingPrecision_r()

void GEOSWKTWriter_setRoundingPrecision_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer,
|  | int | precision )

extern

See also
  GEOSWKTWriter_setRoundingPrecision

## GEOSWKTWriter_setTrim()

void GEOSWKTWriter_setTrim | ( | GEOSWKTWriter * | writer,
|  | char | trim )

extern

Sets the number trimming option on a GEOSWKTWriter. With trim set to 1, the writer will strip trailing 0's from the output coordinates. With 1 (trimming enabled), big and small absolute coordinates will use scientific notation, otherwise positional notation is used; see GEOS_printDouble for details. With 0 (trimming disabled), all coordinates will be padded with 0's out to the rounding precision. Default since GEOS 3.12 is with trim set to 1 for 'on'.

Parameters

  writer | A GEOSWKTWriter.
  trim | The trimming behaviour to set, 1 for 'on', 0 for 'off'

Since
  3.3

## GEOSWKTWriter_setTrim_r()

void GEOSWKTWriter_setTrim_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer,
|  | char | trim )

extern

See also
  GEOSWKTWriter_setTrim

## GEOSWKTWriter_write()

char * GEOSWKTWriter_write | ( | GEOSWKTWriter * | writer,
|  | const GEOSGeometry * | g )

extern

Writes out the well-known text representation of a geometry, using the trim, rounding and dimension settings of the writer.

Parameters

  writer | A GEOSWKTWriter.
  g | Input geometry

Returns
  A newly allocated string containing the WKT output or NULL on exception. Caller must free with GEOSFree()

Since
  3.0

## GEOSWKTWriter_write_r()

char * GEOSWKTWriter_write_r | ( | GEOSContextHandle_t | handle,
|  | GEOSWKTWriter * | writer,
|  | const GEOSGeometry * | g )

extern

See also
  GEOSWKTWriter_write

## initGEOS()

void initGEOS | ( | GEOSMessageHandler | notice_function,
|  | GEOSMessageHandler | error_function )

extern

For non-reentrant code, set up an execution contact, and associate GEOSMessageHandler functions with it, to pass error and notice messages back to the calling application.

    typedef void (*GEOSMessageHandler)(const char *fmt, ...);

Parameters

  notice_function | Handle notice messages
  error_function | Handle error messages

Since
  2.2

## initGEOS_r()

GEOSContextHandle_t initGEOS_r | ( | GEOSMessageHandler | notice_function,
|  | GEOSMessageHandler | error_function )

extern

Deprecated
  in 3.5.0. Use GEOS_init_r() and set the message handlers using GEOSContext_setNoticeHandler_r() and/or GEOSContext_setErrorHandler_r()