In working with the wind/water data that @georgeomics found, I have come across various problems with the simplisticscrg__get_geometry_in_bbox functions I wrote. Here are the issues that I'm going to work on fixing (note @Bvpboy: these would be good unit test cases to write up).
In working with the wind/water data that @georgeomics found, I have come across various problems with the simplistic
scrg__get_geometry_in_bboxfunctions I wrote. Here are the issues that I'm going to work on fixing (note @Bvpboy: these would be good unit test cases to write up).source('utils.R')will result in only the lastscrg__get_geometry_in_bboxfunction being loaded. I believe that this can be corrected with S4 dispatch, so I'll read up on that and implement it.sfpackage explicitly switches off spherical geometry (ie.sf_use_s2(FALSE)is run). If this is not the case, the call tost_within(sf_object, bbox, sparse = FALSE)will fail with the following error:Error in wk_handle.wk_wkb(wkb, s2_geography_writer(oriented = oriented, : Loop 0 is not valid: Edge 1 is degenerate (duplicate vertex). If this needs to work on spherical geometries this will need to be improved, otherwise we should make it clear that s2 be deactivated for the function to work properly.