PoisotLab / SimpleSDMLayers.jl

Simple layers for species distribution modeling and bioclimatic data
https://docs.ecojulia.org/SimpleSDMLayers.jl/stable/
MIT License
19 stars 2 forks source link

Loading parts of the datasets give different regions on different datasets #24

Closed tpoisot closed 4 years ago

tpoisot commented 4 years ago

These three are supposedly the same latitudes/longitudes (after #23) , so this is concerning - this is blocking #21

Interestingly, the longitudes seem to be right, and it's the latitudes that get shifted. This suggests that the problem is with finding the part of the buffer to read in geotiff. Alternatively, worldclim seems to get the latitudes right, so maybe there is some weird GDAL thing going on with bioclim and landcover, which would require to dig into the documentation.

chelsa-heatmap lc-heatmap worldclim-heatmap

tpoisot commented 4 years ago

This might be related to some things discussed in yeesian/ArchGDAL.jl#40, which links to something about projection issues. I think I see a way to experiment on this to figure out what is happening and how to fix it.

tpoisot commented 4 years ago

Part of the issue for landcover is that they only go up to -56 of latitude, so this explains why the longitudes were OK, but the latitudes were not. Still no idea about bioclim.

tpoisot commented 4 years ago

Same thing with bioclim, which has even weirder bounds.

tpoisot commented 4 years ago

Even with the fixed boundaries for bioclim and landcover, the layers are not aligned -- this is a comparison between worldclim (at 2 resolutions) and bioclim, with the rows indicating the (0,0) and the dot being Paris (just because I have a vague intuition of where it is:

range-comparison-chelsa range-comparison-worldclim-5 range-comparison-worldclim-10

This looks more and more like a projection issue with everything non-worldclim, so I need to do some digging to see how we can handle this from ArchGDAL. Or it can be that bioclim is not using the same boundaries at they say they use in the paper. I don't know.

tpoisot commented 4 years ago

A very likely possibility is that the code to get a subset of the data is also not dealing with shifted latitudes correctly -- in which case the geotiff function is wrong, and I need to understand how GDAL stores rasters.