approx_count: Find the approximate total number of records within a Spatial...

View source: R/spatial_rdd.R

approx_countR Documentation

Find the approximate total number of records within a Spatial RDD.

Description

Given a Sedona spatial RDD, find the (possibly approximated) number of total records within it.

Usage

approx_count(x)

Arguments

x

A Sedona spatial RDD.

Value

Approximate number of records within the SpatialRDD.

See Also

Other Spatial RDD aggregation routine: minimum_bounding_box()

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_shapefile_to_typed_rdd(
    sc,
    location = input_location, type = "polygon"
  )
  approx_cnt <- approx_count(rdd)
}


apache.sedona documentation built on Sept. 11, 2024, 5:24 p.m.