Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help: Is there a way to get cellsize #415

Closed
shy86 opened this issue Apr 14, 2023 · 4 comments · Fixed by #508
Closed

Help: Is there a way to get cellsize #415

shy86 opened this issue Apr 14, 2023 · 4 comments · Fixed by #508

Comments

@shy86
Copy link

shy86 commented Apr 14, 2023

Hello,

I am new to this package and have been using R before.

In some calculations of grid cells area weighting, I need to extract the grid area. In the previous R package terra (raster) provides cellsize (area) function. Is it possible to have a similar implementation in the rasters package?

@rafaqz
Copy link
Owner

rafaqz commented Apr 14, 2023

I havent written it or planned to... does it need to be corrected for cellsize, and e.g. in square meters/kilometers?

We probably need to use Arch/GDAL.jl calls for that.

A PR would be nice if you can manage it. Make a new area.jl file in the methods folder.

@shy86
Copy link
Author

shy86 commented Apr 14, 2023

Thanks for your answer.

Yes, output units are necessary. In fact, this could be a very useful function. I'm not particularly familiar with the julia language, and I've currently written a very simple version that just uses the sine function of latitude, which may not be accurate or what you want.

After I get familiar with the Julia language, I may try to write this function and PR, but this may take longer.

I really hope that this feature can be added. Thank you very much for your work.

@rafaqz
Copy link
Owner

rafaqz commented Apr 14, 2023

It can totally be aded, but its always a question of available time. I do a PhD full time and work on many other packages.

In open source things move fastest when the person that needs something the most writes the PR!

And you need this the most and actually know what is required, so youre well ahead of me already.

@tiemvanderdeure
Copy link
Contributor

This functionality has been added in #508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants