Permian-Global-Research / ezwarp

An R package to make using gdal warp ez.
https://permian-global-research.github.io/ezwarp/
Apache License 2.0
8 stars 0 forks source link

inegrate wk::grd #14

Open h-a-graham opened 1 year ago

h-a-graham commented 1 year ago

As suggested by @mdsumner here: https://github.com/Permian-Global-Research/ezwarp/discussions/9#discussioncomment-4785982

wk::grd has some solid grid specification logic and would be a much better fit for ezgrid than the current (and a bit slack) s3 approach. I'm thinking keep it much the same but wrap the ext, dim and crs within grd - leave the source slot open as this will be needed internally.

Also I think changing the current "matrix" output to "rayshader" as this is fairly niche and different to matrix orientation in general.

Then have the marix option but make it immediately compatible with grd_rect so we can have "grd" as an out_class option.

https://paleolimbot.github.io/wk/reference/grd.html

mdsumner commented 1 year ago

be careful with rayshader orientation, is it image or rasterImage or something else? it's confusing! personally I advise rasterImage but it's not well supported

h-a-graham commented 1 year ago

Yeah I'm realising that now! So basically, rayshader seems to internally reorientate from the output of raster::as.matrix. which is a bit of a pain. Alhough I can see why this came about...

sheesh this raster plotting stuff is confusing!

I think having a "rayshader" output class is the best and safest way to keep this - I would rather keep the "matrix" output consistent with what is expected in from wk::grd_rct. maybe it's even better to remove "matrix" all together and just have a "grd" output instead - seems to be that is a much better container than a matrix with spatial attributes (as it is now).

lot's to think about!