Skip to content

geos.GEOSSTRtree_build ⇒ number

Construct an STRtree from items that have been inserted. Once constructed, no more items may be inserted into the tree. Functions that require a constructed tree will build it automatically, so there is no need to call GEOSSTRtree_build unless it is desired to explicitly construct the tree in a certain section of code or using a certain thread.

Kind: global property of geos
Returns: number - 1 on success, 0 on error

ParamTypeDescription
treeGEOSSTRtreethe GEOSSTRtree to apply the build to

geos.GEOSSTRtree_build_r ⇒ number

Construct an STRtree from items that have been inserted. Once constructed, no more items may be inserted into the tree. Functions that require a constructed tree will build it automatically, so there is no need to call GEOSSTRtree_build unless it is desired to explicitly construct the tree in a certain section of code or using a certain thread.

Kind: global property of geos
Returns: number - 1 on success, 0 on error

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe GEOSSTRtree to apply the build to

geos.GEOSSTRtree_create ⇒ GEOSSTRtree

Create a new GEOSSTRtree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional spatial data.

Kind: global property of geos
Returns: GEOSSTRtree - a pointer to the created tree

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 ⇒ GEOSSTRtree

Create a new GEOSSTRtree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional spatial data.

Kind: global property of geos
Returns: GEOSSTRtree - a pointer to the created tree

ParamTypeDescription
handleGEOSContextHandle_t-
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 ⇒ null

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.

Kind: global property of geos
Returns: null - void

ParamTypeDescription
treeGEOSSTRtreethe GEOSSTRtree to destroy

geos.GEOSSTRtree_destroy_r ⇒ null

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.

Kind: global property of geos
Returns: null - void

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe GEOSSTRtree to destroy

geos.GEOSSTRtree_insert ⇒ null

Insert an item into an GEOSSTRtree

Kind: global property of geos
Returns: null - void

ParamTypeDescription
treeGEOSSTRtreethe GEOSSTRtree in which the item should be inserted
gGEOSGeometrya 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.
itemPointerthe item to insert into the tree

geos.GEOSSTRtree_insert_r ⇒ null

Insert an item into an GEOSSTRtree

Kind: global property of geos
Returns: null - void

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe GEOSSTRtree in which the item should be inserted
gGEOSGeometrya 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.
itemPointerthe item to insert into the tree

geos.GEOSSTRtree_iterate ⇒ null

Iterate over all items in the GEOSSTRtree. This will not cause the tree to be constructed.

Kind: global property of geos
Returns: null - void

ParamTypeDescription
treeGEOSSTRtreethe STRtree over which to iterate
callbackGEOSQueryCallbacka function to be executed for each item in the tree.
userdataPointerpayload to pass the callback function.

geos.GEOSSTRtree_iterate_r ⇒ null

Iterate over all items in the GEOSSTRtree. This will not cause the tree to be constructed.

Kind: global property of geos
Returns: null - void

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe STRtree over which to iterate
callbackGEOSQueryCallbacka function to be executed for each item in the tree.
userdataPointerpayload to pass the callback function.

geos.GEOSSTRtree_nearest ⇒ number

Returns the nearest item in the GEOSSTRtree to the supplied geometry. All items in the tree MUST be of type GEOSGeometry. If this is not the case, use GEOSSTRtree_nearest_generic() instead. The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: number - a const pointer to the nearest GEOSGeometry in the tree to 'geom', or NULL in case of exception

ParamTypeDescription
treeGEOSSTRtreethe GEOSSTRtree to search
geomGEOSGeometrythe geometry with which the tree should be queried

geos.GEOSSTRtree_nearest_generic ⇒ number

Returns the nearest item in the GEOSSTRtree to the supplied item The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: number - a const pointer to the nearest item in the tree to item, or NULL in case of exception

ParamTypeDescription
treeGEOSSTRtreethe STRtree to search
itemPointerthe item with which the tree should be queried
itemEnvelopeGEOSGeometrya GEOSGeometry having the bounding box of 'item'
distancefnGEOSDistanceCallbacka 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.
userdataPointeroptional pointer to arbitrary data; will be passed to distancefn each time it is called.

geos.GEOSSTRtree_nearest_generic_r ⇒ number

Returns the nearest item in the GEOSSTRtree to the supplied item The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: number - a const pointer to the nearest item in the tree to item, or NULL in case of exception

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe STRtree to search
itemPointerthe item with which the tree should be queried
itemEnvelopeGEOSGeometrya GEOSGeometry having the bounding box of 'item'
distancefnGEOSDistanceCallbacka 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.
userdataPointeroptional pointer to arbitrary data; will be passed to distancefn each time it is called.

geos.GEOSSTRtree_nearest_r ⇒ number

Returns the nearest item in the GEOSSTRtree to the supplied geometry. All items in the tree MUST be of type GEOSGeometry. If this is not the case, use GEOSSTRtree_nearest_generic() instead. The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: number - a const pointer to the nearest GEOSGeometry in the tree to 'geom', or NULL in case of exception

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe GEOSSTRtree to search
geomGEOSGeometrythe geometry with which the tree should be queried

geos.GEOSSTRtree_query ⇒ null

Query a GEOSSTRtree for items intersecting a specified envelope. The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: null - void

ParamTypeDescription
treeGEOSSTRtreethe GEOSSTRtree to search
gGEOSGeometrya GEOSGeomety from which a query envelope will be extracted
callbackGEOSQueryCallbacka 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.
userdataPointeran optional pointer to pe passed to callback as an argument

geos.GEOSSTRtree_query_r ⇒ null

Query a GEOSSTRtree for items intersecting a specified envelope. The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: null - void

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe GEOSSTRtree to search
gGEOSGeometrya GEOSGeomety from which a query envelope will be extracted
callbackGEOSQueryCallbacka 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.
userdataPointeran optional pointer to pe passed to callback as an argument

geos.GEOSSTRtree_remove ⇒ number

Removes an item from the GEOSSTRtree The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: number - 0 if the item was not removed; 1 if the item was removed; 2 if an exception occurred

ParamTypeDescription
treeGEOSSTRtreethe STRtree from which to remove an item
gGEOSGeometrythe envelope of the item to remove
itemPointerthe item to remove

geos.GEOSSTRtree_remove_r ⇒ number

Removes an item from the GEOSSTRtree The tree will automatically be constructed if necessary, after which no more items may be added.

Kind: global property of geos
Returns: number - 0 if the item was not removed; 1 if the item was removed; 2 if an exception occurred

ParamTypeDescription
handleGEOSContextHandle_t-
treeGEOSSTRtreethe STRtree from which to remove an item
gGEOSGeometrythe envelope of the item to remove
itemPointerthe item to remove