DOI-USGS / hyRefactor

https://code.usgs.gov/wma/nhgf/reference-fabric/hyrefactor
Creative Commons Zero v1.0 Universal
5 stars 0 forks source link

Add Geometry fixes for reconciled catchments and length map calculations #17

Closed mikejohnson51 closed 2 years ago

mikejohnson51 commented 2 years ago

Hi @dblodgett-usgs,

This PR address #16. Functions are exported directly, and embedded in reconcile_catchment_divides with the flag "fix_catchments".

The package builds and loads correctly.

Test are written in test_geometries.R based on a minimal dataset created in inst/extdata/gage_01013500_data.R and stored in inst/extdata

Structural package changes includes moving rgeos from Suggests to Imports, and adding rmapshaper to Imports.

Mini Example of new usage:

divides  <- reconcile_catchment_divides(catchment = catchments,
                                             fline_ref  = fline_ref,
                                             fline_rec = fline_rec,
                                              fdr         = fdr,
                                             fac         = fac,
                                             para       = 1, 
                                             cache    = NULL,
                                             fix_catchments = TRUE) 

This PR also adds functionality for producing length mappings for member_COMIDs via a function called add_lengthmap.

dblodgett-usgs commented 2 years ago

Thanks, Mike. This is great. I'll go ahead and merge and cross fingers on the build.