sedona_write_geojson {apache.sedona}R Documentation

Write SpatialRDD into a GeoJSON file.

Description

Export serialized data from a Sedona SpatialRDD into a GeoJSON file.

Usage

sedona_write_geojson(x, output_location)

Arguments

x

The SpatialRDD object.

output_location

Location of the output file.

Value

No return value.

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_read_wkt(), sedona_save_spatial_rdd(), sedona_write_wkb(), sedona_write_wkt()

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"
  )
  sedona_write_geojson(rdd, "/tmp/example.json")
}


[Package apache.sedona version 1.2.1 Index]