TransWikia.com

Downloading new WorldClim version 2.1 bioclimatic variables for specific region of world using R

Geographic Information Systems Asked on November 6, 2021

I want to download the new (19) WorldClim Bioclimatic variables (version 2.1) for a specific region of the world, but it looks like you can only download the entire world, which is around 10 GB!

Around 8hrs to download with my internet connection.

I know there is a way to download tiles in R using the raster library. Here is the code:

library(raster)
getData('worldclim', var='bio', res=0.5, lon=-60, lat= -37, download = TRUE, path = "")

    *trying URL 'https://biogeo.ucdavis.edu/data/climate/worldclim/1_4/tiles/cur/bio_44.zip'
    Content type 'application/zip' length 5663180 bytes (5.4 MB)
    downloaded 5.4 MB*

As you can see, this works for worldclim version 1.4 (data are obsolete). Anyway to do the same but with worldclim 2.1?

One Answer

Check this out, I found it in another website.

"for quick and dirty solution you can replace the url that the getData() function reads for bioclim data. You can find the source code of the function here https://github.com/cran/raster/blob/master/R/getData.R#L277> . Note that there's if/else flow for different resolutions of climate data). From there you can make a custom function."

Also personally I used the code below here to download entire world data for V2 or V2.1 (basically any updated version). Replace the url and the file name in destfile and in unzip to the version and resolution you are using.

# Download 2.5 res worldclim V 2.1
P_url<- "https://biogeo.ucdavis.edu/data/worldclim/v2.1/base/wc2.1_2.5m_bio.zip"
download.file(P_url, destfile="wc2.1_2.5m_bio.zip")
unzip("wc2.1_2.5m_bio.zip")

Answered by Areej on November 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP