sdf_register.spatial_rdd {apache.sedona} | R Documentation |
Import data from a spatial RDD into a Spark Dataframe.
## S3 method for class 'spatial_rdd'
sdf_register(x, name = NULL)
x |
A spatial RDD. |
name |
Name to assign to the resulting Spark temporary view. If unspecified, then a random name will be assigned. |
A Spark Dataframe containing the imported spatial data.
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_geojson_to_typed_rdd(
sc,
location = input_location,
type = "polygon"
)
sdf <- sdf_register(rdd)
}