Package: hydrofabric3D 0.1.97

Angus Watters

hydrofabric3D: hydrofabric3D

Cuts terrain based cross sections for a river network.

Authors:Mike Johnson [aut], Angus Watters [aut, cre], Arash Modaresi [ctb], NOAA [fnd], Lynker [fnd]

hydrofabric3D_0.1.97.tar.gz
hydrofabric3D_0.1.97.zip(r-4.5)hydrofabric3D_0.1.97.zip(r-4.4)hydrofabric3D_0.1.97.zip(r-4.3)
hydrofabric3D_0.1.97.tgz(r-4.4-any)hydrofabric3D_0.1.97.tgz(r-4.3-any)
hydrofabric3D_0.1.97.tar.gz(r-4.5-noble)hydrofabric3D_0.1.97.tar.gz(r-4.4-noble)
hydrofabric3D_0.1.97.tgz(r-4.4-emscripten)hydrofabric3D_0.1.97.tgz(r-4.3-emscripten)
hydrofabric3D.pdf |hydrofabric3D.html
hydrofabric3D/json (API)

# Install 'hydrofabric3D' in R:
install.packages('hydrofabric3D', repos = c('https://owp-spatial.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/lynker-spatial/hydrofabric3d/issues

Datasets:

On CRAN:

5.71 score 9 stars 72 scripts 56 exports 122 dependencies

Last updated 20 days agofrom:b4e6f21ecc. Checks:OK: 7. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 06 2024
R-4.5-winOKDec 06 2024
R-4.5-linuxOKDec 06 2024
R-4.4-winOKDec 06 2024
R-4.4-macOKDec 06 2024
R-4.3-winOKDec 06 2024
R-4.3-macOKDec 06 2024

Exports:add_braid_idsadd_cs_areaadd_cs_bathymetryadd_cs_id_sequenceadd_intersects_idsadd_length_coladd_point_type_countsadd_powerlaw_bankful_widthadd_reliefadd_tmp_idadjust_flagged_transectsadjust_transect_lengthsalign_banks_and_bottomsclassify_pointscompare_cs_validitycross_section_ptscs_arrangecut_cross_sectionscut_transectdiff_overlapsdrop_incomplete_cs_ptsextend_by_percentextend_transects_by_cs_attributesextend_transects_sidesextend_transects_to_polygonsfind_braidsfix_braided_transectsflag_transects_for_changegeos_extend_lineget_bank_attributesget_braid_listget_cs_bottom_lengthget_point_type_countsget_reliefget_start_nodeget_transect_extension_distances_to_polygonsget_transectsget_unique_tmp_idsget_validity_tallyis_braidedplot_cs_ptsprep_flowlinespts_to_XYrenumber_cs_idsrm_multi_intersectsrm_multiflowline_intersectionsrm_self_intersectionsselect_cs_ptsselect_transectstrim_transects_to_polygonsvalidate_classified_cs_ptsvalidate_classified_cs_pts_against_transectsvalidate_cs_ptsvalidate_cs_pts_against_transectsvalidate_transectsvalidate_transects_against_flowlines

Dependencies:AHGestimationarrowaskpassassertthatbitbit64bootcachemcellrangerclassclassIntclicliprcolorspacecpp11crayoncurldata.tabledataRetrievalDBIDescToolsdigestdplyre1071Exactexpmfansifarverfastmapforcatsfstfstcoregenericsgeodistgeojsonsfgeometriesgeosggplot2gldgluegtablehavenhmshttrhydroloomisobandjsonifyjsonliteKernSmoothlabelinglatticelibgeoslifecyclelmomlubridatelwgeommagrittrmaplegendmapsfmaptilesMASSMatrixmcomemoisemgcvmimemunsellmvtnormnhdplusToolsnlmeopensslpbapplypillarpkgconfigpngprettyunitsprogressproxypurrrR.methodsS3R.ooR.utilsR6RANNrapidjsonrrasterRColorBrewerRcppreadrreadxlrematchrlangrmapshaperrootSolverstudioapis2scalessfsfheadersslippymathsmoothrspstringistringrsysterratibbletidyrtidyselecttimechangetzdbunitsutf8V8vctrsviridisLitevroomwithrwkxml2zipzoo

Basic Use

Rendered frombasic_use.Rmdusingknitr::rmarkdownon Dec 06 2024.

Last update: 2024-12-05
Started: 2023-11-16

NOAA OWP Cross Section Generator

Rendered fromcross_section_generator.Rmdusingknitr::rmarkdownon Dec 06 2024.

Last update: 2024-12-06
Started: 2023-11-15

Readme and manuals

Help Manual

Help pageTopics
Adds attributes about the banks of each cross section in a dataframe of cross section points Function adds "bottom", "left_bank", "right_bank" columns that are the Z values of the "lowest" bottom point, and the "highest" left and right bank Z values, respectively. If there are And also a "valid_banks" column is added that is TRUE if the hy_id/cs_id set of cross section point has at least 1 bottom point with at least 1 left bank point AND 1 right bank point that are above the lowest "bottom" point.add_bank_attributes
Find braids and add to a dataframe/sf dataframe Adds a 'braid_id' and 'is_multibraid' columns to an sf dataframe containing a crosswalk_id and sf linestring geometiresadd_braid_ids
Adds a cs_area column to a set of cross section pointsadd_cs_area
Given provide inchannel widths and depths to a set of cross section points and derive estimated shapesadd_cs_bathymetry
Add a 1:number of cross sections 'cs_id' for each crosswalk_id by cs_measureadd_cs_id_sequence
Add an ID column from 'y' if it intersects with 'x'add_intersects_ids
Add a length column to a sf geometry dataframeadd_length_col
Add the count of each point type as a column to a dataframe of section pointsadd_point_type_counts
Add a points per cross section column to an sf dataframe of linestrings given a DEM and min points valueadd_points_per_cs
Add powerlaw_bankful_width columnadd_powerlaw_bankful_width
Add relief attributes to a dataframe of cross sections points Given a set of cross section points (derived from hydrofabric3D::cross_section_pts() and hydrofabric3D::classify_points()) add a "has_relief" logical value to data. The "has_relief" value is indicating whether a cross section "has relief". Relief is determined by checking each set of cross section points have a left OR right bank that has a depth difference from the bottom that isgreater than or equal to a percentage of the cross section length (e.g. Assuming a 'pct_of_length_for_relief' of 0.01 (1%) of a 100m cross section would have a relief depth threshold of 1m)add_relief
Function to add a new "tmp_id" column to a dataframe from 2 other columnsadd_tmp_id
Update a flagged set of transects by shortening them by the given left_distance and right_distance Requires 'left_distance' and 'right_distance' columns to specify how much to adjust flagged transects byadjust_flagged_transects
Extend/shrink an sf linestring dataframe by a specified lengths vectoradjust_transect_lengths
Align banks and smooth bottoms of cross section pointsalign_banks_and_bottoms
Braided Flowlinesbraided_flowlines
Classify Cross Section Points (version 3) with NA removal Version 2 of cross section point classifier function, uses 1st and 2nd derivative of the depths to better classify channel pointsclassify_points
Compare valid_banks and has_relief between 2 sets of cross section pointscompare_cs_validity
Get Points across transects with elevation valuescross_section_pts
Rearrange transects / cross sections in order from upstream to downstreamcs_arrange
Generate Cross Sections Across Hydrographic Networkcut_cross_sections
Generate a Perpendicular Linestring of a Given Widthcut_transect
Calculate the points per cross section based off length relative to a DEM Given the length of cross sections and a DEM, approximate the appropriate number of points for each cross section lengthdem_based_points_per_cs
Use sf::st_difference to resolve overlaps in polygons based on intersections with other polygonsdiff_overlaps
Remove entire cross sections that have any NA Z (depth) valuesdrop_incomplete_cs_pts
Extend an sf linestring dataframe by a percent of the lines lengthextend_by_percent
Extend transects for any transects with invalid cross section attributesextend_transects_by_cs_attributes
Given a set of transect lines, a flowline network, extend the transect lines out given distances from the left and right Flowlines are required to ensure valid transect intersection relationship is maintainedextend_transects_sides
Give a set of transecct linestrings and poylgons and get the minimum distance to extend each transect line (from both directions, to try and reach the edge of a "polygons") Superseces old version of function (now named extend_transects_to_polygons2())extend_transects_to_polygons
Given a set of linestrings, extract DEM values at points along the linestringextract_dem_values
Find braided sections of a network and return the unique crosswalk_ids for each idenfied braidfind_braids
Fix transects found on braided river sections (latest)fix_braided_transects
Add a flagged and extension distance columns to set of transects with CS attributes based on new cross section points dataflag_transects_for_change
Flowlinesflowlines
Flowlines Missing Depthflowlines_missing_depth
Extend a geos_geometry linestring from, one or both ends, by a given distance (meters)geos_extend_line
Get attributes about the banks of each cross section in a dataframe of cross section points Given a set of cross section points with point_type column, return a dataframe of the unique hy_id/cs_ids with the following calculated columns: "bottom", "left_bank", "right_bank" columns which are the Z values of the "lowest" bottom point, and the "highest" left and right bank Z values, respectively. And a "valid_banks" column indicating whether the hy_id/cs_id set of cross section point has at least a signle bottom point with at least 1 left bank point AND 1 right bank point that are above the lowest "bottom" point.get_bank_attributes
Create a list of braid IDs containing crosswalk_ids in each braidget_braid_list
Calculate the length between the leftmost and rightmost bottom point in each cross sectionget_cs_bottom_length
Get the count of each point type in a set of cross section pointsget_point_type_counts
Calculate the points per cross section based off lengthget_points_per_cs
Get relief attributes from a dataframe of cross sections points Generate a dataframe from a set of classified cross section points indicating whether a cross section "has relief". Relief is determined by checking each set of cross section points have a left OR right bank that has a depth difference from the bottom that is greater than or equal to a percentage of the cross section length (e.g. Assuming a 'pct_of_length_for_relief' of 0.01 (1%) of a 100m cross section would have a relief depth threshold of 1m)get_relief
Get a valid starting node from a graphget_start_node
Get the left and right extension distances for a set of transects out to a set of polygonsget_transect_extension_distances_to_polygons
Generate Multiple cross section along a linestringget_transects
Get a list of unique tmp_ids in a dataframeget_unique_tmp_ids
Get a total count of the validity attributesget_validity_tally
Invalid Flowlinesinvalid_flowlines
Detect whether a braid exists in a hydrologic network Check if if a hydrologic network dataset contains any braids. If multiple discontinuous networks are within the 'network' data. The function will try to infer the distinct networks and then check for braids in each component (using find_connected_components()).is_braided
Junction Flowlinesjunction_flowlines
Flowlines linestringlinestring
NextGen Braided Flowlinesnextgen_braided_flowlines
Plots an X-Y scatter plot of cross section pointsplot_cs_pts
Prepare flowlines have a more dense and/or smoother surface for cutting transectsprep_flowlines
Convert an sf dataframe with a point geometry column to non spatial with XY columnspts_to_XY
Fix IDs in a dataframerenumber_cs_ids
Selectively removes intersecting transect lines Attempts to remove transects intersecting other transects by first removing transects that interesect the most other transects, then re checking intersection condition, and doing this until there are no multi intersections this gives the benefit of removing a transect line that intersects many other transects, potentially leaving those other transects with no extraneous intersections ONCE the MULTI intersecting transect is removedrm_multi_intersects
Remove transect lines that intersect with more than one flowlinerm_multiflowline_intersections
Remove Self-Intersectionsrm_self_intersections
Select standard cross section point columns Internal helper function for selecting cross section point columns aligning with standard data model for cross section pointsselect_cs_pts
Select standard transect columns Internal helper function for selecting transect columns aligning with standard data model for transectselect_transects
Takes any transects that was extended and with multiple flowline intersections, and shortens them by the distance specified in the "extension_distance" columnshorten_multi_flowline_intersecting_extended_transects
Takes any transects with multiple intersections that was extended, and shortens them by the distance specified in the "extension_distance" columnshorten_multi_transect_intersecting_extended_transects
Transects Missing Depthtransects_missing_depth
Convert SF linestring transect lines into SF points withtransects_to_cs_pts
Trim a set of transects to the bounds of polygonstrim_transects_to_polygons
Validate Classified Cross Sections Points Ensure all cross section points are valid. This validates the points in the same manner as validate_cs_pts() but also checks that classification columns ('class', 'point_type', 'valid_banks', 'has_relief') exist.validate_classified_cs_pts
Validate Classified Cross Section Points Against Transects Ensure all cross section points are valid relative to a set of transects. This validates the points in the same manner as validate_cs_pts_against_transects() but also checks that classification columns ('class', 'point_type', 'valid_banks', 'has_relief') exist.validate_classified_cs_pts_against_transects
Validate Cross Sections Points Ensure all cross section points are validvalidate_cs_pts
Validate Cross Section Points Against Transects Ensure all cross section points are valid relative to a set of transectsvalidate_cs_pts_against_transects
Validate Transectsvalidate_transects
Validate Transects Against Flowlines Ensure all transects are valid relative to a set of flowlinesvalidate_transects_against_flowlines