Retrieve the entire INSPIRE grid.
Unlike the feature grids retrieved from z22_data,
the INSPIRE grid encompasses the entire area of Germany. You can thus use
it to join with the incomplete feature grids from z22_data
to create a complete dataset.
Arguments
- res
Resolution of the grid. Can be
"100m","250m","1km","5km","10km", or"100km".- year
Version of the grid. Can be 2015, 2017, 2018 and 2019. Defaults to the latest version.
- rasterize
If
TRUEand theterrapackage is installed, converts the attribute coordinates to aSpatRaster.- as_sf
If
TRUEand thesfpackage is installed, converts the attribute coordinates to ansftibble.- update_cache
By default, both functions cache attribute files for the remainder of the R session. They are downloaded to a temporary directory and - if the file to download already exists - are recovered from the cache. In other words, when rerunning the same request multiple times, the subsequent calls should be much faster. If
TRUE, disables caching for this call and overwrites the currently cached attribute file (if any) with a fresh one. Defaults toFALSE, i.e. always cache.
Value
A tibble, SpatRasterDataset or
sf tibble depending on the rasterize
and as_sf arguments.
If a tibble is returned each category in categories is stored in
a column. If a SpatRasterDataset is returned, each category is a
named layer.
Details
Note the uncompressed object sizes of the output (2019 version):
100 m: 38 million cells, 291 MB
250 m: 6 million cells, 47 MB
1 km: 384 thousand cells, 3 MB
5 km: 16 thousand cells, 0.12 MB
10 km: 4 thousand cells, 0.03 MB
Examples
# Get high-res grid as tibble
z22_grid("100m")
#> # A tibble: 38,171,748 × 2
#> x y
#> <dbl> <dbl>
#> 1 4334200 2684100
#> 2 4334300 2684100
#> 3 4334400 2684100
#> 4 4334500 2684100
#> 5 4334600 2684100
#> 6 4334200 2684200
#> 7 4334300 2684200
#> 8 4334400 2684200
#> 9 4334500 2684200
#> 10 4334600 2684200
#> # ℹ 38,171,738 more rows
# Get low-res grid as raster
z22_grid("1km", rasterize = TRUE)
#> class : SpatRaster
#> size : 873, 642, 1 (nrow, ncol, nlyr)
#> resolution : 1000, 1000 (x, y)
#> extent : 4031500, 4673500, 2684500, 3557500 (xmin, xmax, ymin, ymax)
#> coord. ref. : ETRS89-extended / LAEA Europe (EPSG:3035)