mikejohnson51 / climateR

An R 📦 for getting point and gridded climate data by AOI
https://mikejohnson51.github.io/climateR/
MIT License
165 stars 40 forks source link

Support for SpatVector AOI #67

Closed admccurdy closed 1 year ago

admccurdy commented 1 year ago

I've had some issues with loading a local shapefile. When working with some local shapefiles the the intersect call in climater_filter causes R to crash due to a fatal error (the error is from terra not climateR). I haven't had the opportunity to test it on another machine to see if it's something to do with the local environment. I noticed that all the spatial operations involving AOI in climateR involve a conversion from a sf object to a SpatVector. With that in mind it seemed to make sense for the climateR functions to accept SpatVector objects instead of just sf (and do fewer conversions upstream). I went ahead and made a fork that includes these changes. I've only done minimal testing for my use case but it it's of interest I'm happy to make sure it's robust and do a PR.

mikejohnson51 commented 1 year ago

Hey @admccurdy! I am not sure if I understood this right. Allowing SpatVect objects is a great idea. I didn't see a PR, so went ahead an added this ability and a very general test. I hope it works for you and if you had a better solution please pass it along!

Mike