| Title: | Bring Local Sf to Spark |
|---|---|
| Description: | R binds 'GeoSpark' <http://geospark.datasyslab.org/> extending 'sparklyr' <https://spark.rstudio.com/> R package to make distributed 'geocomputing' easier. Sf is a package that provides [simple features] <https://en.wikipedia.org/wiki/Simple_Features> access for R and which is a leading 'geospatial' data processing tool. 'Geospark' R package bring the same simple features access like sf but running on Spark distributed system. |
| Authors: | Harry Zhu [aut, cre], Javier Luraschi [ctb] |
| Maintainer: | Harry Zhu <[email protected]> |
| License: | Apache License (>= 2.0) |
| Version: | 0.3.1 |
| Built: | 2026-06-06 08:51:34 UTC |
| Source: | https://github.com/harryprince/geospark |
Enable GIS SQL
register_gis(sc)register_gis(sc)
sc |
a spark connection Used by 'sparklyr' to initilize GIS SQL. |
a GIS spark connection
library(geospark) library(sparklyr) sc <- spark_connect(master = "spark://HOST:PORT") # spark_connect() calls register_gis() automatically, as in: register_gis(sc)library(geospark) library(sparklyr) sc <- spark_connect(master = "spark://HOST:PORT") # spark_connect() calls register_gis() automatically, as in: register_gis(sc)
Spark geometry example.
st_example(sc, geom = "polygons")st_example(sc, geom = "polygons")
sc |
an object of spark connection |
geom |
a string of geometry type |
geometry can be "polygons" or "points"
a data.frame contains wkt format column example
library(geospark) library(sparklyr) library(utils) # use the proper master, like 'local', 'yarn', etc. sc <- spark_connect(master = "spark://HOST:PORT") st_example(sc, "polygons") st_example(sc, "points")library(geospark) library(sparklyr) library(utils) # use the proper master, like 'local', 'yarn', etc. sc <- spark_connect(master = "spark://HOST:PORT") st_example(sc, "polygons") st_example(sc, "points")