geos_basic_strtree {geos} | R Documentation |
Create a basic GEOS STRTree
Description
An experimental alternative to the geos_strtree()
that provides a more
flexible interface and potentially faster spatial joins. Notably,
geos_basic_strtree_insert()
uses wk::wk_envelope()
instead of
as_geos_geometry()
and does not keep the underlying geometry in memory.
For object types like wk::xy()
with an optimized wk::wk_envelope()
method, this is very efficient.
Usage
geos_basic_strtree(items = NULL, node_capacity = 10L)
geos_basic_strtree_size(tree)
geos_basic_strtree_finalized(tree)
geos_basic_strtree_insert(tree, items)
geos_basic_strtree_query(tree, query, limit = NA, fill = FALSE)
geos_basic_strtree_query_filtered(
tree,
query,
tree_geom,
fun,
...,
.chunk_size = 65536
)
Arguments
items |
Items to add to the tree index |
node_capacity |
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. |
tree |
|
query |
Items with which to query the tree |
limit |
The maximum number of matches in the tree to return |
fill |
If |
tree_geom |
A vctr coercible to |
fun |
A vectorized binary predicate (e.g. |
... |
Passed to |
.chunk_size |
The approximate number of comparisons to pass to |
Value
A geos_basic_strtree object
Examples
tree <- geos_basic_strtree(wk::xy(1:5, 1:5))
geos_basic_strtree_size(tree)
(geos_basic_strtree_insert(tree, wk::xy(6:10, 6:10)))
geos_basic_strtree_query(tree, as_geos_geometry("LINESTRING (3 0, 0 3)"))