Skip to content
On this page

geos.GEOSSTRtree_create ⇒ number

Creates a GEOS STRTree, a spatial index for quickly querying geometries by their bounding boxes.

Kind: Exported member
Returns: number - A pointer to the GEOS STRTree object.

ParamTypeDescription
nodeCapacitynumberThe 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.

geos.GEOSSTRtree_create_r ⇒ number

Creates a GEOS STRTree with a context handle, a spatial index for quickly querying geometries by their bounding boxes.

Kind: Exported member
Returns: number - A pointer to the GEOS STRTree object.

ParamTypeDescription
handlenumberThe context handle to use for error reporting and memory management.
nodeCapacitynumberThe 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.

geos.GEOSSTRtree_destroy ⏏

Destroys an STRtree and frees its memory.

Kind: Exported member

ParamTypeDescription
treenumberA pointer to a GEOSSTRtree object.

geos.GEOSSTRtree_destroy_r ⏏

Destroys a GEOSSTRtree spatial index.

Kind: Exported member
See: https://libgeos.org/doxygen/geos__c_8h.html#a1323e

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
treenumberThe GEOSSTRtree pointer to destroy.

geos.GEOSSTRtree_insert ⏏

Inserts a geometry into a GEOS STRTree, along with an associated item that can be retrieved later.

Kind: Exported member

ParamTypeDescription
treenumberA pointer to the GEOS STRTree object.
gnumberA pointer to the GEOS geometry object to insert.
itemnumberA pointer to the item associated with the geometry. This can be any arbitrary data that can be cast to a void pointer.

geos.GEOSSTRtree_insert_r ⏏

Inserts a geometry into a GEOS STRTree with a context handle, along with an associated item that can be retrieved later.

Kind: Exported member

ParamTypeDescription
handlenumberThe context handle to use for error reporting and memory management.
treenumberA pointer to the GEOS STRTree object.
gnumberA pointer to the GEOS geometry object to insert.
itemnumberA pointer to the item associated with the geometry. This can be any arbitrary data that can be cast to a void pointer.

geos.GEOSSTRtree_iterate ⏏

Iterates over every item in an STRtree.

Kind: Exported member

ParamTypeDescription
treenumberA pointer to a GEOSSTRtree object.
callbackfunctionA function to be called for each item in the tree.
userdataanyAn optional user data to be passed to the callback function.

geos.GEOSSTRtree_iterate_r ⏏

Iterates over every item in an STRtree using a reentrant context handle.

Kind: Exported member

ParamTypeDescription
handlenumberA pointer to a GEOSpointer context handle.
treenumberA pointer to a GEOSSTRtree object.
callbackfunctionA function to be called for each item in the tree.
userdataanyAn optional user data to be passed to the callback function.

geos.GEOSSTRtree_nearest ⇒ number

Returns the item whose extent is nearest to the given geometry's envelope.

Kind: Exported member
Returns: number - A pointer to the nearest item, or NULL if the tree is empty.

ParamTypeDescription
treenumberThe GEOSSTRtree to query.
geomnumberThe GEOSGeometry whose envelope is used for querying.

geos.GEOSSTRtree_nearest_generic ⇒ any

Returns the item whose extent is nearest to the given item's envelope, using a custom distance function.

Kind: Exported member
Returns: any - A pointer to the nearest item, or NULL if the tree is empty or an error occurred.

ParamTypeDescription
treenumberThe GEOSSTRtree to query.
itemanyThe item whose envelope is used for querying.
itemEnvelopenumberThe GEOSGeometry representing the envelope of the item.
distancefnfunctionThe GEOSDistanceCallback function to compute the distance between two items.
userdataanyAn optional pointer to user data that is passed to the distance function.

geos.GEOSSTRtree_nearest_generic_r ⇒ any

Returns the item whose extent is nearest to the given item's envelope, using a custom distance function.

Kind: Exported member
Returns: any - A pointer to the nearest item, or NULL if the tree is empty or an error occurred.

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
treenumberThe GEOSSTRtree to query.
itemanyThe item whose envelope is used for querying.
itemEnvelopenumberThe GEOSGeometry representing the envelope of the item.
distancefnfunctionThe GEOSDistanceCallback function to compute the distance between two items.
userdataanyAn optional pointer to user data that is passed to the distance function and the callback function.

geos.GEOSSTRtree_nearest_r ⇒ number

Returns the item whose extent is nearest to the given geometry's envelope, using a custom distance function.

Kind: Exported member
Returns: number - A pointer to the nearest item, or NULL if the tree is empty or an error occurred.

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
treenumberThe GEOSSTRtree to query.
geomnumberThe GEOSGeometry whose envelope is used for querying.

geos.GEOSSTRtree_query ⏏

Queries a GEOS STRTree for all geometries whose bounding boxes intersect with the given geometry's bounding box, and calls a callback function for each matching pair.

Kind: Exported member

ParamTypeDescription
treenumberA pointer to the GEOS STRTree object.
gnumberA pointer to the GEOS geometry object to query with.
callbackfunctionA function that takes two void pointers as arguments: one for the item associated with the tree geometry, and one for the user data passed to this function. The callback function is called for each matching pair of geometries in the tree and the query geometry. The callback function should return 1 to continue the query or 0 to stop it.
userdataanyA pointer to any user data that needs to be passed to the callback function. This can be any arbitrary data that can be cast to a void pointer.

geos.GEOSSTRtree_query_r ⏏

Queries the tree for all items whose extents intersect the given geometry's envelope and applies an item visitor function to them.

Kind: Exported member

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
treenumberThe GEOSSTRtree to query.
gnumberThe GEOSGeometry whose envelope is used for querying.
callbacknumberThe GEOSQueryCallback function to apply to the items found.
userdatanumberAn optional pointer to user data that is passed to the callback function.

geos.GEOSSTRtree_remove ⇒ number

Removes an item from an STRtree that has a matching geometry and user data.

Kind: Exported member
Returns: number - 1 if the item was found and removed, 0 otherwise.

ParamTypeDescription
treenumberA pointer to a GEOSSTRtree object.
gnumberA pointer to a GEOSGeometry object representing the envelope of the item to be removed.
itemanyThe user data of the item to be removed.

geos.GEOSSTRtree_remove_r ⇒ number

Removes an item from an STRtree that has a matching geometry and user data using a reentrant context handle.

Kind: Exported member
Returns: number - 1 if the item was found and removed, 0 otherwise.

ParamTypeDescription
handlenumberA pointer to a GEOSpointer context handle.
treenumberA pointer to a GEOSSTRtree object.
gnumberA pointer to a GEOSGeometry object representing the envelope of the item to be removed.
itemanyThe user data of the item to be removed.