sedona_read_geojson_to_typed_rdd: Create a typed SpatialRDD from a GeoJSON data source.

Description Usage Arguments Value See Also Examples

View source: R/data_interface.R

Description

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

Usage

1
2
3
4
5
6
7
8
sedona_read_geojson_to_typed_rdd(
  sc,
  location,
  type = c("point", "polygon", "linestring"),
  has_non_spatial_attrs = TRUE,
  storage_level = "MEMORY_ONLY",
  repartition = 1L
)

Arguments

sc

A spark_connection.

location

Location of the data source.

type

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

has_non_spatial_attrs

Whether the input contains non-spatial attributes.

storage_level

Storage level of the RDD (default: MEMORY_ONLY).

repartition

The minimum number of partitions to have in the resulting RDD (default: 1).

Value

A typed SpatialRDD.

See Also

Other Sedona data inferface functions: sedona_read_dsv_to_typed_rdd(), sedona_read_geojson(), sedona_read_shapefile_to_typed_rdd(), sedona_read_shapefile(), sedona_read_wkb(), sedona_read_wkt(), sedona_save_spatial_rdd(), sedona_write_geojson(), sedona_write_wkb(), sedona_write_wkt()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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"
  )
}

apache.sedona documentation built on Oct. 11, 2021, 9:06 a.m.