Description Usage Arguments Examples
View source: R/spatial_partitioner.R
Given a Sedona spatial RDD, partition its content using a spatial partitioner.
1 2 3 4 5 | sedona_apply_spatial_partitioner(
rdd,
partitioner = c("quadtree", "kdbtree"),
max_levels = NULL
)
|
rdd |
The spatial RDD to be partitioned. |
partitioner |
The name of a grid type to use (currently "quadtree" and
"kdbtree" are supported) or an
|
max_levels |
Maximum number of levels in the partitioning tree data
structure. If NULL (default), then use the current number of partitions
within |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(sparklyr)
library(sparklyr.sedona)
sc <- spark_connect(master = "spark://HOST:PORT")
if (!inherits(sc, "test_connection")) {
input_location <- system.file(
file.path("extdata", "arealm-tiny.csv"), package = "sparklyr.sedona"
)
rdd <- sedona_read_dsv_to_typed_rdd(
sc,
location = input_location,
delimiter = ",",
type = "point",
first_spatial_col_index = 1L
)
sedona_apply_spatial_partitioner(rdd, partitioner = "kdbtree")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.