Typedefs and Enums
Typedefs
StringPointer : number
A pointer to a char * string. Can be created using const ptr = geos.Module.stringToNewUTF8(someString) Can be converted to JS using const str = geos.Module.UTF8ToString(ptr)
Kind: global typedef
NumberPointer : number
A pointer to a double *, int *, or unsigned int *. Can be created using const ptr = geos.Module._malloc(8) Can be converted to JS using const value = geos.Module.getValue(ptr, 'double') Must be freed using geos.Module._free(ptr)
Kind: global typedef
ArrayPointer : number
A pointer to an array (double *). Can be create using the following JS code: const values = new Float64Array(N * dim) for (let i = 0; i < values.length; i++) { values[i] = i } const valuesPtr = geos.Module._malloc(N * dim * 8) geos.Module.HEAPF64.set(values, valuesPtr / 8) Can be converted to JS using the following JS code: const view = new Float64Array(geos.Module.HEAPF64.buffer, valuesPtr, N * dim * 8)
Kind: global typedef
Pointer : StringPointer
| NumberPointer
A generic pointer type.
Kind: global typedef
GEOSBufferParams : number
Parameter object for buffering.
Kind: global typedef
GEOSContextHandle_t : number
Type returned by GEOS_init_r(), for use with the functions ending in _r (the reentrant API).
Kind: global typedef
GEOSCoordSequence : number
Coordinate sequence type representing fixed-size lists of coordinates. Contains the list of vertices defining the location of a GEOSGeometry.
Kind: global typedef
GEOSDistanceCallback ⇒ number
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. This callback is displayed as a global member.
Kind: global typedef
Returns: number
- 1 if distance calculation succeeds, 0 otherwise
GEOSGeoJSONReader : number
Reader object to read GeoJSON format and construct a Geometry.
Kind: global typedef
GEOSGeoJSONWriter : number
Writer object to turn a Geometry into GeoJSON.
Kind: global typedef
GEOSGeometry : number
The generic type for a geometry. A geometry can be a Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, or GeometryCollection. The geometry type can be read with GEOSGeomTypeId. Most functions in GEOS have GEOSGeometry * as either a parameter or a return type.
Kind: global typedef
GEOSInterruptCallback : function
Callback function for use in interruption. The callback will be invoked before checking for interruption, so can be used to request it. This callback is displayed as a global member.
Kind: global typedef
GEOSMakeValidParams : number
Parameter object for validity enforcement.
Kind: global typedef
GEOSMessageHandler : function
Callback function for passing GEOS error messages to parent process. This callback is displayed as a global member.
Kind: global typedef
GEOSMessageHandler_r : function
A GEOS message handler function. This callback is displayed as a global member.
Kind: global typedef
GEOSPreparedGeometry : number
Prepared geometry type.
Kind: global typedef
GEOSQueryCallback : function
Callback function for use in spatial index search calls. Pass into the query function and handle query results as the index returns them. This callback is displayed as a global member.
Kind: global typedef
GEOSSTRtree : number
STRTree index.
Kind: global typedef
GEOSTransformXYCallback ⇒ number
Callback function for use in GEOSGeom_transformXY. Allows custom function to be applied to x and y values for each coordinate in a geometry. Z and M values are unchanged by this function. Extra data for the calculation can be passed via the userdata. This callback is displayed as a global member.
Kind: global typedef
Returns: number
- 1 if calculation succeeded, 0 on failure
GEOSWKBReader : number
Reader object to read Well-Known Binary (WKB) format and construct Geometry.
Kind: global typedef
GEOSWKBWriter : number
Writer object to turn Geometry into Well-Known Binary (WKB).
Kind: global typedef
GEOSWKTReader : number
Reader object to read Well-Known Text (WKT) format and construct Geometry.
Kind: global typedef
GEOSWKTWriter : number
Writer object to turn Geometry into Well-Known Text (WKT).
Kind: global typedef
Enums
geos.GEOSBufCapStyles : enum
⏏
Cap styles control the ends of buffered lines.
Kind: global enum of geos
Read only: true
See: GEOSBuffer
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOSBUF_CAP_ROUND | number | 0 | End is rounded, with end point of original line in the centre of the round cap. |
GEOSBUF_CAP_FLAT | number | 1 | End is flat, with end point of original line at the end of the buffer |
GEOSBUF_CAP_SQUARE | number | 2 | End is flat, with end point of original line in the middle of a square enclosing that point |
geos.GEOSBufJoinStyles : enum
⏏
Join styles control the buffer shape at bends in a line.
Kind: global enum of geos
Read only: true
See: GEOSBuffer
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOSBUF_JOIN_ROUND | number | 0 | Join is rounded, essentially each line is terminated in a round cap. Form round corner. |
GEOSBUF_JOIN_MITRE | number | 1 | Join is flat, with line between buffer edges, through the join point. Forms flat corner. |
GEOSBUF_JOIN_BEVEL | number | 2 | Join is the point at which the two buffer edges intersect. Forms sharp corner. |
geos.GEOSGeomTypes : enum
⏏
Geometry type number, used by functions returning or consuming geometry types.
Kind: global enum of geos
Read only: true
See
- GEOSGeomType
- GEOSGeomTypeId
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOS_POINT | number | 0 | Point |
GEOS_LINESTRING | number | 1 | Linestring |
GEOS_LINEARRING | number | 2 | Linear ring, used within polygons |
GEOS_POLYGON | number | 3 | Polygon |
GEOS_MULTIPOINT | number | 4 | Multipoint, a homogeneous collection of points |
GEOS_MULTILINESTRING | number | 5 | Multilinestring, a homogeneous collection of linestrings |
GEOS_MULTIPOLYGON | number | 6 | Multipolygon, a homogeneous collection of polygons |
GEOS_GEOMETRYCOLLECTION | number | 7 | Geometry collection, a heterogeneous collection of geometry |
geos.GEOSMakeValidMethods : enum
⏏
Algorithm to use when repairing invalid geometries.
Kind: global enum of geos
Read only: true
See: GEOSMakeValidWithParams
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOS_MAKE_VALID_LINEWORK | number | 0 | Original method, combines all rings into a set of noded lines and then extracts valid polygons from that linework. |
GEOS_MAKE_VALID_STRUCTURE | number | 1 | Structured method, first makes all rings valid then merges shells and subtracts holes from shells to generate valid result. Assumes that holes and shells are correctly categorized. |
geos.GEOSPolygonHullParameterModes : enum
⏏
Controls the behavior of the GEOSPolygonHullSimplify parameter.
Kind: global enum of geos
Read only: true
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOSHULL_PARAM_VERTEX_RATIO | number | 0 | Fraction of input vertices retained |
GEOSHULL_PARAM_AREA_RATIO | number | 1 | Ratio of simplified hull area to input area |
geos.GEOSPrecisionRules : enum
⏏
Controls the behavior of GEOSGeom_setPrecision() when altering the precision of a geometry.
Kind: global enum of geos
Read only: true
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOS_PREC_VALID_OUTPUT | number | 0 | The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed. |
GEOS_PREC_NO_TOPO | number | 1 | Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called "GEOS_PREC_POINTWISE" - the current name is historical.) |
GEOS_PREC_KEEP_COLLAPSED | number | 2 | Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed. |
geos.GEOSRelateBoundaryNodeRules : enum
⏏
Controls the behavior of the result of GEOSRelate when returning DE9IM results for two geometries.
Kind: global enum of geos
Read only: true
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOSRELATE_BNR_MOD2 | number | 0 | See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2() |
GEOSRELATE_BNR_OGC | number | 1 | Same as GEOSRELATE_BNR_MOD2 |
GEOSRELATE_BNR_ENDPOINT | number | 2 | See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint() |
GEOSRELATE_BNR_MULTIVALENT_ENDPOINT | number | 3 | See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint() |
GEOSRELATE_BNR_MONOVALENT_ENDPOINT | number | 4 | See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint() |
geos.GEOSValidFlags : enum
⏏
Change behaviour of validity testing in GEOSisValidDetail
Kind: global enum of geos
Read only: true
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE | number | 0 | Allow self-touching rings to form a hole in a polygon. |
geos.GEOSVoronoiFlags : enum
⏏
Change behaviour of GEOSVoronoiDiagram
Kind: global enum of geos
Read only: true
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOS_VORONOI_ONLY_EDGES | number | 0 | Return only edges of the Voronoi cells, as a MultiLineString |
GEOS_VORONOI_PRESERVE_ORDER | number | 1 | Preserve order of inputs, such that the nth cell in the result corresponds to the nth vertex in the input. If this cannot be done, such as for inputs that contain repeated points, GEOSVoronoiDiagram will return NULL. |
geos.GEOSWKBByteOrders : enum
⏏
Well-known binary byte orders used when writing to WKB.
Kind: global enum of geos
Read only: true
See: GEOSWKBWriter_setByteOrder
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOS_WKB_XDR | number | 0 | Big Endian |
GEOS_WKB_NDR | number | 1 | Little Endian |
geos.GEOSWKBFlavors : enum
⏏
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.
Kind: global enum of geos
Read only: true
See: GEOSWKBWriter_setFlavor
Properties
Name | Type | Default | Description |
---|---|---|---|
GEOS_WKB_EXTENDED | number | 0 | Extended |
GEOS_WKB_ISO | number | 1 | ISO |