SkillAgentSearch skills...

WorldClimTiles

Functions to quickly download and merge worldclim data at 0.5 arcmin resolution

Install / Use

/learn @kapitzas/WorldClimTiles
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

WorldClimTiles

Installation

devtools::install_github("kapitzas/WorldClimTiles")

Background

Due to the size of the global data sets, high resolution WorldClim and SRTM data are downloadable in spatial tiles. One has to manually identify the tiles that are needed for a study area, download them and then merge them into single raster objects, which can be a bit cumbersome and messy to do. Here, I provide three simple functions that a) identify which tiles you need for your study area (simply supply a raster or feature), b) allow you to download the data and c) merge the data to the final raster object for your study area.

Examples

Get tile names

boundary <- getData("GADM", country = "FRA", level =0) #France country borders
wc_tiles <- tile_name(boundary, "worldclim") #for 0.5 arcmin worldclim tiles of france
srtm_tiles <- tile_name(boundary, "srtm") #for 90m srtm tiles of france

Download tiles

tiles <- tile_get(wc_tiles, "worldclim", path = my_path) #download and load worldclim
tiles <- tile_get(srtm_tiles, "srtm", path = my_path) #download and load srtm

Merge tiles

final <- tile_merge(tiles)
final <- tile_merge(tiles, fac = 10) #Reprojects data to 10 times smaller res, i.e. to get srtm data from 90m to approx 1km resolution.

===========

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated1y ago
Forks0

Languages

R

Security Score

55/100

Audited on Mar 22, 2025

No findings