ropensci / tidync

NetCDF exploration and data extraction
https://docs.ropensci.org/tidync
90 stars 12 forks source link

polygon overlay approach #11

Open mdsumner opened 7 years ago

mdsumner commented 7 years ago

expt-group-by contains a hyper_group_by which applies a "nominal-2D" grid coordinate point in polygon approach to the "polygon overlay" task.

http://rpubs.com/cyclemumner/284383

It's a bit slow, but sp::over seems to be slow for SpatialPoints, SpatialPolygons (why?).

Here it takes 15 seconds to extract one polygon for 31 time steps, but all the time is taken by the point in polygon look up so the subsequent extraction from files shouldn't be too bad.

This needs us to be able to put sf objects in "non-geographic" spaces, to nominate any pair of dimensions in NetCDF so we can extract - and the polygon overlay is simply a grouped filter applied to the flattened slab.

mdsumner commented 7 years ago

We have a scratchy board diagram of this

https://goo.gl/photos/9CpzGKnF5g6bpw2LA