-
Notifications
You must be signed in to change notification settings - Fork 12
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
Multiple points extraction (wish) #106
Comments
I don't think hyper_filter(lon = between(lon, lona, lonb)) You can't easily find individually arbitrary points with tidync, it certainly would be possible but I'm uncomfortable about when a point belongs in a cell or is near to a cell reference point. If it's points in cells and the grid is a raster, it's vastly simpler to use Is your raster not regular in longlat? (this is a loaded question ... I'm not just trolling), if it is then b <- raster::brick(filnam)
raster::extract(b, cbind(lona, lata)) ## or multiple lon,lat values is way better than tidync. That said we have toyed with extraction ideas for points (and lines and polygons) in tidync, but I always go back to more base-ways of working for that stuff and so far that has worked for me. I'm always interested to explore though, I might try a "nearest-neighbour" cell lookup for your use case (...) |
Thanks for your answer and efforts! I have been using Anyways, a nearest-neighbour cell lookup has great practical potential. I use it all the time. |
Fwiw the best speed up for extract is to calculate the cell number for repeated lookups - though, it doesn't help if you can do it all on one brick, and also not for weightings or interpolation). It's very hard to beat raster for NetCDF (for regular grids) |
It would be great to be able to extract data from multiple points at once. That is, it would be nice if the following code would work for extracting from two points A (lona, lata), and B (lonb, latb) at once:
The text was updated successfully, but these errors were encountered: