sedona_read_shapefile_to_typed_rdd: Create a typed SpatialRDD from a shapefile data source.

Description Usage Arguments Examples

View source: R/data_interface.R

Description

Create a typed SpatialRDD (namely, a PointRDD, a PolygonRDD, or a LineStringRDD) from a shapefile data source.

Usage

1
2
3
4
5
6
sedona_read_shapefile_to_typed_rdd(
  sc,
  location,
  type = c("point", "polygon", "linestring"),
  storage_level = "MEMORY_ONLY"
)

Arguments

sc

A spark_connection.

location

Location of the data source.

type

Type of the SpatialRDD (must be one of "point", "polygon", or "linestring".

storage_level

Storage level of the RDD (default: MEMORY_ONLY).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(sparklyr)
library(sparklyr.sedona)

sc <- spark_connect(master = "spark://HOST:PORT")

if (!inherits(sc, "test_connection")) {
  input_location <- system.file(
    file.path("extdata", "shapefile-example"), package = "sparklyr.sedona"
  )
  rdd <- sedona_read_shapefile_to_typed_rdd(
    sc, location = input_location, type = "polygon"
  )
}

r-spark/sparklyr.sedona documentation built on Dec. 22, 2021, 11:56 a.m.