(Deprecated) Create a typed SpatialRDD from a shapefile or geojson data source.
Source:R/data_interface.R
sedona_read_shapefile_to_typed_rdd.Rd
Constructors of typed RDD (PointRDD, PolygonRDD, LineStringRDD) are soft deprecated, use non-types versions
Create a typed SpatialRDD (namely, a PointRDD, a PolygonRDD, or a LineStringRDD)
sedona_read_shapefile_to_typed_rdd
: from a shapefile data sourcesedona_read_geojson_to_typed_rdd
: from a GeoJSON data source
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).
- has_non_spatial_attrs
Whether the input contains non-spatial attributes.
- repartition
The minimum number of partitions to have in the resulting RDD (default: 1).
See also
Other Sedona RDD data interface functions:
sedona_read_dsv_to_typed_rdd()
,
sedona_read_geojson()
,
sedona_save_spatial_rdd()
,
sedona_write_wkb()
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 shapefile
rdd <- sedona_read_shapefile_to_typed_rdd(
sc,
location = input_location, type = "polygon"
)
}