Skip to contents

Computes the bounding box, grid spacing, and cell count from the coordinate table and stores them in x$grid.

Usage

hm_get_grid_geometry(x)

Arguments

x

An hm_hazard object returned by [hm_read_netcdf()].

Value

The same object with a new $grid element containing nx, ny, dx, dy, bbox, n_cells, and grid_type.

See also

[hm_standardize_coords()]

Examples

f <- system.file("extdata", "Copernicus_dailymax_1994_2021.nc",
                 package = "HazardMaps")
x <- hm_read_netcdf(f, var = "i10fg")
x <- hm_standardize_coords(x)
x <- hm_get_grid_geometry(x)
x$grid$bbox
#> lon_min lon_max lat_min lat_max 
#>    11.5    15.0    44.0    47.0