Skip to contents

Reads the index of a set written by a5_write_pyramid_set(), set.json, without opening any shard. A renderer reads it first, then the footers of the shards its view meets.

Usage

a5_pyramid_set_info(src)

Arguments

src

The set's directory, or its set.json.

Value

A list of class a5pyramid_set_info:

  • path: the set's directory.

  • format_version, generator, a5_crate and a5_index, as in a5_pyramid_info().

  • data_resolution: the leaves' resolution.

  • bbox: c(xmin, ymin, xmax, ymax) of every shard.

  • columns: a tibble of the value columns' name, type, reducer, codec (see a5_pyramid(); NA for a column that stores its values) and sd, the standard deviation that scaled a "rep_child" column (1 where the leaves' standard deviation is 0 or undefined; NA for other reducers and older files), and dim, the elements per cell of a vector column (NA for scalar columns).

  • tiers: a tibble with one row per tier: tier (from 0), lod_min, lod_max, shard_resolution, tile_size, row_group_size (NA for one tile a row group), and its shards, rows and bytes.

  • weights: the weights column every shard stores (a list of its name and type), or NULL.

  • shards: a tibble with one row per shard: tier, cell (the shard cell, an a5R::a5_cell), path (relative to the set's directory; NA for a shard listed as empty, with no file), rows, tiles, bytes, footer_bytes (what a reader fetches to open it) and xmin, ymin, xmax, ymax; for a shard table, its writer's own columns follow, read with arrow where it is installed.

  • metadata: the set's metadata, a named character vector.

See also

a5_pyramid_info() for one shard.

Examples

library(a5R)
centre <- a5_lonlat_to_cell(-3.19, 55.95, resolution = 10)
cells <- a5_uncompact(a5_spherical_cap(centre, 3000), resolution = 15)
dest <- tempfile()
a5_write_pyramid_set(data.frame(cell = cells, value = runif(length(cells))), dest)
a5_pyramid_set_info(dest)$tiers
#> # A tibble: 2 × 9
#>    tier lod_min lod_max shard_resolution tile_size row_group_size shards  rows
#>   <int>   <int>   <int>            <int>     <int>          <int>  <int> <dbl>
#> 1     0       2      12                0     16384             NA      2    46
#> 2     1      13      15                3     16384             NA      1  1380
#> # ℹ 1 more variable: bytes <dbl>