Skip to contents

Reading and Writing Spatial DataFrames

Functions for reading and writing Spark DataFrames.

spark_read_shapefile() spark_read_geojson() spark_read_geoparquet()
Read geospatial data into a Spark DataFrame.
spark_write_geojson() spark_write_geoparquet() spark_write_raster()
Write geospatial data from a Spark DataFrame.
sedona_save_spatial_rdd()
Save a Spark dataframe containing exactly 1 spatial column into a file.

Reading and Writing Spatial RDDs

Functions for reading and writing Spatial RDDs.

sedona_read_dsv_to_typed_rdd()
Create a typed SpatialRDD from a delimiter-separated values data source.
sedona_read_geojson() sedona_read_wkb() sedona_read_wkt() sedona_read_shapefile()
Read geospatial data into a Spatial RDD
sedona_read_shapefile_to_typed_rdd() sedona_read_geojson_to_typed_rdd()
(Deprecated) Create a typed SpatialRDD from a shapefile or geojson data source.
sedona_write_wkb() sedona_write_wkt() sedona_write_geojson()
Write SpatialRDD into a file.

Conversion

Functions to convert between Spark DataFrames and Spatial RDDs.

sdf_register(<spatial_rdd>) as.spark.dataframe()
Import data from a spatial RDD into a Spark Dataframe.
to_spatial_rdd()
Export a Spark SQL query with a spatial column into a Sedona spatial RDD.

RDD functions

Visualization

sedona_render_choropleth_map()
Visualize a Sedona spatial RDD using a choropleth map.
sedona_render_heatmap()
Visualize a Sedona spatial RDD using a heatmap.
sedona_render_scatter_plot()
Visualize a Sedona spatial RDD using a scatter plot.

Joins

sedona_spatial_join()
Perform a spatial join operation on two Sedona spatial RDDs.
sedona_spatial_join_count_by_key()
Perform a spatial count-by-key operation based on two Sedona spatial RDDs.

Query

sedona_knn_query()
Query the k nearest spatial objects.
sedona_range_query()
Execute a range query.

Others

sedona_apply_spatial_partitioner()
Apply a spatial partitioner to a Sedona spatial RDD.
sedona_build_index()
Build an index on a Sedona spatial RDD.
approx_count()
Find the approximate total number of records within a Spatial RDD.
crs_transform()
Perform a CRS transformation.
minimum_bounding_box()
Find the minimal bounding box of a geometry.
new_bounding_box()
Construct a bounding box object.