Skip to content

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

NameTypeDefaultDescription
GEOSBUF_CAP_ROUNDnumber0End is rounded, with end point of original line in the centre of the round cap.
GEOSBUF_CAP_FLATnumber1End is flat, with end point of original line at the end of the buffer
GEOSBUF_CAP_SQUAREnumber2End 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

NameTypeDefaultDescription
GEOSBUF_JOIN_ROUNDnumber0Join is rounded, essentially each line is terminated in a round cap. Form round corner.
GEOSBUF_JOIN_MITREnumber1Join is flat, with line between buffer edges, through the join point. Forms flat corner.
GEOSBUF_JOIN_BEVELnumber2Join 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

NameTypeDefaultDescription
GEOS_POINTnumber0Point
GEOS_LINESTRINGnumber1Linestring
GEOS_LINEARRINGnumber2Linear ring, used within polygons
GEOS_POLYGONnumber3Polygon
GEOS_MULTIPOINTnumber4Multipoint, a homogeneous collection of points
GEOS_MULTILINESTRINGnumber5Multilinestring, a homogeneous collection of linestrings
GEOS_MULTIPOLYGONnumber6Multipolygon, a homogeneous collection of polygons
GEOS_GEOMETRYCOLLECTIONnumber7Geometry 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

NameTypeDefaultDescription
GEOS_MAKE_VALID_LINEWORKnumber0Original method, combines all rings into a set of noded lines and then extracts valid polygons from that linework.
GEOS_MAKE_VALID_STRUCTUREnumber1Structured 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

NameTypeDefaultDescription
GEOSHULL_PARAM_VERTEX_RATIOnumber0Fraction of input vertices retained
GEOSHULL_PARAM_AREA_RATIOnumber1Ratio 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

NameTypeDefaultDescription
GEOS_PREC_VALID_OUTPUTnumber0The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed.
GEOS_PREC_NO_TOPOnumber1Precision 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_COLLAPSEDnumber2Like 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

NameTypeDefaultDescription
GEOSRELATE_BNR_MOD2number0See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2()
GEOSRELATE_BNR_OGCnumber1Same as GEOSRELATE_BNR_MOD2
GEOSRELATE_BNR_ENDPOINTnumber2See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint()
GEOSRELATE_BNR_MULTIVALENT_ENDPOINTnumber3See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint()
GEOSRELATE_BNR_MONOVALENT_ENDPOINTnumber4See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint()

geos.GEOSValidFlags : enum

Change behaviour of validity testing in GEOSisValidDetail

Kind: global enum of geos
Read only: true
Properties

NameTypeDefaultDescription
GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLEnumber0Allow 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

NameTypeDefaultDescription
GEOS_VORONOI_ONLY_EDGESnumber0Return only edges of the Voronoi cells, as a MultiLineString
GEOS_VORONOI_PRESERVE_ORDERnumber1Preserve 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

NameTypeDefaultDescription
GEOS_WKB_XDRnumber0Big Endian
GEOS_WKB_NDRnumber1Little 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

NameTypeDefaultDescription
GEOS_WKB_EXTENDEDnumber0Extended
GEOS_WKB_ISOnumber1ISO