Skip to content

Commit

Permalink
Merge branch 'main' into 'main'
Browse files Browse the repository at this point in the history
release 0.5.6

See merge request water/nhdplusTools!1
  • Loading branch information
dblodgett-usgs committed Aug 8, 2022
2 parents b9175bf + 94cdc43 commit 4f95e79
Show file tree
Hide file tree
Showing 136 changed files with 4,691 additions and 3,012 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nhdplusTools
Type: Package
Title: NHDPlus Tools
Version: 0.5.6
Version: 0.5.7
Authors@R: c(person(given = "David",
family = "Blodgett",
role = c("aut", "cre"),
Expand Down
8 changes: 6 additions & 2 deletions DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
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 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/information-policies-and-instructions/copyrights-and-credits
From: https://www2.usgs.gov/fsp/fsp_disclaimers.asp#5

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

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


10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
nhdplusTools 0.5.4
nhdplusTools 0.5.6
==========

- Update URL for NHDPlusV2 download
- make geometry validity checks more robust

nhdplusTools 0.5.4 & v0.5.5
==========

Note v0.5.4 was burned in a CRAN release mistake

fixes a cran test failure in an example and an issue with precision of `get_flowline_index()`

nhdplusTools 0.5.3
Expand Down
5 changes: 5 additions & 0 deletions R/geoserver_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ query_usgs_geoserver <- function(AOI = NULL, ids = NULL,
return(NULL)
})

use_s2 <- sf::sf_use_s2()
sf::sf_use_s2(FALSE)

on.exit(sf::sf_use_s2(use_s2), add = TRUE)

out <- tryCatch({check_valid(sf::st_zm(sf::read_sf(resp)), out_prj = t_srs)},
error = function(e){ return(NULL) })

Expand Down
22 changes: 20 additions & 2 deletions R/subset_nhdplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ check_valid <- function(x, out_prj = sf::st_crs(x)) {

if(is.null(x)){return(NULL)}

return_now <- FALSE

x <- sf::st_zm(x)

if (!all(sf::st_is_valid(x))) {
Expand All @@ -629,8 +631,17 @@ check_valid <- function(x, out_prj = sf::st_crs(x)) {

orig_type <- orig_type[grepl("POLY|LINE", orig_type)]

try({
x <- sf::st_make_valid(x)
x <- tryCatch({
sf::st_make_valid(x)
}, error = function(e) {
warning("Error trying to make geometry valid. Returning invalid geometry.")
return_now <<- TRUE
x
})

if(return_now) return(x)

tryCatch({

if(!all(sf::st_geometry_type(x) == orig_type)) {
if(any(grepl("^GEOMETRY", sf::st_geometry_type(x)))) {
Expand All @@ -645,7 +656,14 @@ check_valid <- function(x, out_prj = sf::st_crs(x)) {

}
}
}, error = function(e) {
warning("Error while trying to unify geometry type. \nReturning geometry as is.")
return_now <<- TRUE
x
})

if(return_now) return(x)

}

if (any(grepl("POLYGON", class(sf::st_geometry(x))))) {
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,26 @@ docker build -t nhdplustools_test .
docker run --rm -it -v $PWD:/src nhdplustools_test /bin/bash -c "cp -r /src/* /check/ && cp /src/.Rbuildignore /check/ && cd /check && Rscript -e 'devtools::build()' && R CMD check --as-cran ../nhdplusTools_*"
```

### Release procedure:
- ensure all checks pass and code coverage is adequate.
- ensure news has been updated
- convert README disclaimer to [released form](https://code.usgs.gov/water/sbtools/-/blob/v1.1.14/README.md#L113)
- update version in inst/CITATION file
- update version in code.json file
- Build source package and upload to CRAN


- Once a new version has been accepted by cran,
- ensure pkgdown is up to date
- commit, push, and PR/MR changes
- create release page and tag
- attach cran tar.gz to release page
- update DOI to point to release page
- switch README disclaimer back to ["dev" mode.](https://code.usgs.gov/water/sbtools#disclaimer)
- Update version in Description.
- push an PR/MR changes.


### Contributing:

First, thanks for considering a contribution! I hope to make this package a community created resource
Expand All @@ -182,18 +202,20 @@ Other notes:
- consider running `lintr` prior to contributing.
- consider running `goodpractice::gp()` on the package before contributing.
- consider running `devtools::spell_check()` if you wrote documentation.
- this package may end up using pkgdown running `pkgdown::build_site()` will refresh it.
- this package uses pkgdown. Running `pkgdown::build_site()` will refresh it.

## 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/information-policies-and-instructions/copyrights-and-credits](https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits)
From: https://www2.usgs.gov/fsp/fsp_disclaimers.asp#5

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 in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the [official USGS copyright policy](https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits "official USGS copyright policy")

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


[
![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)
](https://creativecommons.org/publicdomain/zero/1.0/)
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reference:
- '`get_elev_along_path`'
- '`rpu_boundaries`'
- '`vpu_boundaries`'
- '`get_boundaries`'
- title: Discovery and Subsetting
desc: >
Functions for finding and saving the part of the NHDPlus you are
Expand Down Expand Up @@ -59,6 +60,7 @@ reference:
- '`disambiguate_flowline_indexes`'
- '`get_partial_length`'
- '`get_path_lengths`'
- '`get_path_members`'
- title: Network Navigation
desc: >
Functions to traverse and return network subsets. All except `navigate_nldi()`
Expand Down Expand Up @@ -100,5 +102,6 @@ reference:
- '`get_levelpaths`'
- '`get_pathlength`'
- '`get_streamorder`'
- '`get_terminal`'
- '`add_plus_network_attributes`'
- '`get_pfaf`'
10 changes: 5 additions & 5 deletions code.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"name": "nhdplusTools",
"organization": "U.S. Geological Survey",
"description": "Tools for Using NHDPlus Data",
"version": "0.5.1",
"version": "0.5.6",
"status": "Production",

"permissions": {
"usageType": "openSource",
"licenses": [
{
"name": "Public Domain, CC0-1.0",
"URL": "https://code.usgs.gov/water/nhdplusTools/blob/master/LICENSE"
"URL": "https://code.usgs.gov/water/nhdplusTools/-/blob/v0.5.6/LICENSE"
}
]
},

"homepageURL": "https://code.usgs.gov/water/nhdplusTools/",
"downloadURL": "https://code.usgs.gov/water/nhdplusTools/-/archive/master/nhdplustools-master.zip",
"disclaimerURL": "https://code.usgs.gov/water/nhdplusTools/blob/master/DISCLAIMER.md",
"downloadURL": "https://code.usgs.gov/water/nhdplusTools/-/archive/v0.5.6/nhdplusTools-v0.5.6.zip",
"disclaimerURL": "https://code.usgs.gov/water/nhdplusTools/-/blob/v0.5.6/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/water/nhdplusTools.git",
"vcs": "git",

Expand All @@ -41,7 +41,7 @@
},

"date": {
"metadataLastUpdated": "2022-03-16"
"metadataLastUpdated": "2022-08-06"
}
}
]
4 changes: 2 additions & 2 deletions docs/404.html

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

10 changes: 5 additions & 5 deletions docs/DISCLAIMER.html

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

4 changes: 2 additions & 2 deletions docs/LICENSE-text.html

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

Loading

0 comments on commit 4f95e79

Please sign in to comment.