GEOS 3.11.1
|
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) (const char *fmt,...) |
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 GEOSMakeValidParams_t | GEOSMakeValidParams |
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 void() | GEOSInterruptCallback(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 } |
enum | GEOSWKBByteOrders { GEOS_WKB_XDR = 0 , GEOS_WKB_NDR = 1 } |
enum | GEOSWKBFlavors { GEOS_WKB_EXTENDED = 1 , GEOS_WKB_ISO = 2 } |
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 } |
C API for the GEOS geometry algorithms library.
The C API is the preferred API to use when integration GEOS into you program/language/etc. While the C++ API is available, the ABI will not be stable between versions, and the API may also change. The GEOS team makes an effort to keep the C API stable, and to deprecate function signatures only over a long time period to allow transition time.
Important programming notes:
typedef struct GEOSBufParams_t GEOSBufferParams |
Parameter object for buffering.
typedef struct GEOSContextHandle_HS* GEOSContextHandle_t |
Type returned by GEOS_init_r(), for use in multi-threaded applications.
There should be only one GEOSContextHandle_t per thread.
typedef struct GEOSCoordSeq_t GEOSCoordSequence |
Coordinate sequence.
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.
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 |
typedef struct GEOSGeoJSONReader_t GEOSGeoJSONReader |
Reader object to read GeoJSON format and construct a Geometry.
typedef struct GEOSGeoJSONWriter_t GEOSGeoJSONWriter |
Writer object to turn a Geometry into GeoJSON.
typedef struct GEOSGeom_t GEOSGeometry |
Geometry generic type. Geometry can be a point, linestring, polygon, multipoint, multilinestring, multipolygon, or geometrycollection. Geometry type can be read with GEOSGeomTypeId. Most functions in GEOS either have GEOSGeometry* as a parameter or a return type.
typedef void() GEOSInterruptCallback(void) |
Callback function for use in interruption. The callback will be invoked before checking for interruption, so can be used to request it.
typedef struct GEOSMakeValidParams_t GEOSMakeValidParams |
Parameter object for validity enforcement.
typedef void(* GEOSMessageHandler) (const char *fmt,...) |
Callback function for passing GEOS error messages to parent process.
Set the GEOSMessageHandler for error and notice messages in initGEOS for single-threaded programs, or using initGEOS_r for threaded programs
fmt | the message format template |
typedef void(* GEOSMessageHandler_r) (const char *message, void *userdata) |
A GEOS message handler function.
message | the message contents |
userdata | the user data pointer that was passed to GEOS when registering this message handler. |
typedef struct GEOSPrepGeom_t GEOSPreparedGeometry |
Prepared geometry type.
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.
typedef struct GEOSSTRtree_t GEOSSTRtree |
STRTree index.
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 values are unchanged by this function. Extra data for the calculation can be passed via the userdata.
x | coordinate value to be updated |
y | coordinate value to be updated |
userdata | extra data for the calculation |
typedef struct GEOSWKBReader_t GEOSWKBReader |
Reader object to read Well-Known Binary (WKB) format and construct Geometry.
typedef struct GEOSWKBWriter_t GEOSWKBWriter |
Writer object to turn Geometry into Well-Known Binary (WKB).
typedef struct GEOSWKTReader_t GEOSWKTReader |
Reader object to read Well-Known Text (WKT) format and construct Geometry.
typedef struct GEOSWKTWriter_t GEOSWKTWriter |
Writer object to turn Geometry into Well-Known Text (WKT).
enum GEOSBufCapStyles |
Cap styles control the ends of buffered lines.
enum GEOSBufJoinStyles |
Join styles control the buffer shape at bends in a line.
enum GEOSGeomTypes |
Geometry type number, used by functions returning or consuming geometry types.
enum GEOSMakeValidMethods |
Algorithm to use when repairing invalid geometries.
Controls the behavior of the GEOSPolygonHullSimplify parameter.
Enumerator | |
---|---|
GEOSHULL_PARAM_VERTEX_RATIO | |
GEOSHULL_PARAM_AREA_RATIO | See geos::simplify::PolygonHullSimplifier::hullByAreaDelta() |
enum GEOSPrecisionRules |
Controls the behavior of GEOSGeom_setPrecision() when altering the precision of a geometry.
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() |
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. |
enum GEOSWKBByteOrders |
Well-known binary byte orders used when writing to WKB.
Enumerator | |
---|---|
GEOS_WKB_XDR | Big Endian |
GEOS_WKB_NDR | Little Endian |
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.
Enumerator | |
---|---|
GEOS_WKB_EXTENDED | Extended |
GEOS_WKB_ISO | ISO |
void finishGEOS | ( | void | ) |
For non-reentrant code, call when all GEOS operations are complete, cleans up global resources.
void finishGEOS_r | ( | GEOSContextHandle_t | handle | ) |
void GEOS_finish_r | ( | GEOSContextHandle_t | handle | ) |
Free the memory associated with a GEOSContextHandle_t when you are finished calling GEOS functions.
handle | to be freed |
int GEOS_getWKBByteOrder | ( | void | ) |
int GEOS_getWKBByteOrder_r | ( | GEOSContextHandle_t | handle | ) |
int GEOS_getWKBOutputDims | ( | void | ) |
int GEOS_getWKBOutputDims_r | ( | GEOSContextHandle_t | handle | ) |
GEOSContextHandle_t GEOS_init_r | ( | void | ) |
Initialize a context for this thread. Pass this context into your other calls of *_r
functions.
void GEOS_interruptCancel | ( | void | ) |
Cancel a pending interruption request
GEOSInterruptCallback * GEOS_interruptRegisterCallback | ( | GEOSInterruptCallback * | cb | ) |
Register a function to be called when processing is interrupted.
cb | Callback function to invoke |
void GEOS_interruptRequest | ( | void | ) |
Request safe interruption of operations
int GEOS_setWKBByteOrder | ( | int | byteOrder | ) |
int GEOS_setWKBByteOrder_r | ( | GEOSContextHandle_t | handle, |
int | byteOrder | ||
) |
int GEOS_setWKBOutputDims | ( | int | newDims | ) |
int GEOS_setWKBOutputDims_r | ( | GEOSContextHandle_t | handle, |
int | newDims | ||
) |
int GEOSArea | ( | const GEOSGeometry * | g, |
double * | area | ||
) |
Calculate the area of a geometry.
[in] | g | Input geometry |
[out] | area | Pointer to be filled in with area result |
int GEOSArea_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | area | ||
) |
GEOSGeometry * GEOSBoundary | ( | const GEOSGeometry * | g | ) |
Returns the "boundary" of a geometry, as defined by the DE9IM:
g | The input geometry |
GEOSGeometry * GEOSBoundary_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSBuffer | ( | const GEOSGeometry * | g, |
double | width, | ||
int | quadsegs | ||
) |
Buffer a geometry.
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. |
GEOSGeometry * GEOSBuffer_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | width, | ||
int | quadsegs | ||
) |
GEOSBufferParams * GEOSBufferParams_create | ( | void | ) |
Create a default GEOSBufferParams object for controlling the shape of buffered generated by GEOSBuffer.
GEOSBufferParams * GEOSBufferParams_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSBufferParams_destroy | ( | GEOSBufferParams * | parms | ) |
Destroy a GEOSBufferParams and free all associated memory.
parms | The object to destroy. |
void GEOSBufferParams_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSBufferParams * | parms | ||
) |
int GEOSBufferParams_setEndCapStyle | ( | GEOSBufferParams * | p, |
int | style | ||
) |
Set the end cap type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufCapStyles.
int GEOSBufferParams_setEndCapStyle_r | ( | GEOSContextHandle_t | handle, |
GEOSBufferParams * | p, | ||
int | style | ||
) |
int GEOSBufferParams_setJoinStyle | ( | GEOSBufferParams * | p, |
int | joinStyle | ||
) |
Set the join type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufJoinStyles.
int GEOSBufferParams_setJoinStyle_r | ( | GEOSContextHandle_t | handle, |
GEOSBufferParams * | p, | ||
int | joinStyle | ||
) |
int GEOSBufferParams_setMitreLimit | ( | GEOSBufferParams * | p, |
double | mitreLimit | ||
) |
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.
p | The GEOSBufferParams to operate on |
mitreLimit | The limit to set |
int GEOSBufferParams_setMitreLimit_r | ( | GEOSContextHandle_t | handle, |
GEOSBufferParams * | p, | ||
double | mitreLimit | ||
) |
int GEOSBufferParams_setQuadrantSegments | ( | GEOSBufferParams * | p, |
int | quadSegs | ||
) |
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.
p | The GEOSBufferParams to operate on |
quadSegs | Number of segments per quadrant |
int GEOSBufferParams_setQuadrantSegments_r | ( | GEOSContextHandle_t | handle, |
GEOSBufferParams * | p, | ||
int | quadSegs | ||
) |
int GEOSBufferParams_setSingleSided | ( | GEOSBufferParams * | p, |
int | singleSided | ||
) |
Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line.
p | The GEOSBufferParams to operate on |
singleSided | Set to 1 for single-sided output 0 otherwise |
int GEOSBufferParams_setSingleSided_r | ( | GEOSContextHandle_t | handle, |
GEOSBufferParams * | p, | ||
int | singleSided | ||
) |
GEOSGeometry * GEOSBufferWithParams | ( | const GEOSGeometry * | g, |
const GEOSBufferParams * | p, | ||
double | width | ||
) |
Generates a buffer using the special parameters in the GEOSBufferParams
g | The geometry to buffer |
p | The parameters to apply to the buffer process |
width | The buffer distance |
GEOSGeometry * GEOSBufferWithParams_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
const GEOSBufferParams * | p, | ||
double | width | ||
) |
GEOSGeometry * GEOSBufferWithStyle | ( | const GEOSGeometry * | g, |
double | width, | ||
int | quadsegs, | ||
int | endCapStyle, | ||
int | joinStyle, | ||
double | mitreLimit | ||
) |
Generate a buffer using the provided style 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 |
GEOSGeometry * GEOSBufferWithStyle_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | width, | ||
int | quadsegs, | ||
int | endCapStyle, | ||
int | joinStyle, | ||
double | mitreLimit | ||
) |
GEOSGeometry * GEOSBuildArea | ( | const GEOSGeometry * | g | ) |
Perform a polygonization using all the linework, assuming that rings contained within rings are empty holes, rather then extra polygons.
g | The input linework |
GEOSGeometry * GEOSBuildArea_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSClipByRect | ( | const GEOSGeometry * | g, |
double | xmin, | ||
double | ymin, | ||
double | xmax, | ||
double | ymax | ||
) |
Intersection optimized for a rectangular clipping polygon. Supposed to be faster than using GEOSIntersection(). Not guaranteed to return valid results.
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 |
GEOSGeometry * GEOSClipByRect_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | xmin, | ||
double | ymin, | ||
double | xmax, | ||
double | ymax | ||
) |
GEOSGeometry * GEOSConcaveHull | ( | const GEOSGeometry * | g, |
double | ratio, | ||
unsigned int | allowHoles | ||
) |
Returns "concave hull" of a geometry. The concave hull is fully contained within the convex hull and also contains all the points of the input, but in a smaller area. The area ratio is the ratio of the area of the convex hull and the concave hull. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry
g | The input geometry |
ratio | The ratio value, between 0 and 1. |
allowHoles | When non-zero, the polygonal output may contain holes. |
GEOSGeometry * GEOSConcaveHull_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | ratio, | ||
unsigned int | allowHoles | ||
) |
GEOSGeometry * GEOSConcaveHullOfPolygons | ( | const GEOSGeometry * | g, |
double | lengthRatio, | ||
unsigned int | isTight, | ||
unsigned int | isHolesAllowed | ||
) |
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. A given set of polygons has a sequence of hulls of increasing concaveness, determined by a numeric target parameter. The computed hull "fills the gap" between the polygons, and does not intersect their interior.
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.
"Maximum Edge Length" constrains the length of the longest edge between the polygons to be no larger than this value.
g | the valid MultiPolygon geometry to process |
lengthRatio | determine 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. |
Caller is responsible for freeing with GEOSGeom_destroy().
The input polygons must form a valid MultiPolygon (i.e. they must be non-overlapping).
GEOSGeometry * GEOSConcaveHullOfPolygons_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | lengthRatio, | ||
unsigned int | isTight, | ||
unsigned int | isHolesAllowed | ||
) |
GEOSGeometry * GEOSConstrainedDelaunayTriangulation | ( | const GEOSGeometry * | g | ) |
Return a constrained Delaunay triangulation of the vertices of the given polygon(s). For non-polygonal inputs, returns an empty geometry collection.
g | the input geometry whose rings will be used as input |
GEOSGeometry * GEOSConstrainedDelaunayTriangulation_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSContains | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometry g2 is completely within g1.
g1 | Input geometry |
g2 | Input geometry |
char GEOSContains_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSMessageHandler GEOSContext_setErrorHandler_r | ( | GEOSContextHandle_t | extHandle, |
GEOSMessageHandler | ef | ||
) |
Set the notice handler callback function for run-time error messages.
extHandle | the GEOS context from GEOS_init_r |
ef | the handler callback |
GEOSMessageHandler_r GEOSContext_setErrorMessageHandler_r | ( | GEOSContextHandle_t | extHandle, |
GEOSMessageHandler_r | ef, | ||
void * | userData | ||
) |
Sets an error message handler on the given GEOS context.
extHandle | the GEOS context |
ef | the message handler |
userData | optional user data pointer that will be passed to the message handler |
GEOSMessageHandler GEOSContext_setNoticeHandler_r | ( | GEOSContextHandle_t | extHandle, |
GEOSMessageHandler | nf | ||
) |
Set the notice handler callback function for run-time notice messages.
extHandle | the context returned by GEOS_init_r. |
nf | the handler callback |
GEOSMessageHandler_r GEOSContext_setNoticeMessageHandler_r | ( | GEOSContextHandle_t | extHandle, |
GEOSMessageHandler_r | nf, | ||
void * | userData | ||
) |
Sets a notice message handler on the given GEOS context.
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 |
GEOSGeometry * GEOSConvexHull | ( | const GEOSGeometry * | g | ) |
Returns convex hull of a geometry. The smallest convex Geometry that contains all the points in the input Geometry
g | The input geometry |
GEOSGeometry * GEOSConvexHull_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSCoordSequence * GEOSCoordSeq_clone | ( | const GEOSCoordSequence * | s | ) |
Clone a coordinate sequence.
s | the coordinate sequence to clone |
GEOSCoordSequence * GEOSCoordSeq_clone_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s | ||
) |
GEOSCoordSequence * GEOSCoordSeq_copyFromArrays | ( | const double * | x, |
const double * | y, | ||
const double * | z, | ||
const double * | m, | ||
unsigned int | size | ||
) |
Create a coordinate sequence by copying from arrays of doubles
x | array of x coordinates |
y | array of y coordinates |
z | array of z coordinates, or NULL |
m | array of m coordinates, (must be NULL) |
size | length of each array |
GEOSCoordSequence * GEOSCoordSeq_copyFromArrays_r | ( | GEOSContextHandle_t | handle, |
const double * | x, | ||
const double * | y, | ||
const double * | z, | ||
const double * | m, | ||
unsigned int | size | ||
) |
GEOSCoordSequence * GEOSCoordSeq_copyFromBuffer | ( | const double * | buf, |
unsigned int | size, | ||
int | hasZ, | ||
int | hasM | ||
) |
Create a coordinate sequence by copying from a buffer of doubles (XYXY or XYZXYZ)
buf | pointer to buffer |
size | number of coordinates in the sequence |
hasZ | does buffer have Z values? |
hasM | does buffer have M values? (they will be ignored) |
GEOSCoordSequence * GEOSCoordSeq_copyFromBuffer_r | ( | GEOSContextHandle_t | handle, |
const double * | buf, | ||
unsigned int | size, | ||
int | hasZ, | ||
int | hasM | ||
) |
int GEOSCoordSeq_copyToArrays | ( | const GEOSCoordSequence * | s, |
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | m | ||
) |
Copy the contents of a coordinate sequence to a buffer of doubles (XYZY or XYZXYZ)
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 (will all be NAN) |
int GEOSCoordSeq_copyToArrays_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | m | ||
) |
int GEOSCoordSeq_copyToBuffer | ( | const GEOSCoordSequence * | s, |
double * | buf, | ||
int | hasZ, | ||
int | hasM | ||
) |
Copy the contents of a coordinate sequence to a buffer of doubles (XYXY or XYZXYZ)
s | sequence to copy |
buf | buffer to which coordinates should be copied |
hasZ | copy Z values to buffer? |
hasM | copy M values to buffer? (will be NaN) |
int GEOSCoordSeq_copyToBuffer_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
double * | buf, | ||
int | hasZ, | ||
int | hasM | ||
) |
GEOSCoordSequence * GEOSCoordSeq_create | ( | unsigned int | size, |
unsigned int | dims | ||
) |
Create a coordinate sequence.
size | number of coordinates in the sequence |
dims | dimensionality of the coordinates (2 or 3) |
GEOSCoordSequence * GEOSCoordSeq_create_r | ( | GEOSContextHandle_t | handle, |
unsigned int | size, | ||
unsigned int | dims | ||
) |
void GEOSCoordSeq_destroy | ( | GEOSCoordSequence * | s | ) |
Destroy a coordinate sequence, freeing all memory.
s | the coordinate sequence to destroy |
void GEOSCoordSeq_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s | ||
) |
int GEOSCoordSeq_getDimensions | ( | const GEOSCoordSequence * | s, |
unsigned int * | dims | ||
) |
Get dimension info from a coordinate sequence.
[in] | s | the coordinate sequence |
[out] | dims | pointer where dimension value will be placed |
int GEOSCoordSeq_getDimensions_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int * | dims | ||
) |
int GEOSCoordSeq_getOrdinate | ( | const GEOSCoordSequence * | s, |
unsigned int | idx, | ||
unsigned int | dim, | ||
double * | val | ||
) |
Read Nth ordinate value from a coordinate sequence.
[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 |
int GEOSCoordSeq_getOrdinate_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
unsigned int | dim, | ||
double * | val | ||
) |
int GEOSCoordSeq_getSize | ( | const GEOSCoordSequence * | s, |
unsigned int * | size | ||
) |
Get size info from a coordinate sequence.
[in] | s | the coordinate sequence |
[out] | size | pointer where size value will be placed |
int GEOSCoordSeq_getSize_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int * | size | ||
) |
int GEOSCoordSeq_getX | ( | const GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double * | val | ||
) |
Read X ordinate values from a coordinate sequence.
s | the coordinate sequence |
idx | the index of the coordinate to alter, zero based |
val | pointer where ordinate value will be placed |
int GEOSCoordSeq_getX_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double * | val | ||
) |
int GEOSCoordSeq_getXY | ( | const GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double * | x, | ||
double * | y | ||
) |
Read X and Y ordinate values from a coordinate sequence.
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 |
int GEOSCoordSeq_getXY_r | ( | GEOSContextHandle_t | handle, |
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 | ||
) |
Read X and Y ordinate values from a coordinate sequence.
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 |
int GEOSCoordSeq_getXYZ_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double * | x, | ||
double * | y, | ||
double * | z | ||
) |
int GEOSCoordSeq_getY | ( | const GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double * | val | ||
) |
Read Y ordinate values from a coordinate sequence.
s | the coordinate sequence |
idx | the index of the coordinate to alter, zero based |
val | pointer where ordinate value will be placed |
int GEOSCoordSeq_getY_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double * | val | ||
) |
int GEOSCoordSeq_getZ | ( | const GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double * | val | ||
) |
Read Z ordinate values from a coordinate sequence.
s | the coordinate sequence |
idx | the index of the coordinate to alter, zero based |
val | pointer where ordinate value will be placed |
int GEOSCoordSeq_getZ_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double * | val | ||
) |
int GEOSCoordSeq_isCCW | ( | const GEOSCoordSequence * | s, |
char * | is_ccw | ||
) |
Check orientation of a coordinate sequence. Closure of the sequence is assumed. Invalid (collapsed) sequences will return false. Short (less than 4 points) sequences will return exception.
s | the coordinate sequence |
is_ccw | pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise |
int GEOSCoordSeq_isCCW_r | ( | GEOSContextHandle_t | handle, |
const GEOSCoordSequence * | s, | ||
char * | is_ccw | ||
) |
int GEOSCoordSeq_setOrdinate | ( | GEOSCoordSequence * | s, |
unsigned int | idx, | ||
unsigned int | dim, | ||
double | val | ||
) |
Set Nth ordinate value in a coordinate sequence.
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 |
int GEOSCoordSeq_setOrdinate_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
unsigned int | dim, | ||
double | val | ||
) |
int GEOSCoordSeq_setX | ( | GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double | val | ||
) |
Set X ordinate values in a coordinate sequence.
s | the coordinate sequence |
idx | the index of the coordinate to alter, zero based |
val | the value to set the ordinate to |
int GEOSCoordSeq_setX_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double | val | ||
) |
int GEOSCoordSeq_setXY | ( | GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double | x, | ||
double | y | ||
) |
Set X and Y ordinate values in a coordinate sequence simultaneously.
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 |
int GEOSCoordSeq_setXY_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double | x, | ||
double | y | ||
) |
int GEOSCoordSeq_setXYZ | ( | GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Set X, Y and Z ordinate values in a coordinate sequence simultaneously.
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 |
int GEOSCoordSeq_setXYZ_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
int GEOSCoordSeq_setY | ( | GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double | val | ||
) |
Set Y ordinate values in a coordinate sequence.
s | the coordinate sequence |
idx | the index of the coordinate to alter, zero based |
val | the value to set the ordinate to |
int GEOSCoordSeq_setY_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double | val | ||
) |
int GEOSCoordSeq_setZ | ( | GEOSCoordSequence * | s, |
unsigned int | idx, | ||
double | val | ||
) |
Set Z ordinate values in a coordinate sequence.
s | the coordinate sequence |
idx | the index of the coordinate to alter, zero based |
val | the value to set the ordinate to |
int GEOSCoordSeq_setZ_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s, | ||
unsigned int | idx, | ||
double | val | ||
) |
GEOSGeometry * GEOSCoverageUnion | ( | const GEOSGeometry * | g | ) |
Optimized union algorithm for polygonal inputs that are correctly noded and do not overlap. It will generate an error (return NULL) for inputs that do not satisfy this constraint.
g | The input geometry |
GEOSGeometry * GEOSCoverageUnion_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSCoveredBy | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometry g2 is completely within g1, including possibly touching the boundary of g1.
g1 | Input geometry |
g2 | Input geometry |
char GEOSCoveredBy_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSCovers | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometry g1 is completely within g2, including possibly touching the boundary of g2.
g1 | Input geometry |
g2 | Input geometry |
char GEOSCovers_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSCrosses | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometries interiors interact but their boundares do not. Most useful for finding line crosses cases.
g1 | Input geometry |
g2 | Input geometry |
char GEOSCrosses_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSDelaunayTriangulation | ( | const GEOSGeometry * | g, |
double | tolerance, | ||
int | onlyEdges | ||
) |
Return a Delaunay triangulation of the vertices of the given geometry.
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. |
GEOSGeometry * GEOSDelaunayTriangulation_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | tolerance, | ||
int | onlyEdges | ||
) |
GEOSGeometry * GEOSDensify | ( | const GEOSGeometry * | g, |
double | tolerance | ||
) |
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.
g | The geometry to densify |
tolerance | the distance tolerance to densify |
GEOSGeometry * GEOSDensify_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | tolerance | ||
) |
GEOSGeometry * GEOSDifference | ( | const GEOSGeometry * | ga, |
const GEOSGeometry * | gb | ||
) |
Returns the difference of two geometries A and B: the set of points that fall within A but not within B.
ga | the base geometry |
gb | the geometry to subtract from it |
GEOSGeometry * GEOSDifference_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSDifferencePrec | ( | const GEOSGeometry * | ga, |
const GEOSGeometry * | gb, | ||
double | gridSize | ||
) |
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.
ga | one of the geometries |
gb | the other geometry |
gridSize | the cell size of the precision grid |
GEOSGeometry * GEOSDifferencePrec_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | gridSize | ||
) |
char GEOSDisjoint | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if no point of either geometry touchess or is within the other.
g1 | Input geometry |
g2 | Input geometry |
char GEOSDisjoint_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
int GEOSDistance | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
Calculate the distance between two geometries.
[in] | g1 | Input geometry |
[in] | g2 | Input geometry |
[out] | dist | Pointer to be filled in with distance result |
int GEOSDistance_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
int GEOSDistanceIndexed | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
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.
[in] | g1 | Input geometry |
[in] | g2 | Input geometry |
[out] | dist | Pointer to be filled in with distance result |
int GEOSDistanceIndexed_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
char GEOSDistanceWithin | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double | dist | ||
) |
Test whether the distance between two geometries is within the given dist.
g1 | Input geometry |
g2 | Input geometry |
dist | The max distance |
char GEOSDistanceWithin_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | dist | ||
) |
GEOSGeometry * GEOSEnvelope | ( | const GEOSGeometry * | g | ) |
Returns minimum rectangular polygon that contains the geometry.
g | The geometry to calculate an envelope for |
GEOSGeometry * GEOSEnvelope_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSEquals | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometries cover the same space on the place.
g1 | Input geometry |
g2 | Input geometry |
char GEOSEquals_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSEqualsExact | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double | tolerance | ||
) |
Determine pointwise equivalence 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. 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().
g1 | Input geometry |
g2 | Input geometry |
tolerance | Tolerance to determine vertex equality |
char GEOSEqualsExact_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | tolerance | ||
) |
int GEOSFrechetDistance | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
Calculate the Frechet distance between two geometries, a similarity measure for linear features.
[in] | g1 | Input geometry |
[in] | g2 | Input geometry |
[out] | dist | Pointer to be filled in with distance result |
int GEOSFrechetDistance_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
int GEOSFrechetDistanceDensify | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double | densifyFrac, | ||
double * | dist | ||
) |
Calculate the Frechet distance between two geometries, a similarity measure for linear features. For more precision, first densify the inputs.
[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 |
int GEOSFrechetDistanceDensify_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | densifyFrac, | ||
double * | dist | ||
) |
void GEOSFree | ( | void * | buffer | ) |
Free strings and byte buffers returned by functions such as GEOSWKBWriter_write(), GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc.
buffer | The memory to free |
void GEOSFree_r | ( | GEOSContextHandle_t | handle, |
void * | buffer | ||
) |
GEOSGeoJSONReader * GEOSGeoJSONReader_create | ( | void | ) |
Allocate a new GEOSGeoJSONReader.
GEOSGeoJSONReader * GEOSGeoJSONReader_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSGeoJSONReader_destroy | ( | GEOSGeoJSONReader * | reader | ) |
Free the memory associated with a GEOSGeoJSONReader.
reader | The reader to destroy. |
void GEOSGeoJSONReader_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSGeoJSONReader * | reader | ||
) |
GEOSGeometry * GEOSGeoJSONReader_readGeometry | ( | GEOSGeoJSONReader * | reader, |
const char * | geojson | ||
) |
Use a reader to parse a GeoJSON. A single geometry or feature is converted into a geometry. A featurecollection is converted into a geometrycollection. Feature properties are not read.
reader | A GeoJSON reader object, caller retains ownership |
geojson | The json string to parse, caller retains ownership |
GEOSGeometry * GEOSGeoJSONReader_readGeometry_r | ( | GEOSContextHandle_t | handle, |
GEOSGeoJSONReader * | reader, | ||
const char * | geojson | ||
) |
GEOSGeoJSONWriter * GEOSGeoJSONWriter_create | ( | void | ) |
Allocate a new GEOSGeoJSONWriter.
GEOSGeoJSONWriter * GEOSGeoJSONWriter_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSGeoJSONWriter_destroy | ( | GEOSGeoJSONWriter * | writer | ) |
Free the memory associated with a GEOSGeoJSONWriter.
writer | The writer to destroy. |
void GEOSGeoJSONWriter_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSGeoJSONWriter * | writer | ||
) |
char * GEOSGeoJSONWriter_writeGeometry | ( | GEOSGeoJSONWriter * | writer, |
const GEOSGeometry * | g, | ||
int | indent | ||
) |
Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON Feature or FeatureCollection is unsupported through the GEOS C API.
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. |
char * GEOSGeoJSONWriter_writeGeometry_r | ( | GEOSContextHandle_t | handle, |
GEOSGeoJSONWriter * | writer, | ||
const GEOSGeometry * | g, | ||
int | indent | ||
) |
GEOSGeometry * GEOSGeom_clone | ( | const GEOSGeometry * | g | ) |
Create a new copy of the input geometry.
g | The geometry to copy |
GEOSGeometry * GEOSGeom_clone_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSGeom_createCollection | ( | int | type, |
GEOSGeometry ** | geoms, | ||
unsigned int | ngeoms | ||
) |
Create a geometry collection.
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 |
GEOSGeometry * GEOSGeom_createCollection_r | ( | GEOSContextHandle_t | handle, |
int | type, | ||
GEOSGeometry ** | geoms, | ||
unsigned int | ngeoms | ||
) |
GEOSGeometry * GEOSGeom_createEmptyCollection | ( | int | type | ) |
Create an empty geometry collection.
type | The geometry type, enumerated by GEOSGeomTypes |
GEOSGeometry * GEOSGeom_createEmptyCollection_r | ( | GEOSContextHandle_t | handle, |
int | type | ||
) |
GEOSGeometry * GEOSGeom_createEmptyLineString | ( | void | ) |
Creates an emptylinestring geometry.
GEOSGeometry * GEOSGeom_createEmptyLineString_r | ( | GEOSContextHandle_t | handle | ) |
GEOSGeometry * GEOSGeom_createEmptyPoint | ( | void | ) |
Creates an empty point.
GEOSGeometry * GEOSGeom_createEmptyPoint_r | ( | GEOSContextHandle_t | handle | ) |
GEOSGeometry * GEOSGeom_createEmptyPolygon | ( | void | ) |
Creates an empty polygon geometry.
GEOSGeometry * GEOSGeom_createEmptyPolygon_r | ( | GEOSContextHandle_t | handle | ) |
GEOSGeometry * GEOSGeom_createLinearRing | ( | GEOSCoordSequence * | s | ) |
Creates a linear ring geometry, for use in a polygon.
s | Input coordinate sequence, ownership passes to the geometry |
GEOSGeometry * GEOSGeom_createLinearRing_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s | ||
) |
GEOSGeometry * GEOSGeom_createLineString | ( | GEOSCoordSequence * | s | ) |
Creates a linestring geometry.
s | Input coordinate sequence, ownership passes to the geometry |
GEOSGeometry * GEOSGeom_createLineString_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s | ||
) |
GEOSGeometry * GEOSGeom_createPoint | ( | GEOSCoordSequence * | s | ) |
Creates a point geometry from a coordinate sequence.
s | Input coordinate sequence, ownership passes to the geometry |
GEOSGeometry * GEOSGeom_createPoint_r | ( | GEOSContextHandle_t | handle, |
GEOSCoordSequence * | s | ||
) |
GEOSGeometry * GEOSGeom_createPointFromXY | ( | double | x, |
double | y | ||
) |
Creates a point geometry from a pair of coordinates.
x | The X coordinate |
y | The Y coordinate |
GEOSGeometry * GEOSGeom_createPointFromXY_r | ( | GEOSContextHandle_t | handle, |
double | x, | ||
double | y | ||
) |
GEOSGeometry * GEOSGeom_createPolygon | ( | GEOSGeometry * | shell, |
GEOSGeometry ** | holes, | ||
unsigned int | nholes | ||
) |
Creates a polygon geometry from line ring geometries.
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. |
GEOSGeometry * GEOSGeom_createPolygon_r | ( | GEOSContextHandle_t | handle, |
GEOSGeometry * | shell, | ||
GEOSGeometry ** | holes, | ||
unsigned int | nholes | ||
) |
GEOSGeometry * GEOSGeom_createRectangle | ( | double | xmin, |
double | ymin, | ||
double | xmax, | ||
double | ymax | ||
) |
Create a rectangular polygon from bounding coordinates. Will return a point geometry if width and height are 0.
xmin | Left bound of envelope |
ymin | Lower bound of envelope |
xmax | Right bound of envelope |
ymax | Upper bound of envelope |
GEOSGeometry * GEOSGeom_createRectangle_r | ( | GEOSContextHandle_t | handle, |
double | xmin, | ||
double | ymin, | ||
double | xmax, | ||
double | ymax | ||
) |
void GEOSGeom_destroy | ( | GEOSGeometry * | g | ) |
Release the memory associated with a geometry.
g | The geometry to be destroyed. |
void GEOSGeom_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSGeom_extractUniquePoints | ( | const GEOSGeometry * | g | ) |
Return all distinct vertices of input geometry as a MultiPoint. Note that only 2 dimensions of the vertices are considered when testing for equality.
g | The input geometry |
GEOSGeometry * GEOSGeom_extractUniquePoints_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeom_getCoordinateDimension | ( | const GEOSGeometry * | g | ) |
Return the cartesian dimension of the geometry.
g | Input geometry |
int GEOSGeom_getCoordinateDimension_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
const GEOSCoordSequence * GEOSGeom_getCoordSeq | ( | const GEOSGeometry * | g | ) |
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.
g | Input geometry |
const GEOSCoordSequence * GEOSGeom_getCoordSeq_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeom_getDimensions | ( | const GEOSGeometry * | g | ) |
Return the planar dimensionality of the geometry.
g | Input geometry |
int GEOSGeom_getDimensions_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeom_getExtent | ( | const GEOSGeometry * | g, |
double * | xmin, | ||
double * | ymin, | ||
double * | xmax, | ||
double * | ymax | ||
) |
Finds the extent (minimum and maximum X and Y value) of the geometry. Raises an exception for empty geometry input.
[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 |
int GEOSGeom_getExtent_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | xmin, | ||
double * | ymin, | ||
double * | xmax, | ||
double * | ymax | ||
) |
double GEOSGeom_getPrecision | ( | const GEOSGeometry * | g | ) |
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.
g | Input geometry |
double GEOSGeom_getPrecision_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
void * GEOSGeom_getUserData | ( | const GEOSGeometry * | g | ) |
Return the anonymous "user data" for this geometry. User data must be managed by the caller, and freed before the geometry is freed.
g | Input geometry |
void * GEOSGeom_getUserData_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeom_getXMax | ( | const GEOSGeometry * | g, |
double * | value | ||
) |
Finds the maximum X value in the geometry.
[in] | g | Input geometry |
[out] | value | Pointer to place result |
int GEOSGeom_getXMax_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | value | ||
) |
int GEOSGeom_getXMin | ( | const GEOSGeometry * | g, |
double * | value | ||
) |
Finds the minimum X value in the geometry.
[in] | g | Input geometry |
[out] | value | Pointer to place result |
int GEOSGeom_getXMin_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | value | ||
) |
int GEOSGeom_getYMax | ( | const GEOSGeometry * | g, |
double * | value | ||
) |
Finds the maximum Y value in the geometry.
[in] | g | Input geometry |
[out] | value | Pointer to place result |
int GEOSGeom_getYMax_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | value | ||
) |
int GEOSGeom_getYMin | ( | const GEOSGeometry * | g, |
double * | value | ||
) |
Finds the minimum Y value in the geometry.
[in] | g | Input geometry |
[out] | value | Pointer to place result |
int GEOSGeom_getYMin_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | value | ||
) |
GEOSGeometry * GEOSGeom_setPrecision | ( | const GEOSGeometry * | g, |
double | gridSize, | ||
int | flags | ||
) |
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
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 |
GEOSGeometry * GEOSGeom_setPrecision_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | gridSize, | ||
int | flags | ||
) |
void GEOSGeom_setUserData | ( | GEOSGeometry * | g, |
void * | userData | ||
) |
Set the anonymous "user data" for this geometry. Don't forget to free the user data before freeing the geometry.
g | Input geometry |
userData | Void pointer to user data |
void GEOSGeom_setUserData_r | ( | GEOSContextHandle_t | handle, |
GEOSGeometry * | g, | ||
void * | userData | ||
) |
GEOSGeometry * GEOSGeom_transformXY | ( | const GEOSGeometry * | g, |
GEOSTransformXYCallback | callback, | ||
void * | userdata | ||
) |
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 values, if present, are not modified by this function.
[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 |
GEOSGeometry * GEOSGeom_transformXY_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
GEOSTransformXYCallback | callback, | ||
void * | userdata | ||
) |
GEOSGeometry * GEOSGeomFromHEX_buf | ( | const unsigned char * | hex, |
size_t | size | ||
) |
GEOSGeometry * GEOSGeomFromHEX_buf_r | ( | GEOSContextHandle_t | handle, |
const unsigned char * | hex, | ||
size_t | size | ||
) |
GEOSGeometry * GEOSGeomFromWKB_buf | ( | const unsigned char * | wkb, |
size_t | size | ||
) |
GEOSGeometry * GEOSGeomFromWKB_buf_r | ( | GEOSContextHandle_t | handle, |
const unsigned char * | wkb, | ||
size_t | size | ||
) |
GEOSGeometry * GEOSGeomFromWKT | ( | const char * | wkt | ) |
GEOSGeometry * GEOSGeomFromWKT_r | ( | GEOSContextHandle_t | handle, |
const char * | wkt | ||
) |
GEOSGeometry * GEOSGeomGetEndPoint | ( | const GEOSGeometry * | g | ) |
Return the last point of a LineString
g | Input geometry, must be a LineString |
GEOSGeometry * GEOSGeomGetEndPoint_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeomGetLength | ( | const GEOSGeometry * | g, |
double * | length | ||
) |
Calculate the length of a LineString. Only works for LineString inputs, returns exception otherwise.
[in] | g | Input geometry |
[out] | length | Pointer to be filled in with length result |
int GEOSGeomGetLength_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | length | ||
) |
int GEOSGeomGetNumPoints | ( | const GEOSGeometry * | g | ) |
Returns the number of points, for a LineString input, or an exception otherwise.
g | Input LineString geometry |
int GEOSGeomGetNumPoints_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSGeomGetPointN | ( | const GEOSGeometry * | g, |
int | n | ||
) |
Return the N'th point of a LineString
g | Input geometry, must be a LineString |
n | Index of desired point (zero based) |
GEOSGeometry * GEOSGeomGetPointN_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
int | n | ||
) |
GEOSGeometry * GEOSGeomGetStartPoint | ( | const GEOSGeometry * | g | ) |
Return the first point of a LineString
g | Input geometry, must be a LineString |
GEOSGeometry * GEOSGeomGetStartPoint_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeomGetX | ( | const GEOSGeometry * | g, |
double * | x | ||
) |
Returns the X coordinate, for a Point input, or an exception otherwise.
[in] | g | Input Point geometry |
[out] | x | Pointer to hold return value |
int GEOSGeomGetX_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | x | ||
) |
int GEOSGeomGetY | ( | const GEOSGeometry * | g, |
double * | y | ||
) |
Returns the Y coordinate, for a Point input, or an exception otherwise.
[in] | g | Input Point geometry |
[out] | y | Pointer to hold return value |
int GEOSGeomGetY_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | y | ||
) |
int GEOSGeomGetZ | ( | const GEOSGeometry * | g, |
double * | z | ||
) |
Returns the Z coordinate, for a Point input, or an exception otherwise.
[in] | g | Input Point geometry |
[out] | z | Pointer to hold return value |
int GEOSGeomGetZ_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | z | ||
) |
unsigned char * GEOSGeomToHEX_buf | ( | const GEOSGeometry * | g, |
size_t * | size | ||
) |
unsigned char * GEOSGeomToHEX_buf_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
size_t * | size | ||
) |
unsigned char * GEOSGeomToWKB_buf | ( | const GEOSGeometry * | g, |
size_t * | size | ||
) |
unsigned char * GEOSGeomToWKB_buf_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
size_t * | size | ||
) |
char * GEOSGeomToWKT | ( | const GEOSGeometry * | g | ) |
char * GEOSGeomToWKT_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char * GEOSGeomType | ( | const GEOSGeometry * | g | ) |
Returns the geometry type string for this geometry. eg: "GeometryCollection", "LineString"
g | Input geometry |
char * GEOSGeomType_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGeomTypeId | ( | const GEOSGeometry * | g | ) |
Returns the GEOSGeomTypeId number for this geometry.
g | Input geometry |
int GEOSGeomTypeId_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSGetCentroid | ( | const GEOSGeometry * | g | ) |
Returns a point at the center of mass of the input.
g | The input geometry |
GEOSGeometry * GEOSGetCentroid_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
const GEOSGeometry * GEOSGetExteriorRing | ( | const GEOSGeometry * | g | ) |
Get the external ring of a Polygon.
g | Input Polygon geometry |
const GEOSGeometry * GEOSGetExteriorRing_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
const GEOSGeometry * GEOSGetGeometryN | ( | const GEOSGeometry * | g, |
int | n | ||
) |
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.
g | Input geometry |
n | Sub-geometry index, zero-base |
const GEOSGeometry * GEOSGetGeometryN_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
int | n | ||
) |
const GEOSGeometry * GEOSGetInteriorRingN | ( | const GEOSGeometry * | g, |
int | n | ||
) |
Returns the N'th ring for a Polygon input.
g | Input Polygon geometry |
n | Index of the desired ring |
const GEOSGeometry * GEOSGetInteriorRingN_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
int | n | ||
) |
int GEOSGetNumCoordinates | ( | const GEOSGeometry * | g | ) |
Get the total number of points in a geometry, of any type.
g | Input geometry |
int GEOSGetNumCoordinates_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGetNumGeometries | ( | const GEOSGeometry * | g | ) |
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.
g | Input geometry |
int GEOSGetNumGeometries_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGetNumInteriorRings | ( | const GEOSGeometry * | g | ) |
Returns the number of interior rings, for a Polygon input, or an exception otherwise.
g | Input Polygon geometry |
int GEOSGetNumInteriorRings_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSGetSRID | ( | const GEOSGeometry * | g | ) |
Returns the "spatial reference id" (SRID) for this geometry.
g | Input geometry |
int GEOSGetSRID_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSHasZ | ( | const GEOSGeometry * | g | ) |
Tests whether the input geometry has z coordinates.
g | The geometry to test |
char GEOSHasZ_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSHausdorffDistance | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
Calculate the Hausdorff distance between two geometries. Hausdorff distance is the largest distance between two geometries.
[in] | g1 | Input geometry |
[in] | g2 | Input geometry |
[out] | dist | Pointer to be filled in with distance result |
int GEOSHausdorffDistance_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
int GEOSHausdorffDistanceDensify | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double | densifyFrac, | ||
double * | dist | ||
) |
Calculate a more precise Hausdorff distance between two geometries, by densifying the inputs before computation. Hausdorff distance is the largest distance between two geometries.
[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 |
int GEOSHausdorffDistanceDensify_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | densifyFrac, | ||
double * | dist | ||
) |
int GEOSHilbertCode | ( | const GEOSGeometry * | geom, |
const GEOSGeometry * | extent, | ||
unsigned int | level, | ||
unsigned int * | code | ||
) |
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.
[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 |
int GEOSHilbertCode_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | geom, | ||
const GEOSGeometry * | extent, | ||
unsigned int | level, | ||
unsigned int * | code | ||
) |
GEOSGeometry * GEOSInterpolate | ( | const GEOSGeometry * | line, |
double | d | ||
) |
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.
line | linear target of projection |
d | distance from start of line to created point |
GEOSGeometry * GEOSInterpolate_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | line, | ||
double | d | ||
) |
GEOSGeometry * GEOSInterpolateNormalized | ( | const GEOSGeometry * | line, |
double | proportion | ||
) |
Measuring from start of line, return point that is a proportion the start. Line parameter must be a LineString.
line | linear target of projection |
proportion | The proportion from the start of line to created point |
GEOSGeometry * GEOSInterpolateNormalized_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | d | ||
) |
GEOSGeometry * GEOSIntersection | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
Returns the intersection of two geometries: the set of points that fall within both geometries.
g1 | one of the geometries |
g2 | the other geometry |
GEOSGeometry * GEOSIntersection_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSIntersectionPrec | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
double | gridSize | ||
) |
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.
g1 | one of the geometries |
g2 | the other geometry |
gridSize | the cell size of the precision grid |
GEOSGeometry * GEOSIntersectionPrec_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | gridSize | ||
) |
char GEOSIntersects | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometries are not disjoint.
g1 | Input geometry |
g2 | Input geometry |
char GEOSIntersects_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSisClosed | ( | const GEOSGeometry * | g | ) |
Tests whether the input geometry is closed. A closed geometry is a linestring or multilinestring with the start and end points being the same.
g | The geometry to test |
char GEOSisClosed_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSisEmpty | ( | const GEOSGeometry * | g | ) |
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.
g | The geometry to test |
char GEOSisEmpty_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSisRing | ( | const GEOSGeometry * | g | ) |
Tests whether the input geometry is a ring. Rings are linestrings, without self-intersections, with start and end point being identical.
g | The geometry to test |
char GEOSisRing_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSisSimple | ( | const GEOSGeometry * | g | ) |
Tests whether the input geometry is "simple". Mostly relevant for linestrings. A "simple" linestring has no self-intersections.
g | The geometry to test |
char GEOSisSimple_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSisValid | ( | const GEOSGeometry * | g | ) |
Check the validity of the provided geometry.
g | The geometry to test |
char GEOSisValid_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSisValidDetail | ( | const GEOSGeometry * | g, |
int | flags, | ||
char ** | reason, | ||
GEOSGeometry ** | location | ||
) |
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()
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 |
char GEOSisValidDetail_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
int | flags, | ||
char ** | reason, | ||
GEOSGeometry ** | location | ||
) |
char * GEOSisValidReason | ( | const GEOSGeometry * | g | ) |
Return the human readable reason a geometry is invalid, "Valid Geometry" string otherwise, or NULL on exception.
g | The geometry to test |
char * GEOSisValidReason_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSLargestEmptyCircle | ( | const GEOSGeometry * | obstacles, |
const GEOSGeometry * | boundary, | ||
double | tolerance | ||
) |
Constructs the "largest empty circle" (LEC) for a set of obstacle geometries, up to a specified tolerance. The obstacles are point and line geometries. Polygonal obstacles willl be treated as linear features. The LEC is the largest circle which has its center inside the boundary, and whose interior does not intersect with any obstacle. If no boundary is provided, the convex hull of the obstacles is used as the boundary. The LEC center is the point in the interior of the boundary which has the farthest distance from the obstacles (up to tolerance). The LEC is determined by the center point and a point lying on an obstacle indicating the circle radius. 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 a two-point linestring, with the start point at the center of the inscribed circle and the end on the boundary of the inscribed circle.
obstacles | The geometries that the LEC must fit within without covering |
boundary | The area within which the LEC must reside |
tolerance | Stop the algorithm when the search area is smaller than this tolerance |
GEOSGeometry * GEOSLargestEmptyCircle_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
const GEOSGeometry * | boundary, | ||
double | tolerance | ||
) |
int GEOSLength | ( | const GEOSGeometry * | g, |
double * | length | ||
) |
Calculate the length of a geometry.
[in] | g | Input geometry |
[out] | length | Pointer to be filled in with length result |
int GEOSLength_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | length | ||
) |
GEOSGeometry * GEOSLineMerge | ( | const GEOSGeometry * | g | ) |
Sews together a set of fully noded LineStrings removing any cardinality 2 nodes in the linework.
g | The input linework |
GEOSGeometry * GEOSLineMerge_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSLineMergeDirected | ( | const GEOSGeometry * | g | ) |
Sews together a set of fully noded LineStrings removing any cardinality 2 nodes in the linework only if possible without changing order of points.
g | The input linework |
GEOSGeometry * GEOSLineMergeDirected_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSMakeValid | ( | const GEOSGeometry * | g | ) |
Repair an invalid geometry, returning a valid output.
g | The geometry to repair |
GEOSGeometry * GEOSMakeValid_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSMakeValidParams * GEOSMakeValidParams_create | ( | void | ) |
Create a GEOSMakeValidParams to hold the desired parameters to control the algorithm and behavior of the validation process.
GEOSMakeValidParams * GEOSMakeValidParams_create_r | ( | GEOSContextHandle_t | extHandle | ) |
void GEOSMakeValidParams_destroy | ( | GEOSMakeValidParams * | parms | ) |
Destroy a GEOSMakeValidParams.
parms | the object to destroy |
void GEOSMakeValidParams_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSMakeValidParams * | parms | ||
) |
int GEOSMakeValidParams_setKeepCollapsed | ( | GEOSMakeValidParams * | p, |
int | keepCollapsed | ||
) |
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.
int GEOSMakeValidParams_setKeepCollapsed_r | ( | GEOSContextHandle_t | handle, |
GEOSMakeValidParams * | p, | ||
int | style | ||
) |
int GEOSMakeValidParams_setMethod | ( | GEOSMakeValidParams * | p, |
enum GEOSMakeValidMethods | method | ||
) |
Set the GEOSMakeValidMethods to use in making the geometry valid.
int GEOSMakeValidParams_setMethod_r | ( | GEOSContextHandle_t | handle, |
GEOSMakeValidParams * | p, | ||
enum GEOSMakeValidMethods | method | ||
) |
GEOSGeometry * GEOSMakeValidWithParams | ( | const GEOSGeometry * | g, |
const GEOSMakeValidParams * | makeValidParams | ||
) |
Repair an invalid geometry, returning a valid output, using the indicated GEOSMakeValidMethods algorithm and options.
g | is the geometry to test. |
makeValidParams | is a GEOSMakeValidParams with the desired parameters set on it. |
GEOSGeometry * GEOSMakeValidWithParams_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
const GEOSMakeValidParams * | makeValidParams | ||
) |
GEOSGeometry * GEOSMaximumInscribedCircle | ( | const GEOSGeometry * | g, |
double | tolerance | ||
) |
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.
g | Input geometry |
tolerance | Stop the algorithm when the search area is smaller than this tolerance |
GEOSGeometry * GEOSMaximumInscribedCircle_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | tolerance | ||
) |
GEOSGeometry * GEOSMinimumBoundingCircle | ( | const GEOSGeometry * | g, |
double * | radius, | ||
GEOSGeometry ** | center | ||
) |
Returns a geometry which represents the "minimum bounding circle", the smallest circle that contains the input.
[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. |
GEOSGeometry * GEOSMinimumBoundingCircle_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | radius, | ||
GEOSGeometry ** | center | ||
) |
int GEOSMinimumClearance | ( | const GEOSGeometry * | g, |
double * | d | ||
) |
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:
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.
g | the input geometry |
d | a double to which the result can be stored |
int GEOSMinimumClearance_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double * | distance | ||
) |
GEOSGeometry * GEOSMinimumClearanceLine | ( | const GEOSGeometry * | g | ) |
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.
g | the input geometry |
GEOSGeometry * GEOSMinimumClearanceLine_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSMinimumRotatedRectangle | ( | const GEOSGeometry * | g | ) |
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.
g | The input geometry |
GEOSGeometry * GEOSMinimumRotatedRectangle_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSMinimumWidth | ( | const GEOSGeometry * | g | ) |
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.
g | The input geometry |
GEOSGeometry * GEOSMinimumWidth_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSCoordSequence * GEOSNearestPoints | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
The closest points of the two geometries. The first point comes from g1 geometry and the second point comes from g2.
[in] | g1 | Input geometry |
[in] | g2 | Input geometry |
GEOSCoordSequence * GEOSNearestPoints_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSNode | ( | const GEOSGeometry * | g | ) |
For linear inputs, returns a new geometry in which no lines cross each other, and all touching occurs at end points.
g | The input geometry |
GEOSGeometry * GEOSNode_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSNormalize | ( | GEOSGeometry * | g | ) |
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:
Use before calling GEOSEqualsExact to avoid false "not equal" results.
g | Input geometry |
int GEOSNormalize_r | ( | GEOSContextHandle_t | handle, |
GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSOffsetCurve | ( | const GEOSGeometry * | g, |
double | width, | ||
int | quadsegs, | ||
int | joinStyle, | ||
double | mitreLimit | ||
) |
Generates offset curve line(s) for a geometry. Handles all geometry types as input.
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 |
GEOSGeometry * GEOSOffsetCurve_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | width, | ||
int | quadsegs, | ||
int | joinStyle, | ||
double | mitreLimit | ||
) |
int GEOSOrientationIndex | ( | double | Ax, |
double | Ay, | ||
double | Bx, | ||
double | By, | ||
double | Px, | ||
double | Py | ||
) |
For the points formed by the six input ordinates, walking from A to B and then to P.
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 |
int GEOSOrientationIndex_r | ( | GEOSContextHandle_t | handle, |
double | Ax, | ||
double | Ay, | ||
double | Bx, | ||
double | By, | ||
double | Px, | ||
double | Py | ||
) |
char GEOSOverlaps | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometries share interiors but are neither within nor contained.
g1 | Input geometry |
g2 | Input geometry |
char GEOSOverlaps_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSPointOnSurface | ( | const GEOSGeometry * | g | ) |
Returns a point that is inside the boundary of a polygonal geometry.
g | The input geometry |
GEOSGeometry * GEOSPointOnSurface_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSPolygonHullSimplify | ( | const GEOSGeometry * | g, |
unsigned int | isOuter, | ||
double | vertexNumFraction | ||
) |
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.
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 |
Caller is responsible for freeing with GEOSGeom_destroy().
GEOSGeometry * GEOSPolygonHullSimplify_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
unsigned int | isOuter, | ||
double | vertexNumFraction | ||
) |
GEOSGeometry * GEOSPolygonHullSimplifyMode | ( | const GEOSGeometry * | g, |
unsigned int | isOuter, | ||
unsigned int | parameterMode, | ||
double | parameter | ||
) |
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. In general, larger values compute less concave results and value of 0 produces the original geometry. Either outer or inner hulls can be computed.
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 |
parameter | the target ratio of area difference to original area |
Caller is responsible for freeing with GEOSGeom_destroy().
GEOSGeometry * GEOSPolygonHullSimplifyMode_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
unsigned int | isOuter, | ||
unsigned int | parameterMode, | ||
double | parameter | ||
) |
GEOSGeometry * GEOSPolygonize | ( | const GEOSGeometry *const | geoms[], |
unsigned int | ngeoms | ||
) |
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:
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).
geoms | Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. |
ngeoms | Size of the geoms array. |
GEOSGeometry * GEOSPolygonize_full | ( | const GEOSGeometry * | input, |
GEOSGeometry ** | cuts, | ||
GEOSGeometry ** | dangles, | ||
GEOSGeometry ** | invalid | ||
) |
Perform the polygonization as GEOSPolygonize() and return the polygonal result as well as all extra ouputs.
[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. |
GEOSGeometry * GEOSPolygonize_full_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | input, | ||
GEOSGeometry ** | cuts, | ||
GEOSGeometry ** | dangles, | ||
GEOSGeometry ** | invalidRings | ||
) |
GEOSGeometry * GEOSPolygonize_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry *const | geoms[], | ||
unsigned int | ngeoms | ||
) |
GEOSGeometry * GEOSPolygonize_valid | ( | const GEOSGeometry *const | geoms[], |
unsigned int | ngeoms | ||
) |
Same polygonizing behavior as GEOSPolygonize(), but only returning results that are valid.
geoms | Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. |
ngeoms | Size of the geoms array. |
GEOSGeometry * GEOSPolygonize_valid_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry *const | geoms[], | ||
unsigned int | ngems | ||
) |
GEOSGeometry * GEOSPolygonizer_getCutEdges | ( | const GEOSGeometry *const | geoms[], |
unsigned int | ngeoms | ||
) |
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.
geoms | Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. |
ngeoms | Size of the geoms array. |
GEOSGeometry * GEOSPolygonizer_getCutEdges_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry *const | geoms[], | ||
unsigned int | ngeoms | ||
) |
const GEOSPreparedGeometry * GEOSPrepare | ( | const GEOSGeometry * | g | ) |
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.)
g | The base geometry to wrap in a prepared geometry. |
const GEOSPreparedGeometry * GEOSPrepare_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
char GEOSPreparedContains | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedContains_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedContainsProperly | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained properly.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedContainsProperly_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedCoveredBy | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is covered by.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedCoveredBy_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedCovers | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry covers.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedCovers_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedCrosses | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry crosses.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedCrosses_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedDisjoint | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedDisjoint do a high performance calculation of whether the provided geometry is disjoint.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedDisjoint_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
int GEOSPreparedDistance | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
Using a GEOSPreparedDistance do a high performance calculation to find the distance points 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.
[in] | pg1 | The prepared geometry |
[in] | g2 | The geometry to test |
[out] | dist | Pointer to store the result in |
int GEOSPreparedDistance_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2, | ||
double * | dist | ||
) |
char GEOSPreparedDistanceWithin | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2, | ||
double | dist | ||
) |
Using a GEOSPreparedDistanceWithin 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.
pg1 | The prepared geometry |
g2 | The geometry to test |
dist | The max distance |
char GEOSPreparedDistanceWithin_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2, | ||
double | dist | ||
) |
void GEOSPreparedGeom_destroy | ( | const GEOSPreparedGeometry * | g | ) |
Free the memory associated with a GEOSPreparedGeometry. Caller must separately free the base GEOSGeometry used to create the prepared geometry.
g | Prepared geometry to destroy. |
void GEOSPreparedGeom_destroy_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | g | ||
) |
char GEOSPreparedIntersects | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedDisjoint do a high performance calculation of whether the provided geometry is disjoint.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedIntersects_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSCoordSequence * GEOSPreparedNearestPoints | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedDisjoint do a high performance calculation to find the nearest points between the prepared and provided geometry.
pg1 | The prepared geometry |
g2 | The geometry to test |
GEOSCoordSequence * GEOSPreparedNearestPoints_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedOverlaps | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedDisjoint do a high performance calculation of whether the provided geometry overlaps.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedOverlaps_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedTouches | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedDisjoint do a high performance calculation of whether the provided geometry touches.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedTouches_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
char GEOSPreparedWithin | ( | const GEOSPreparedGeometry * | pg1, |
const GEOSGeometry * | g2 | ||
) |
Using a GEOSPreparedDisjoint do a high performance calculation of whether the provided geometry is within.
pg1 | The prepared geometry |
g2 | The geometry to test |
char GEOSPreparedWithin_r | ( | GEOSContextHandle_t | handle, |
const GEOSPreparedGeometry * | pg1, | ||
const GEOSGeometry * | g2 | ||
) |
double GEOSProject | ( | const GEOSGeometry * | line, |
const GEOSGeometry * | point | ||
) |
Distance of point projected onto line from the start of the line.
line | linear target of projection |
point | point to be projected onto 'g' |
double GEOSProject_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | line, | ||
const GEOSGeometry * | point | ||
) |
double GEOSProjectNormalized | ( | const GEOSGeometry * | line, |
const GEOSGeometry * | point | ||
) |
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.
line | linear target of projection |
point | the point to project |
double GEOSProjectNormalized_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
const GEOSGeometry * | p | ||
) |
char * GEOSRelate | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
Calculate and return the DE9IM pattern for this geometry pair.
g1 | First geometry in pair |
g2 | Second geometry in pair |
char * GEOSRelate_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
char * GEOSRelateBoundaryNodeRule | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
int | bnr | ||
) |
Calculate and return the DE9IM pattern for this geometry pair. Apply the supplied GEOSRelateBoundaryNodeRules.
g1 | First geometry in pair |
g2 | Second geometry in pair |
bnr | A member of the GEOSRelateBoundaryNodeRules enum |
char * GEOSRelateBoundaryNodeRule_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
int | bnr | ||
) |
char GEOSRelatePattern | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2, | ||
const char * | pat | ||
) |
Calculate the DE9IM pattern for this geometry pair and compare against the provided pattern to check for consistency. If the result and pattern are consistent return true. The pattern may include glob "*" characters for portions that are allowed to match any value.
g1 | First geometry in pair |
g2 | Second geometry in pair |
pat | DE9IM pattern to check |
char GEOSRelatePattern_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
const char * | pat | ||
) |
char GEOSRelatePatternMatch | ( | const char * | mat, |
const char * | pat | ||
) |
Compare two DE9IM patterns and return true if they are consistent.
mat | Complete DE9IM string (does not have "*") |
pat | Pattern to match to (may contain "*") |
char GEOSRelatePatternMatch_r | ( | GEOSContextHandle_t | handle, |
const char * | mat, | ||
const char * | pat | ||
) |
GEOSGeometry * GEOSRemoveRepeatedPoints | ( | const GEOSGeometry * | g, |
double | tolerance | ||
) |
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.
g | The geometry to filter |
tolerance | Remove all points within this distance of each other. Use 0.0 to remove only exactly repeated points. |
GEOSGeometry * GEOSRemoveRepeatedPoints_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | tolerance | ||
) |
GEOSGeometry * GEOSReverse | ( | const GEOSGeometry * | g | ) |
For geometries with coordinate sequences, reverses the order of the sequences. Converts CCW rings to CW. Reverses direction of LineStrings.
g | The input geometry |
GEOSGeometry * GEOSReverse_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
int GEOSSegmentIntersection | ( | double | ax0, |
double | ay0, | ||
double | ax1, | ||
double | ay1, | ||
double | bx0, | ||
double | by0, | ||
double | bx1, | ||
double | by1, | ||
double * | cx, | ||
double * | cy | ||
) |
Computes the coordinate where two line segments intersect, if any
[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 |
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 | ||
) |
void GEOSSetSRID | ( | GEOSGeometry * | g, |
int | SRID | ||
) |
Set the "spatial reference id" (SRID) for this geometry.
g | Input geometry |
SRID | SRID number or 0 for unknown SRID. |
void GEOSSetSRID_r | ( | GEOSContextHandle_t | handle, |
GEOSGeometry * | g, | ||
int | SRID | ||
) |
GEOSGeometry * GEOSSharedPaths | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
Find paths shared between the two given lineal geometries.
Returns a GeometryCollection having two elements:
g1 | An input geometry |
g2 | An input geometry |
GEOSGeometry * GEOSSharedPaths_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSSimplify | ( | const GEOSGeometry * | g, |
double | tolerance | ||
) |
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.
g | The input geometry |
tolerance | The tolerance to apply. Larger tolerance leads to simpler output. |
GEOSGeometry * GEOSSimplify_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | tolerance | ||
) |
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 | ||
) |
GEOSGeometry * GEOSSnap | ( | const GEOSGeometry * | input, |
const GEOSGeometry * | snap_target, | ||
double | tolerance | ||
) |
Snap first geometry onto second within the given tolerance.
input | An input geometry |
snap_target | A geometry to snap the input to |
tolerance | Snapping tolerance |
GEOSGeometry * GEOSSnap_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | tolerance | ||
) |
GEOSSTRtree * GEOSSTRtree_create | ( | size_t | nodeCapacity | ) |
Create a new GEOSSTRtree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional spatial data.
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. |
GEOSSTRtree * GEOSSTRtree_create_r | ( | GEOSContextHandle_t | handle, |
size_t | nodeCapacity | ||
) |
void GEOSSTRtree_destroy | ( | GEOSSTRtree * | tree | ) |
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.
void GEOSSTRtree_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree | ||
) |
void GEOSSTRtree_insert | ( | GEOSSTRtree * | tree, |
const GEOSGeometry * | g, | ||
void * | item | ||
) |
Insert an item into an GEOSSTRtree
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 |
void GEOSSTRtree_insert_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree, | ||
const GEOSGeometry * | g, | ||
void * | item | ||
) |
void GEOSSTRtree_iterate | ( | GEOSSTRtree * | tree, |
GEOSQueryCallback | callback, | ||
void * | userdata | ||
) |
Iterate over all items in the GEOSSTRtree.
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. |
void GEOSSTRtree_iterate_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree, | ||
GEOSQueryCallback | callback, | ||
void * | userdata | ||
) |
const GEOSGeometry * GEOSSTRtree_nearest | ( | GEOSSTRtree * | tree, |
const GEOSGeometry * | geom | ||
) |
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.
tree | the GEOSSTRtree to search |
geom | the geometry with which the tree should be queried |
const void * GEOSSTRtree_nearest_generic | ( | GEOSSTRtree * | tree, |
const void * | item, | ||
const GEOSGeometry * | itemEnvelope, | ||
GEOSDistanceCallback | distancefn, | ||
void * | userdata | ||
) |
Returns the nearest item in the GEOSSTRtree to the supplied item
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. |
const void * GEOSSTRtree_nearest_generic_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree, | ||
const void * | item, | ||
const GEOSGeometry * | itemEnvelope, | ||
GEOSDistanceCallback | distancefn, | ||
void * | userdata | ||
) |
const GEOSGeometry * GEOSSTRtree_nearest_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree, | ||
const GEOSGeometry * | geom | ||
) |
void GEOSSTRtree_query | ( | GEOSSTRtree * | tree, |
const GEOSGeometry * | g, | ||
GEOSQueryCallback | callback, | ||
void * | userdata | ||
) |
Query an GEOSSTRtree for items intersecting a specified envelope
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 |
void GEOSSTRtree_query_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree, | ||
const GEOSGeometry * | g, | ||
GEOSQueryCallback | callback, | ||
void * | userdata | ||
) |
char GEOSSTRtree_remove | ( | GEOSSTRtree * | tree, |
const GEOSGeometry * | g, | ||
void * | item | ||
) |
Removes an item from the GEOSSTRtree
tree | the STRtree from which to remove an item |
g | the envelope of the item to remove |
item | the item to remove |
char GEOSSTRtree_remove_r | ( | GEOSContextHandle_t | handle, |
GEOSSTRtree * | tree, | ||
const GEOSGeometry * | g, | ||
void * | item | ||
) |
GEOSGeometry * GEOSSymDifference | ( | const GEOSGeometry * | ga, |
const GEOSGeometry * | gb | ||
) |
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.
ga | geometry A |
gb | geometry B |
GEOSGeometry * GEOSSymDifference_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSSymDifferencePrec | ( | const GEOSGeometry * | ga, |
const GEOSGeometry * | gb, | ||
double | gridSize | ||
) |
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.
ga | one of the geometries |
gb | the other geometry |
gridSize | the cell size of the precision grid |
GEOSGeometry * GEOSSymDifferencePrec_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | gridSize | ||
) |
GEOSGeometry * GEOSTopologyPreserveSimplify | ( | const GEOSGeometry * | g, |
double | tolerance | ||
) |
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()
g | The input geometry |
tolerance | The tolerance to apply. Larger tolerance leads to simpler output. |
GEOSGeometry * GEOSTopologyPreserveSimplify_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | tolerance | ||
) |
char GEOSTouches | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometries share boundaries at one or more points, but do not have interior overlaps.
g1 | Input geometry |
g2 | Input geometry |
char GEOSTouches_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSUnaryUnion | ( | const GEOSGeometry * | g | ) |
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.
g | The input geometry |
GEOSGeometry * GEOSUnaryUnion_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSUnaryUnionPrec | ( | const GEOSGeometry * | g, |
double | gridSize | ||
) |
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.
g | input geometry |
gridSize | the cell size of the precision grid |
GEOSGeometry * GEOSUnaryUnionPrec_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g, | ||
double | gridSize | ||
) |
GEOSGeometry * GEOSUnion | ( | const GEOSGeometry * | ga, |
const GEOSGeometry * | gb | ||
) |
Returns the union of two geometries A and B: the set of points that fall in A or within B.
ga | geometry A |
gb | geometry B |
GEOSGeometry * GEOSUnion_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSGeometry * GEOSUnionCascaded | ( | const GEOSGeometry * | g | ) |
GEOSGeometry * GEOSUnionCascaded_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g | ||
) |
GEOSGeometry * GEOSUnionPrec | ( | const GEOSGeometry * | ga, |
const GEOSGeometry * | gb, | ||
double | gridSize | ||
) |
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.
ga | one of the geometries |
gb | the other geometry |
gridSize | the cell size of the precision grid |
GEOSGeometry * GEOSUnionPrec_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2, | ||
double | gridSize | ||
) |
const char * GEOSversion | ( | void | ) |
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.
GEOSGeometry * GEOSVoronoiDiagram | ( | const GEOSGeometry * | g, |
const GEOSGeometry * | env, | ||
double | tolerance, | ||
int | onlyEdges | ||
) |
Returns the Voronoi polygons of the vertices of the given geometry.
g | the input geometry whose vertices will be used as sites. |
tolerance | snapping tolerance to use for improved robustness |
onlyEdges | whether to return only edges of the voronoi cells |
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. |
GEOSGeometry * GEOSVoronoiDiagram_r | ( | GEOSContextHandle_t | extHandle, |
const GEOSGeometry * | g, | ||
const GEOSGeometry * | env, | ||
double | tolerance, | ||
int | onlyEdges | ||
) |
char GEOSWithin | ( | const GEOSGeometry * | g1, |
const GEOSGeometry * | g2 | ||
) |
True if geometry g1 is completely within g2, and not touching the boundary of g2.
g1 | Input geometry |
g2 | Input geometry |
char GEOSWithin_r | ( | GEOSContextHandle_t | handle, |
const GEOSGeometry * | g1, | ||
const GEOSGeometry * | g2 | ||
) |
GEOSWKBReader * GEOSWKBReader_create | ( | void | ) |
Allocate a new GEOSWKBReader.
GEOSWKBReader * GEOSWKBReader_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSWKBReader_destroy | ( | GEOSWKBReader * | reader | ) |
Free the memory associated with a GEOSWKBReader.
reader | The reader to destroy. |
void GEOSWKBReader_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBReader * | reader | ||
) |
GEOSGeometry * GEOSWKBReader_read | ( | GEOSWKBReader * | reader, |
const unsigned char * | wkb, | ||
size_t | size | ||
) |
Read a geometry from a well-known binary buffer.
reader | A GEOSWKBReader |
wkb | A pointer to the buffer to read from |
size | The number of bytes of data in the buffer |
GEOSGeometry * GEOSWKBReader_read_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBReader * | reader, | ||
const unsigned char * | wkb, | ||
size_t | size | ||
) |
GEOSGeometry * GEOSWKBReader_readHEX | ( | GEOSWKBReader * | reader, |
const unsigned char * | hex, | ||
size_t | size | ||
) |
Read a geometry from a hex encoded well-known binary buffer.
reader | A GEOSWKBReader |
hex | A pointer to the buffer to read from |
size | The number of bytes of data in the buffer |
GEOSGeometry * GEOSWKBReader_readHEX_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBReader * | reader, | ||
const unsigned char * | hex, | ||
size_t | size | ||
) |
void GEOSWKBReader_setFixStructure | ( | GEOSWKBReader * | reader, |
char | doFix | ||
) |
Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading.
reader | A WKB reader object, caller retains ownership |
doFix | Set to 1 to repair, 0 for no repair (default). |
void GEOSWKBReader_setFixStructure_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBReader * | reader, | ||
char | doFix | ||
) |
GEOSWKBWriter * GEOSWKBWriter_create | ( | void | ) |
Allocate a new GEOSWKBWriter.
GEOSWKBWriter * GEOSWKBWriter_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSWKBWriter_destroy | ( | GEOSWKBWriter * | writer | ) |
Free the memory associated with a GEOSWKBWriter.
writer | The writer to destroy. |
void GEOSWKBWriter_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer | ||
) |
int GEOSWKBWriter_getByteOrder | ( | const GEOSWKBWriter * | writer | ) |
Find whether the writer will use WKB byte order that is big or little endian. The return value is a member of GEOSWKBByteOrders.
writer | The writer to read byte order from |
int GEOSWKBWriter_getByteOrder_r | ( | GEOSContextHandle_t | handle, |
const GEOSWKBWriter * | writer | ||
) |
int GEOSWKBWriter_getFlavor | ( | const GEOSWKBWriter * | writer | ) |
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.
writer | The writer to read flavor from |
int GEOSWKBWriter_getFlavor_r | ( | GEOSContextHandle_t | handle, |
const GEOSWKBWriter * | writer | ||
) |
char GEOSWKBWriter_getIncludeSRID | ( | const GEOSWKBWriter * | writer | ) |
Read the current SRID embedding value from the writer.
writer | The writer to check SRID value on |
char GEOSWKBWriter_getIncludeSRID_r | ( | GEOSContextHandle_t | handle, |
const GEOSWKBWriter * | writer | ||
) |
int GEOSWKBWriter_getOutputDimension | ( | const GEOSWKBWriter * | writer | ) |
Read the current output dimension of the writer. Either 2 or 3 dimensions. Return current number of dimensions.
writer | The writer to read from. |
int GEOSWKBWriter_getOutputDimension_r | ( | GEOSContextHandle_t | handle, |
const GEOSWKBWriter * | writer | ||
) |
void GEOSWKBWriter_setByteOrder | ( | GEOSWKBWriter * | writer, |
int | byteOrder | ||
) |
Set the output byte order of the writer, using a value from GEOSWKBByteOrders enum.
writer | The writer to set byte order on |
byteOrder | Desired byte order |
void GEOSWKBWriter_setByteOrder_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer, | ||
int | byteOrder | ||
) |
void GEOSWKBWriter_setFlavor | ( | GEOSWKBWriter * | writer, |
int | flavor | ||
) |
Set the output flavor of the writer, using a value from GEOSWKBFlavors enum.
writer | The writer to set flavor on |
flavor | Desired flavor |
void GEOSWKBWriter_setFlavor_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer, | ||
int | flavor | ||
) |
void GEOSWKBWriter_setIncludeSRID | ( | GEOSWKBWriter * | writer, |
const char | writeSRID | ||
) |
Specify whether SRID values should be output in WKB. Many WKB readers do not support SRID values, use with caution.
writer | The writer to set SRID output on |
writeSRID | Set to 1 to include SRID, 0 otherwise |
void GEOSWKBWriter_setIncludeSRID_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer, | ||
const char | writeSRID | ||
) |
void GEOSWKBWriter_setOutputDimension | ( | GEOSWKBWriter * | writer, |
int | newDimension | ||
) |
Set the output dimensionality of the writer. Either 2 or 3 dimensions.
writer | The writer to read from. |
newDimension | The dimensionality desired |
void GEOSWKBWriter_setOutputDimension_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer, | ||
int | newDimension | ||
) |
unsigned char * GEOSWKBWriter_write | ( | GEOSWKBWriter * | writer, |
const GEOSGeometry * | g, | ||
size_t * | size | ||
) |
Write out the WKB representation of a geometry.
writer | The GEOSWKBWriter controlling the writing. |
g | Geometry to convert to WKB |
size | Pointer to write the size of the final output WKB to |
unsigned char * GEOSWKBWriter_write_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer, | ||
const GEOSGeometry * | g, | ||
size_t * | size | ||
) |
unsigned char * GEOSWKBWriter_writeHEX | ( | GEOSWKBWriter * | writer, |
const GEOSGeometry * | g, | ||
size_t * | size | ||
) |
Write out the hex WKB representation of a geometry.
writer | The GEOSWKBWriter controlling the writing. |
g | Geometry to convert to WKB |
size | Pointer to write the size of the final output WKB to |
unsigned char * GEOSWKBWriter_writeHEX_r | ( | GEOSContextHandle_t | handle, |
GEOSWKBWriter * | writer, | ||
const GEOSGeometry * | g, | ||
size_t * | size | ||
) |
GEOSWKTReader * GEOSWKTReader_create | ( | void | ) |
Allocate a new GEOSWKTReader.
GEOSWKTReader * GEOSWKTReader_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSWKTReader_destroy | ( | GEOSWKTReader * | reader | ) |
Free the memory associated with a GEOSWKTReader.
reader | The reader to destroy. |
void GEOSWKTReader_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTReader * | reader | ||
) |
GEOSGeometry * GEOSWKTReader_read | ( | GEOSWKTReader * | reader, |
const char * | wkt | ||
) |
Use a reader to parse the well-known text representation of a geometry, and return an allocated geometry.
reader | A WKT reader object, caller retains ownership |
wkt | The WKT string to parse, caller retains ownership |
GEOSGeometry * GEOSWKTReader_read_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTReader * | reader, | ||
const char * | wkt | ||
) |
void GEOSWKTReader_setFixStructure | ( | GEOSWKTReader * | reader, |
char | doFix | ||
) |
Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading.
reader | A WKT reader object, caller retains ownership |
doFix | Set to 1 to repair, 0 for no repair (default). |
void GEOSWKTReader_setFixStructure_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTReader * | reader, | ||
char | doFix | ||
) |
GEOSWKTWriter * GEOSWKTWriter_create | ( | void | ) |
Allocate a new GEOSWKTWriter.
GEOSWKTWriter * GEOSWKTWriter_create_r | ( | GEOSContextHandle_t | handle | ) |
void GEOSWKTWriter_destroy | ( | GEOSWKTWriter * | writer | ) |
Free the memory associated with a GEOSWKTWriter.
writer | The writer to destroy. |
void GEOSWKTWriter_destroy_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer | ||
) |
int GEOSWKTWriter_getOutputDimension | ( | GEOSWKTWriter * | writer | ) |
Reads the current output dimension from a GEOSWKTWriter.
writer | A GEOSWKTWriter. |
int GEOSWKTWriter_getOutputDimension_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer | ||
) |
void GEOSWKTWriter_setOld3D | ( | GEOSWKTWriter * | writer, |
int | useOld3D | ||
) |
Sets the format for 3D outputs. The "old 3D" format does not include a dimensionality tag, eg. "POINT(1 2 3)" while the new (ISO) format does includes a tag, eg "POINT Z (1 2 3)".
writer | A GEOSWKTWriter. |
useOld3D | True to use the old format, false is the default. |
void GEOSWKTWriter_setOld3D_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer, | ||
int | useOld3D | ||
) |
void GEOSWKTWriter_setOutputDimension | ( | GEOSWKTWriter * | writer, |
int | dim | ||
) |
Sets whether or not to write out XY or XYZ coordinates. Legal values are 2 or 3.
writer | A GEOSWKTWriter. |
dim | The desired dimension, default 2. |
void GEOSWKTWriter_setOutputDimension_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer, | ||
int | dim | ||
) |
void GEOSWKTWriter_setRoundingPrecision | ( | GEOSWKTWriter * | writer, |
int | precision | ||
) |
Sets the number places after the decimal to output in WKT.
writer | A GEOSWKTWriter. |
precision | The desired precision, default 16. |
void GEOSWKTWriter_setRoundingPrecision_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer, | ||
int | precision | ||
) |
void GEOSWKTWriter_setTrim | ( | GEOSWKTWriter * | writer, |
char | trim | ||
) |
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 0, all coordinates will be padded with 0's out to the rounding precision.
writer | A GEOSWKTWriter. |
trim | The trimming behaviour to set, 1 for 'on', 0 for 'off', default 'off' |
void GEOSWKTWriter_setTrim_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer, | ||
char | trim | ||
) |
char * GEOSWKTWriter_write | ( | GEOSWKTWriter * | writer, |
const GEOSGeometry * | g | ||
) |
Writes out the well-known text representation of a geometry, using the trim, rounding and dimension settings of the writer.
writer | A GEOSWKTWriter. |
g | Input geometry |
char * GEOSWKTWriter_write_r | ( | GEOSContextHandle_t | handle, |
GEOSWKTWriter * | writer, | ||
const GEOSGeometry * | g | ||
) |
void initGEOS | ( | GEOSMessageHandler | notice_function, |
GEOSMessageHandler | error_function | ||
) |
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, ...);
notice_function | Handle notice messages |
error_function | Handle error messages |
GEOSContextHandle_t initGEOS_r | ( | GEOSMessageHandler | notice_function, |
GEOSMessageHandler | error_function | ||
) |