View source: R/spatial_join_op.R
sedona_spatial_join_count_by_key | R Documentation |
For each element p from spatial_rdd
, count the number of unique elements q
from query_window_rdd
such that (p, q) satisfies the spatial relation
specified by join_type
.
sedona_spatial_join_count_by_key(
spatial_rdd,
query_window_rdd,
join_type = c("contain", "intersect"),
partitioner = c("quadtree", "kdbtree"),
index_type = c("quadtree", "rtree")
)
spatial_rdd |
Spatial RDD containing geometries to be queried. |
query_window_rdd |
Spatial RDD containing the query window(s). |
join_type |
Type of the join query (must be either "contain" or
"intersect").
If |
partitioner |
Spatial partitioning to apply to both |
index_type |
Controls how |
A spatial RDD containing the join-count-by-key results.
Other Sedona spatial join operator:
sedona_spatial_join()
library(sparklyr)
library(apache.sedona)
sc <- spark_connect(master = "spark://HOST:PORT")
if (!inherits(sc, "test_connection")) {
input_location <- "/dev/null" # replace it with the path to your input file
rdd <- sedona_read_dsv_to_typed_rdd(
sc,
location = input_location,
delimiter = ",",
type = "point",
first_spatial_col_index = 1L
)
query_rdd_input_location <- "/dev/null" # replace it with the path to your input file
query_rdd <- sedona_read_shapefile_to_typed_rdd(
sc,
location = query_rdd_input_location,
type = "polygon"
)
join_result_rdd <- sedona_spatial_join_count_by_key(
rdd,
query_rdd,
join_type = "intersect",
partitioner = "quadtree"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.