Description Usage Arguments See Also Examples
View source: R/data_interface.R
Export serialized data from a Spark dataframe containing exactly 1 spatial column into a file.
1 2 3 4 5 6 | sedona_save_spatial_rdd(
x,
spatial_col,
output_location,
output_format = c("wkb", "wkt", "geojson")
)
|
x |
A Spark dataframe object in sparklyr or a dplyr expression representing a Spark SQL query. |
spatial_col |
The name of the spatial column. |
output_location |
Location of the output file. |
output_format |
Format of the output. |
Other Sedona data inferface functions:
sedona_read_dsv_to_typed_rdd()
,
sedona_read_geojson_to_typed_rdd()
,
sedona_read_geojson()
,
sedona_read_shapefile()
,
sedona_read_wkb()
,
sedona_read_wkt()
,
sedona_write_geojson()
,
sedona_write_wkb()
,
sedona_write_wkt()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(sparklyr)
library(sparklyr.sedona)
sc <- spark_connect(master = "spark://HOST:PORT")
if (!inherits(sc, "test_connection")) {
tbl <- dplyr::tbl(
sc,
dplyr::sql("SELECT ST_GeomFromText('POINT(-71.064544 42.28787)') AS `pt`")
)
sedona_save_spatial_rdd(
tbl %>% dplyr::mutate(id = 1),
spatial_col = "pt",
output_location = "/tmp/pts.wkb",
output_format = "wkb"
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.