Skip to content

Correct Issues with Initial scrg__get_geometry_in_bbox functions #2

@brotherjack

Description

@brotherjack

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).

  • R function overloading is not working as expected, so calling up source('utils.R') will result in only the last scrg__get_geometry_in_bbox function being loaded. I believe that this can be corrected with S4 dispatch, so I'll read up on that and implement it.
  • The function should have the option to accept Lat/Lon as well as Lon/Lat.
  • Currently the function only will work if the sf package explicitly switches off spherical geometry (ie. sf_use_s2(FALSE) is run). If this is not the case, the call to st_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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions