sdf_register.spatial_rdd {apache.sedona}R Documentation

Import data from a spatial RDD into a Spark Dataframe.

Description

Import data from a spatial RDD into a Spark Dataframe.

Usage

## S3 method for class 'spatial_rdd'
sdf_register(x, name = NULL)

Arguments

x

A spatial RDD.

name

Name to assign to the resulting Spark temporary view. If unspecified, then a random name will be assigned.

Value

A Spark Dataframe containing the imported spatial data.

Examples

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)
}


[Package apache.sedona version 1.2.1 Index]