Skip to content

Commit

Permalink
Update WORLDCLIM_URI in shared.jl (#67)
Browse files Browse the repository at this point in the history
* Update WORLDCLIM_URI in shared.jl

* Update test worldclim-bioclim.jl

* Update worldclim-climate.jl

* Update test worldclim-elevation.jl

* Update test worldclim-weather.jl

* Update test worldclim-bioclim.jl

* Update test worldclim-climate.jl

* Update test worldclim-elevation.jl

* Update worldclim-weather.jl
  • Loading branch information
sylvaticus committed Jun 3, 2024
1 parent cc4fdc7 commit 62d21b8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/worldclim/shared.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See: [www.worldclim.org](https://www.worldclim.org)
"""
struct WorldClim{X} <: RasterDataSource end

const WORLDCLIM_URI = URI(scheme="https", host="biogeo.ucdavis.edu", path="/data/worldclim/v2.1")
const WORLDCLIM_URI = URI(scheme="https", host="geodata.ucdavis.edu", path="/climate/worldclim/2_1")

resolutions(::Type{<:WorldClim}) = ("30s", "2.5m", "5m", "10m")
defres(::Type{<:WorldClim}) = "10m"
Expand Down
2 changes: 1 addition & 1 deletion test/worldclim-bioclim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using RasterDataSources, URIs, Test, Dates
using RasterDataSources: rastername, rasterpath, zipurl, zipname, zippath

@testset "WorldClim BioClim" begin
zip_url = URI(scheme="https", host="biogeo.ucdavis.edu", path="/data/worldclim/v2.1/base/wc2.1_10m_bio.zip")
zip_url = URI(scheme="https", host="geodata.ucdavis.edu", path="/climate/worldclim/2_1/base/wc2.1_10m_bio.zip")
@test zipurl(WorldClim{BioClim}, 2; res="10m") == zip_url
@test zipname(WorldClim{BioClim}, 2; res="10m") == "wc2.1_10m_bio.zip"

Expand Down
2 changes: 1 addition & 1 deletion test/worldclim-climate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using RasterDataSources: rastername, rasterpath, zipurl, zipname, zippath

@testset "WorldClim Climate" begin

zip_url = URI(scheme="https", host="biogeo.ucdavis.edu", path="/data/worldclim/v2.1/base/wc2.1_10m_wind.zip")
zip_url = URI(scheme="https", host="geodata.ucdavis.edu", path="/climate/worldclim/2_1/base/wc2.1_10m_wind.zip")
@test zipurl(WorldClim{Climate}, :wind; res="10m") == zip_url
@test zipname(WorldClim{Climate}, :wind; res="10m") == "wc2.1_10m_wind.zip"

Expand Down
2 changes: 1 addition & 1 deletion test/worldclim-elevation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using RasterDataSources, URIs, Test, Dates
using RasterDataSources: rastername, rasterpath, zipurl, zipname, zippath

@testset "WorldClim Elevation" begin
zip_url = URI(scheme="https", host="biogeo.ucdavis.edu", path="/data/worldclim/v2.1/base/wc2.1_10m_elev.zip")
zip_url = URI(scheme="https", host="geodata.ucdavis.edu", path="/climate/worldclim/2_1/base/wc2.1_10m_elev.zip")
@test zipurl(WorldClim{Elevation}, :elev; res="10m") == zip_url
@test zipname(WorldClim{Elevation}, :elev; res="10m") == "wc2.1_10m_elev.zip"

Expand Down
2 changes: 1 addition & 1 deletion test/worldclim-weather.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using RasterDataSources: rastername, rasterpath, zipurl, zipname, zippath
zip_file = joinpath(ENV["RASTERDATASOURCES_PATH"], "WorldClim", "Weather", "zips", "wc2.1_2.5m_prec_2010-2018.zip")
@test zippath(WorldClim{Weather}, :prec; decade=Date(2010)) == zip_file
@test zipurl(WorldClim{Weather}, :prec; decade=Date(2010)) ==
URI(scheme="https", host="biogeo.ucdavis.edu", path="/data/worldclim/v2.1/hist/wc2.1_2.5m_prec_2010-2018.zip")
URI(scheme="https", host="geodata.ucdavis.edu", path="/climate/worldclim/2_1/hist/wc2.1_2.5m_prec_2010-2018.zip")
@test zipname(WorldClim{Weather}, :prec; decade=Date(2010)) ==
"wc2.1_2.5m_prec_2010-2018.zip"

Expand Down

0 comments on commit 62d21b8

Please sign in to comment.