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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the 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
Param | Type | Description |
---|---|---|
nodeCapacity | number | 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. |
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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
nodeCapacity | number | 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. |
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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the GEOSSTRtree to destroy |
geos.GEOSSTRtree_insert ⇒ null
⏏
Insert an item into an GEOSSTRtree
Kind: global property of geos
Returns: null
- void
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the GEOSSTRtree in which the item should be inserted |
g | GEOSGeometry | 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 | Pointer | the 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the GEOSSTRtree in which the item should be inserted |
g | GEOSGeometry | 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 | Pointer | the 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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the STRtree over which to iterate |
callback | GEOSQueryCallback | a function to be executed for each item in the tree. |
userdata | Pointer | payload 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the STRtree over which to iterate |
callback | GEOSQueryCallback | a function to be executed for each item in the tree. |
userdata | Pointer | payload 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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the GEOSSTRtree to search |
geom | GEOSGeometry | the 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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the STRtree to search |
item | Pointer | the item with which the tree should be queried |
itemEnvelope | GEOSGeometry | a GEOSGeometry having the bounding box of 'item' |
distancefn | GEOSDistanceCallback | 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 | Pointer | optional 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the STRtree to search |
item | Pointer | the item with which the tree should be queried |
itemEnvelope | GEOSGeometry | a GEOSGeometry having the bounding box of 'item' |
distancefn | GEOSDistanceCallback | 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 | Pointer | optional 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the GEOSSTRtree to search |
geom | GEOSGeometry | the 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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the GEOSSTRtree to search |
g | GEOSGeometry | a GEOSGeomety from which a query envelope will be extracted |
callback | GEOSQueryCallback | 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 | Pointer | an 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the GEOSSTRtree to search |
g | GEOSGeometry | a GEOSGeomety from which a query envelope will be extracted |
callback | GEOSQueryCallback | 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 | Pointer | an 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
Param | Type | Description |
---|---|---|
tree | GEOSSTRtree | the STRtree from which to remove an item |
g | GEOSGeometry | the envelope of the item to remove |
item | Pointer | the 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
Param | Type | Description |
---|---|---|
handle | GEOSContextHandle_t | - |
tree | GEOSSTRtree | the STRtree from which to remove an item |
g | GEOSGeometry | the envelope of the item to remove |
item | Pointer | the item to remove |