Skip to content

Commit

Permalink
Merge pull request #156 from dblodgett-usgs/master
Browse files Browse the repository at this point in the history
v0.3.15
  • Loading branch information
dblodgett-usgs authored Sep 17, 2020
2 parents efe512f + 0186fe5 commit 93d5325
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DISCLAIMER.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Disclaimer

This information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The information has not received final approval by the U.S. Geological Survey (USGS) and is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the information.

This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey (USGS), an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at https://www.usgs.gov/visual-id/credit_usgs.html#copyright
This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey (USGS), an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits

Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.
This software is provided "AS IS."
9 changes: 9 additions & 0 deletions R/downloading_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
#' The following requirements are needed: p7zip (MacOS), 7zip (windows) Please see:
#' https://www.epa.gov/waterdata/get-nhdplus-national-hydrography-dataset-plus-data
#' for more information and metadata about this data.
#'
#' Default downloads lower-48 only. See examples for islands. No Alaska data
#' are available.
#'
#' @param outdir The folder path where data should be downloaded and extracted
#' @param url the location of the online resource
#' @return the path to the local geodatabase
#' @export
#' @examples
#' \dontrun{
#' download_nhdplusV2("./data/nhd/")
#'
#' download_nhdplusv2(outdir = "./inst/",
#' url = paste0("https://s3.amazonaws.com/edap-nhdplus/NHDPlusV21/",
#' "Data/NationalData/NHDPlusV21_NationalData_Seamless",
#' "_Geodatabase_HI_PR_VI_PI_03.7z"))
#' }

download_nhdplusv2 <- function(outdir,
Expand Down
2 changes: 1 addition & 1 deletion R/get_nldi.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ navigate_nldi <- function(nldi_feature, mode = "upstreamMain",
#' @title Get NLDI Basin Boundary
#' @description Get a basin boundary for a given NLDI feature.
#' @details Only resolves to the nearest NHDPlus catchment divide. See:
#' https://owi.usgs.gov/blog/nldi-intro/ for more info on the nldi.
#' https://waterdata.usgs.gov/blog/nldi-intro/ for more info on the nldi.
#' @inheritParams navigate_nldi
#' @return sf data.frame with result basin boundary
#' @export
Expand Down
6 changes: 3 additions & 3 deletions R/index_nhdplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ get_flowline_index <- function(flines, points,
if (nrow(flines) != nrow(fline_atts)) {

flines <- summarize(group_by(select(flines, .data$index),
index),
do_union = FALSE)
.data$index),
do_union = FALSE)

flines <- left_join(flines, fline_atts, by = "index")

Expand All @@ -144,7 +144,7 @@ get_flowline_index <- function(flines, points,
"part lines. Check results!!"))

st_geometry(flines)[multi] <- lapply(st_geometry(flines)[multi], function(x) {
st_linestring(do.call(rbind, x))
sf::st_linestring(do.call(rbind, x))
})

flines <- sf::st_zm(sf::st_cast(flines, "LINESTRING", warn = FALSE))
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ relates to handling data and what dependencies are used will be very important.
Web services will generally be avoided. However, applications that would require
loading significant amounts of data to perform something that can be
accomplished with a web service very quickly will be considered. Systems like
the [Network Linked Data Index](https://owi.usgs.gov/blog/nldi-intro/) are
the [Network Linked Data Index](https://waterdata.usgs.gov/blog/nldi-intro/) are
used for data discovery.

##### NHDPlus Version
Initial package development focused on the [National Seamless NHDPlus](https://www.epa.gov/waterdata/nhdplus-national-data)
database. [NHDPlus High Resolution](https://nhd.usgs.gov/NHDPlus_HR.html) is
database. [NHDPlus High Resolution](https://www.usgs.gov/core-science-systems/ngp/national-hydrography/nhdplus-high-resolution) is
also supported.

### Related similar packages:
Expand All @@ -140,13 +140,23 @@ https://github.com/ropensci/FedData
https://github.com/cheginit/hydrodata
... others -- please suggest additions?

### Build notes:
This package uses a convention to avoid building vignettes on CRAN. The `BUILD_VIGNETTES` environment variable must be set to `TRUE`. This is done with a .Renviron file in the package directory with the line `BUILD_VIGNETTES=TRUE`.

Given this, the package should be built locally to include vignettes using:

```r
devtools::build_vignettes(install = FALSE)
devtools::build(vignettes = FALSE)
```

### Contributing:

First, thanks for considering a contribution! I hope to make this package a community created resource
for us all to gain from and won't be able to do that without your help!

1) Contributions should be thoroughly tested with [testthat](https://testthat.r-lib.org/).
2) Code style should attempt to follow the [tidyverse style guide.](http://style.tidyverse.org/)
2) Code style should attempt to follow the [tidyverse style guide.](https://style.tidyverse.org/)
3) Please attempt to describe what you want to do prior to contributing by submitting an issue.
4) Please follow the typical github [fork - pull-request workflow.](https://gist.github.com/Chaser324/ce0505fbed06b947d962)
5) Make sure you use roxygen and run Check before contributing. More on this front as the package matures.
Expand All @@ -161,7 +171,7 @@ Other notes:

This information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The information has not received final approval by the U.S. Geological Survey (USGS) and is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the information.

This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey (USGS), an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at [https://www.usgs.gov/visual-id/credit_usgs.html#copyright](https://www.usgs.gov/visual-id/credit_usgs.html#copyright)
This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey (USGS), an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at [https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits](https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits)

Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

Expand Down
2 changes: 1 addition & 1 deletion docs/DISCLAIMER.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions docs/articles/nhdplusTools.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/nhdplushr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/get_nldi_basin.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions man/download_nhdplusv2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_nldi_basin.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 93d5325

Please sign in to comment.