crs_transform: Perform a CRS transformation.

Description Usage Arguments Examples

View source: R/spatial_rdd.R

Description

Transform data within a spatial RDD from one coordinate reference system to another.

Usage

1
crs_transform(x, src_epsg_crs_code, dst_epsg_crs_code, strict = FALSE)

Arguments

x

The spatial RDD to be processed.

src_epsg_crs_code

Coordinate reference system to transform from (e.g., "epsg:4326", "epsg:3857", etc).

dst_epsg_crs_code

Coordinate reference system to transform to. (e.g., "epsg:4326", "epsg:3857", etc).

strict

If FALSE (default), then ignore the "Bursa-Wolf Parameters Required" error.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(sparklyr)
library(sparklyr.sedona)

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

if (!inherits(sc, "test_connection")) {
  input_location <- system.file(
    file.path("extdata", "polygon.json"), package = "sparklyr.sedona"
  )
  rdd <- sedona_read_geojson_to_typed_rdd(
    sc, location = input_location, type = "polygon"
  )
  crs_transform(
    rdd, src_epsg_crs_code = "epsg:4326", dst_epsg_crs_code = "epsg:3857"
  )
}

r-spark/sparklyr.sedona documentation built on Dec. 22, 2021, 11:56 a.m.