sedona_read_wkt {apache.sedona}R Documentation

Create a SpatialRDD from a Well-Known Text (WKT) data source.

Description

Create a generic SpatialRDD from a Well-Known Text (WKT) data source.

Usage

sedona_read_wkt(
  sc,
  location,
  wkt_col_idx = 0L,
  allow_invalid_geometries = TRUE,
  skip_syntactically_invalid_geometries = TRUE,
  storage_level = "MEMORY_ONLY",
  repartition = 1L
)

Arguments

sc

A spark_connection.

location

Location of the data source.

wkt_col_idx

Zero-based index of column containing hex-encoded WKB data (default: 0).

allow_invalid_geometries

Whether to allow topology-invalid geometries to exist in the resulting RDD.

skip_syntactically_invalid_geometries

Whether to allows Sedona to automatically skip syntax-invalid geometries, rather than throwing errorings.

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 SpatialRDD.

See Also

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

Examples

library(sparklyr)
library(apache.sedona)

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

if (!inherits(sc, "test_connection")) {
  input_location <- "/dev/null" # replace it with the path to your input file
  rdd <- sedona_read_wkt(
    sc,
    location = input_location,
    wkt_col_idx = 0L
  )
}


[Package apache.sedona version 1.1.1 Index]