SimpleSDMLayers.jl icon indicating copy to clipboard operation
SimpleSDMLayers.jl copied to clipboard

✅ resizing one layer to the size of another, and ambiguity in `rescale` function meaning

Open gottacatchenall opened this issue 2 years ago • 20 comments

Description of the to-do item

As far as I can tell, there is not a function to take a raster and change its resolution to match the dimensions of a target raster. Doing this would be straightforward by iterating over the longitudes(a), latitudes(a) in the smaller raster and then access the values of the other raster at that coord, and have the getindex(b::SimpleSDMLayer, lat, long) handle that conversion.

When trying to do this I found rescale(layer1::T, layer2::T) where {T <: SimpleSDMLayer},which scales the values of a given raster to match a target, but not dimensions. To avoid this semantic ambiguity, perhaps the method rescale could rescale both values and dimensions by default with kw arguments to turn either off

gottacatchenall avatar Oct 24 '21 20:10 gottacatchenall