read_areaframe: Read the cells of an area frame exported by the areaframe...

View source: R/connectors.R

read_areaframeR Documentation

Read the cells of an area frame exported by the areaframe service

Description

Reads a frame of grid cells as exported by the area-frame service (a Parquet file with cell_index, centroid_lon, centroid_lat, area_m2 and the geometry as WKB, plus any stratum or covariate columns) or any spatial file sf can read (GeoPackage, GeoJSON, shapefile), and returns the plain frame select_units() works on: unit, lat, lon, area in square kilometres (also used as size), and the other columns. With sf = TRUE the geometries are kept and an sf object is returned instead (see as_frame() and as_sf()).

Usage

read_areaframe(path, sf = FALSE)

Arguments

path

Path to the file.

sf

Return an sf object with the geometries.

Value

A tibble, or an sf object.

Examples

## Not run: 
cells <- read_areaframe("cells.parquet")
s <- select_units(cells, n = 300, size = "area", strata = "stratum")

## End(Not run)

fieldopt documentation built on Oct. 22, 2026, 1:07 a.m.