diff --git a/docs/articles/flow-table.html b/docs/articles/flow-table.html index 6f2cf2c..b968fc3 100644 --- a/docs/articles/flow-table.html +++ b/docs/articles/flow-table.html @@ -106,22 +106,22 @@

library(hydroloom) library(dplyr) -dir <- nhdplusTools::download_nhd(nhdplusTools::nhdplusTools_data_dir(), +dir <- nhdplusTools::download_nhd(nhdplusTools::nhdplusTools_data_dir(), "1908", TRUE) fs <- list.files(dir, pattern = ".*1908.*.gdb", full.names = TRUE) # Dropping Z and M and making sure everything is LINESTRING helps later. -fl <- sf::st_zm(sf::st_cast(sf::read_sf(fs, "NHDFlowline"), "LINESTRING")) +fl <- sf::st_zm(sf::st_cast(sf::read_sf(fs, "NHDFlowline"), "LINESTRING")) # remove any coastal (ftype 566) features -fl <- filter(fl, ftype != 566) +fl <- filter(fl, ftype != 566)

Now that we have a network ready to go, we need to figure out a subset that we want to work with. Here, we’ll use index_points_to_lines() to find a line near the outlet of the Chena River in Alaska.

 # this is a seed point near the outlet of a watershed to consider.
-point <- sf::st_sfc(sf::st_point(c(-147.911472, 64.796633)), 
+point <- sf::st_sfc(sf::st_point(c(-147.911472, 64.796633)), 
                               crs = 4269)
 
 # now we get the line our point is along.
@@ -131,8 +131,8 @@ 

sub <- fl[fl$permanent_identifier == i$permanent_identifier, ] mapview::mapview(list(sub, point))

-
-

Now we load up the NHD “flow table” which contains a list of +

+

Now we load up the NHD “flow table” which contains a list of connections between flowlines. Where there are diversions, the same “from” will have multiple “to” connections so this table doesn’t join cleanly to the flowline table. The following code prepares the flow @@ -145,9 +145,9 @@

navigate_network_dfs() to work.

 # remove coastal and make terminals go to an empty id.
-flow_table <- sf::read_sf(fs, "NHDFlow") |>
-  filter(from_permanent_identifier %in% fl$permanent_identifier) |>
-  mutate(to_permanent_identifier = 
+flow_table <- sf::read_sf(fs, "NHDFlow") |>
+  filter(from_permanent_identifier %in% fl$permanent_identifier) |>
+  mutate(to_permanent_identifier = 
            ifelse(!to_permanent_identifier %in% from_permanent_identifier, 
                   "", 
                   to_permanent_identifier))
@@ -157,8 +157,8 @@ 

# this is naive and these removals would normally be reviewed. flow_table <- flow_table |> - mutate(row = 1:n()) |> - filter(!row %in% remove$row) + mutate(row = 1:n()) |> + filter(!row %in% remove$row) down <- navigate_network_dfs(flow_table, sub$permanent_identifier, direction = "down") up <- navigate_network_dfs(flow_table, sub$permanent_identifier, direction = "up") diff --git a/docs/articles/hydroloom.html b/docs/articles/hydroloom.html index 20e8c14..69a0d0d 100644 --- a/docs/articles/hydroloom.html +++ b/docs/articles/hydroloom.html @@ -146,8 +146,8 @@

 library(hydroloom)
 
-hy_net <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom")) |>
-  dplyr::select(COMID, REACHCODE, FromNode, ToNode, Hydroseq, TerminalFl, Divergence)
+hy_net <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom")) |>
+  dplyr::select(COMID, REACHCODE, FromNode, ToNode, Hydroseq, TerminalFl, Divergence)
 
 hy(hy_net[1:3,])
 #> Simple feature collection with 3 features and 7 fields
diff --git a/docs/articles/non-dendritic.html b/docs/articles/non-dendritic.html
index 5a48a9c..619300b 100644
--- a/docs/articles/non-dendritic.html
+++ b/docs/articles/non-dendritic.html
@@ -177,26 +177,26 @@ 

Bringing it all together
 
-x <- sf::read_sf(system.file("extdata/new_hope.gpkg", 
+x <- sf::read_sf(system.file("extdata/new_hope.gpkg", 
                              package = "hydroloom"))
 
 # First we select only an id, a name, and a feature type.
 flow_net <- x |>
-  select(COMID, GNIS_ID, FTYPE) |>
-  sf::st_transform(5070)
+  select(COMID, GNIS_ID, FTYPE) |>
+  sf::st_transform(5070)
 
 # Now we convert the geometric network to an attribute topology
 # and convert that to a node topology and join our attributes back
 flow_net <- flow_net |>
   make_attribute_topology(min_distance = 5) |>
   make_node_topology(add_div = TRUE) |>
-  left_join(sf::st_drop_geometry(flow_net), by = "COMID")
+  left_join(sf::st_drop_geometry(flow_net), by = "COMID")
 #> Loading required namespace: future
 #> Loading required namespace: future.apply
 
 # We only have one outlet so it doesn't matter if it is coastal
 # or inland but we have to provide it.
-outlets <- filter(flow_net, !tonode %in% fromnode)
+outlets <- filter(flow_net, !tonode %in% fromnode)
 
 # We have these feature types. A larger dataset might include 
 # things like canals which would not be considered  "major"
diff --git a/docs/index.html b/docs/index.html
index db86dec..b8b49ce 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -5,7 +5,7 @@
 
 
 
-
+
 Utilities to Weave Hydrologic Fabrics • hydroloom
 
 
@@ -18,7 +18,7 @@
 
 
 
-
+
 
 Add Divergence Attribute — add_divergence • hydroloom
-    Skip to contents
-    
-
-    
-
-
- -
-

Given a non-dendritic flow network and required attributes, -adds a divergence attribute according to NHDPlus data model methods.

-
- -
-

Usage

-
add_divergence(
-  x,
-  coastal_outlet_ids,
-  inland_outlet_ids,
-  name_attr,
-  type_attr,
-  major_types
-)
-
-# S3 method for data.frame
-add_divergence(
-  x,
-  coastal_outlet_ids,
-  inland_outlet_ids,
-  name_attr,
-  type_attr,
-  major_types
-)
-
-# S3 method for hy
-add_divergence(
-  x,
-  coastal_outlet_ids,
-  inland_outlet_ids,
-  name_attr,
-  type_attr,
-  major_types
-)
-
- -
-

Arguments

-
x
-

data.frame network compatible with hydroloom_names.

- - -
coastal_outlet_ids
-

vector of identifiers for network outlets that -terminate at the coast.

- - -
inland_outlet_ids
-

vector of identifiers for network outlets that -terminate inland.

- - -
name_attr
-

character attribute name of attribute containing a feature -name or name identifier.

- - -
type_attr
-

character attribute name of attribute containing a feature -type indicator.

- - -
major_types
-

vector of values of type_attr that should be interpreted -as being "major". e.g. river might be major and canal might be minor.

- -
-
-

Details

-

When considering downstream connections with diversions, there are three -factors considered to determine which is primary.
-1a) same name
-1b) is named
-2) feature type (type_attr controls this)
-3) flows to coast (has a coastal connection is preferred)

-

The following list describes the order of precedence for tests
-1: 1a, 2, 3
-2: 1a, 2
-3: The NHDPlus uses diverted fraction this is not used currently.
-4: 1b, 2, 3
-5: 2, 3
-6: 1b, 3
-7: 3,
-8: 1b, 2
-9: 2
-10: 1b

-

If all checks return and no primary connection has been identified, the -connection with a smaller id is chosen.

-

In the case that there are two or more upstream connections, the upstream -name to use is chosen 1) if there is only one upstream flowline with a name -2) if one of the upstream flowlines with a name matches the downstream line, -3) if one of the upstream flowlines is of a "major" type and others are not, -and, 4) if no criteria exist to select one, the smallest id value otherwise.

-
- -
-

Examples

-

-f <- system.file("extdata/coastal_example.gpkg", package = "hydroloom")
-
-g <- sf::read_sf(f)
-g <- g[g$FTYPE != "Coastline", ]
-
-outlets <- g$COMID[!g$ToNode %in% g$FromNode]
-
-g <- dplyr::select(g, COMID, gnis_id, FTYPE,
-                   FromNode, ToNode)
-
-add_divergence(g,
-               coastal_outlet_ids = outlets,
-               inland_outlet_ids = c(),
-               name_attr = "gnis_id",
-               type_attr = "FTYPE",
-               major_types = c("StreamRiver", "ArtificialPath", "Connector"))
-#> Loading required namespace: future
-#> Loading required namespace: future.apply
-#> 
  |                                                  | 0 % ~calculating  
  |++                                                | 3 % ~02s          
  |++++                                              | 7 % ~01s          
  |++++++                                            | 10% ~01s          
  |+++++++                                           | 14% ~01s          
  |+++++++++                                         | 17% ~01s          
  |+++++++++++                                       | 21% ~01s          
  |+++++++++++++                                     | 24% ~01s          
  |++++++++++++++                                    | 28% ~00s          
  |++++++++++++++++                                  | 31% ~00s          
  |++++++++++++++++++                                | 34% ~00s          
  |+++++++++++++++++++                               | 38% ~00s          
  |+++++++++++++++++++++                             | 41% ~00s          
  |+++++++++++++++++++++++                           | 45% ~00s          
  |+++++++++++++++++++++++++                         | 48% ~00s          
  |++++++++++++++++++++++++++                        | 52% ~00s          
  |++++++++++++++++++++++++++++                      | 55% ~00s          
  |++++++++++++++++++++++++++++++                    | 59% ~00s          
  |++++++++++++++++++++++++++++++++                  | 62% ~00s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~00s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~00s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~00s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~00s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s  
-#> Simple feature collection with 535 features and 6 fields
-#> Geometry type: LINESTRING
-#> Dimension:     XY
-#> Bounding box:  xmin: -124.3627 ymin: 39.82399 xmax: -123.7742 ymax: 40.41246
-#> Geodetic CRS:  NAD83
-#> # A tibble: 535 × 7
-#>      COMID gnis_id FTYPE    FromNode ToNode                      geom divergence
-#>  *   <int> <chr>   <chr>       <dbl>  <dbl>          <LINESTRING [°]>      <dbl>
-#>  1 2544239 NA      StreamR… 10092685 1.00e7 (-124.2181 40.41246, -12…          0
-#>  2 2544241 229695  StreamR… 10004575 1.00e7 (-124.2256 40.39929, -12…          0
-#>  3 2544243 NA      StreamR… 10092686 1.00e7 (-124.2439 40.40495, -12…          0
-#>  4 2544263 229695  StreamR… 10004579 1.00e7 (-124.2273 40.39801, -12…          0
-#>  5 2544287 NA      StreamR… 10092696 1.00e7 (-124.1699 40.39544, -12…          0
-#>  6 2544289 229695  StreamR… 10004588 1.00e7 (-124.1867 40.38665, -12…          0
-#>  7 2544301 229695  StreamR… 10092697 1.00e7 (-124.1666 40.38338, -12…          0
-#>  8 2544303 229695  StreamR… 10004594 1.00e7 (-124.2376 40.39235, -12…          0
-#>  9 2544309 NA      StreamR… 10092700 1.00e7 (-124.3126 40.38182, -12…          0
-#> 10 2544311 NA      StreamR… 10092701 1.00e7 (-124.2285 40.37687, -12…          0
-#> # ℹ 525 more rows
-
-
-
-
-
- - -
- - - -
- - - - - - - + +Add Divergence Attribute — add_divergence • hydroloom + Skip to contents + + +
+
+
+ +
+

Given a non-dendritic flow network and required attributes, +adds a divergence attribute according to NHDPlus data model methods.

+
+ +
+

Usage

+
add_divergence(
+  x,
+  coastal_outlet_ids,
+  inland_outlet_ids,
+  name_attr,
+  type_attr,
+  major_types
+)
+
+# S3 method for data.frame
+add_divergence(
+  x,
+  coastal_outlet_ids,
+  inland_outlet_ids,
+  name_attr,
+  type_attr,
+  major_types
+)
+
+# S3 method for hy
+add_divergence(
+  x,
+  coastal_outlet_ids,
+  inland_outlet_ids,
+  name_attr,
+  type_attr,
+  major_types
+)
+
+ +
+

Arguments

+
x
+

data.frame network compatible with hydroloom_names.

+ + +
coastal_outlet_ids
+

vector of identifiers for network outlets that +terminate at the coast.

+ + +
inland_outlet_ids
+

vector of identifiers for network outlets that +terminate inland.

+ + +
name_attr
+

character attribute name of attribute containing a feature +name or name identifier.

+ + +
type_attr
+

character attribute name of attribute containing a feature +type indicator.

+ + +
major_types
+

vector of values of type_attr that should be interpreted +as being "major". e.g. river might be major and canal might be minor.

+ +
+
+

Value

+ + +

returns x with a divergence attribute appended

+
+
+

Details

+

When considering downstream connections with diversions, there are three +factors considered to determine which is primary.
+1a) same name
+1b) is named
+2) feature type (type_attr controls this)
+3) flows to coast (has a coastal connection is preferred)

+

The following list describes the order of precedence for tests
+1: 1a, 2, 3
+2: 1a, 2
+3: The NHDPlus uses diverted fraction this is not used currently.
+4: 1b, 2, 3
+5: 2, 3
+6: 1b, 3
+7: 3,
+8: 1b, 2
+9: 2
+10: 1b

+

If all checks return and no primary connection has been identified, the +connection with a smaller id is chosen.

+

In the case that there are two or more upstream connections, the upstream +name to use is chosen 1) if there is only one upstream flowline with a name +2) if one of the upstream flowlines with a name matches the downstream line, +3) if one of the upstream flowlines is of a "major" type and others are not, +and, 4) if no criteria exist to select one, the smallest id value otherwise.

+
+ +
+

Examples

+

+f <- system.file("extdata/coastal_example.gpkg", package = "hydroloom")
+
+g <- sf::read_sf(f)
+g <- g[g$FTYPE != "Coastline", ]
+
+outlets <- g$COMID[!g$ToNode %in% g$FromNode]
+
+g <- dplyr::select(g, COMID, gnis_id, FTYPE,
+                   FromNode, ToNode)
+
+add_divergence(g,
+               coastal_outlet_ids = outlets,
+               inland_outlet_ids = c(),
+               name_attr = "gnis_id",
+               type_attr = "FTYPE",
+               major_types = c("StreamRiver", "ArtificialPath", "Connector"))
+#> Loading required namespace: future
+#> Loading required namespace: future.apply
+#> Simple feature collection with 535 features and 6 fields
+#> Geometry type: LINESTRING
+#> Dimension:     XY
+#> Bounding box:  xmin: -124.3627 ymin: 39.82399 xmax: -123.7742 ymax: 40.41246
+#> Geodetic CRS:  NAD83
+#> # A tibble: 535 × 7
+#>      COMID gnis_id FTYPE    FromNode ToNode                      geom divergence
+#>  *   <int> <chr>   <chr>       <dbl>  <dbl>          <LINESTRING [°]>      <dbl>
+#>  1 2544239 NA      StreamR… 10092685 1.00e7 (-124.2181 40.41246, -12…          0
+#>  2 2544241 229695  StreamR… 10004575 1.00e7 (-124.2256 40.39929, -12…          0
+#>  3 2544243 NA      StreamR… 10092686 1.00e7 (-124.2439 40.40495, -12…          0
+#>  4 2544263 229695  StreamR… 10004579 1.00e7 (-124.2273 40.39801, -12…          0
+#>  5 2544287 NA      StreamR… 10092696 1.00e7 (-124.1699 40.39544, -12…          0
+#>  6 2544289 229695  StreamR… 10004588 1.00e7 (-124.1867 40.38665, -12…          0
+#>  7 2544301 229695  StreamR… 10092697 1.00e7 (-124.1666 40.38338, -12…          0
+#>  8 2544303 229695  StreamR… 10004594 1.00e7 (-124.2376 40.39235, -12…          0
+#>  9 2544309 NA      StreamR… 10092700 1.00e7 (-124.3126 40.38182, -12…          0
+#> 10 2544311 NA      StreamR… 10092701 1.00e7 (-124.2285 40.37687, -12…          0
+#> # ℹ 525 more rows
+
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/docs/reference/add_levelpaths.html b/docs/reference/add_levelpaths.html index 46d67d7..9187d04 100644 --- a/docs/reference/add_levelpaths.html +++ b/docs/reference/add_levelpaths.html @@ -143,7 +143,7 @@

Details

Examples

-
g <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+    
g <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 test_flowline <- add_toids(g)
 
diff --git a/docs/reference/add_pathlength.html b/docs/reference/add_pathlength.html
index be26e2c..951ff4e 100644
--- a/docs/reference/add_pathlength.html
+++ b/docs/reference/add_pathlength.html
@@ -86,7 +86,7 @@ 

Value

Examples

-
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+    
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 x <- add_toids(x)
 
diff --git a/docs/reference/add_pfafstetter-3.png b/docs/reference/add_pfafstetter-3.png
index 4bd3dd9..7e056b3 100644
Binary files a/docs/reference/add_pfafstetter-3.png and b/docs/reference/add_pfafstetter-3.png differ
diff --git a/docs/reference/add_pfafstetter.html b/docs/reference/add_pfafstetter.html
index 4836f3c..d6d80bc 100644
--- a/docs/reference/add_pfafstetter.html
+++ b/docs/reference/add_pfafstetter.html
@@ -106,7 +106,7 @@ 

Value

Examples


-x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 x <- add_toids(x)
 
@@ -115,20 +115,21 @@ 

Examplesplot(pfaf["pf_level_2"], lwd = 2) -if (FALSE) { - +# \donttest{ if(require(nhdplusTools)) { # uses tempdir for example -work_dir <- nhdplusTools::nhdplusTools_data_dir(tempdir()) +work_dir <- nhdplusTools::nhdplusTools_data_dir(tempdir()) +try( source(system.file("extdata/nhdplushr_data.R", package = "nhdplusTools")) - +) +if(exists("hr_data")) { x <- hy(hr_data$NHDFlowline) x <- add_toids(x) -x <- dplyr::select(x, id, toid, da_sqkm) +x <- dplyr::select(x, id, toid, da_sqkm) #' add terminal_id -- add in function? x <- sort_network(x, split = TRUE) @@ -144,18 +145,31 @@

Examples pfaf <- add_pfafstetter(x, max_level = 4) -hr_catchment <- dplyr::left_join(hr_data$NHDPlusCatchment, - sf::st_drop_geometry(pfaf), by = c("FEATUREID" = "id")) +hr_catchment <- dplyr::left_join(hr_data$NHDPlusCatchment, + sf::st_drop_geometry(pfaf), by = c("FEATUREID" = "id")) colors <- data.frame(pf_level_4 = unique(hr_catchment$pf_level_4), color = sample(terrain.colors(length(unique(hr_catchment$pf_level_4))))) -hr_catchment <- dplyr::left_join(hr_catchment, colors, by = "pf_level_4") +hr_catchment <- dplyr::left_join(hr_catchment, colors, by = "pf_level_4") plot(hr_catchment["color"], border = NA, reset = FALSE) -plot(sf::st_geometry(x), col = "blue", add = TRUE) +plot(sf::st_geometry(x), col = "blue", add = TRUE) +} else { + message("nhdplusTools > 1.0 required for this example") } } +#> Loading required package: nhdplusTools +#> +#> Attaching package: 'nhdplusTools' +#> The following object is masked from 'package:hydroloom': +#> +#> make_node_topology +#> defaulting to comid rather than permanent_identifier +#> defaulting to comid rather than permanent_identifier + + +# }

source(system.file("extdata", "sample_flines.R", package = "nhdplusTools"))
 
-hydro_location <- sf::st_sf(id = c(1, 2, 3),
-                            geom = sf::st_sfc(list(sf::st_point(c(-76.86934, 39.49328)),
-                                                   sf::st_point(c(-76.91711, 39.40884)),
-                                                   sf::st_point(c(-76.88081, 39.36354))),
+hydro_location <- sf::st_sf(id = c(1, 2, 3),
+                            geom = sf::st_sfc(list(sf::st_point(c(-76.86934, 39.49328)),
+                                                   sf::st_point(c(-76.91711, 39.40884)),
+                                                   sf::st_point(c(-76.88081, 39.36354))),
                                               crs = 4326),
                             totda = c(23.6, 7.3, 427.9),
                             nameid = c("Patapsco", "", "Falls Run River"))
@@ -124,8 +124,8 @@ 

Examples#> Warning: converting to LINESTRING, this may be slow, check results disambiguate_indexes(indexes, - dplyr::select(sample_flines, COMID, TotDASqKM), - dplyr::select(hydro_location, id, totda)) + dplyr::select(sample_flines, COMID, TotDASqKM), + dplyr::select(hydro_location, id, totda)) #> # A tibble: 3 × 5 #> point_id COMID REACHCODE REACHCODE_measure offset #> <dbl> <int> <chr> <dbl> <dbl> @@ -134,8 +134,8 @@

Examples#> 3 3 11688950 02060003000254 18.5 0.00113 result <- disambiguate_indexes(indexes, - dplyr::select(sample_flines, COMID, GNIS_NAME), - dplyr::select(hydro_location, id, nameid)) + dplyr::select(sample_flines, COMID, GNIS_NAME), + dplyr::select(hydro_location, id, nameid)) result[result$point_id == 1, ] #> # A tibble: 3 × 5 diff --git a/docs/reference/fix_flowdir.html b/docs/reference/fix_flowdir.html index cf98190..556de89 100644 --- a/docs/reference/fix_flowdir.html +++ b/docs/reference/fix_flowdir.html @@ -97,7 +97,7 @@

Value

Examples


-x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 # We add a tocomid with prepare_nhdplus
 x <- add_toids(hy(x))
@@ -115,7 +115,7 @@ 

Examples#> 1 (1520118 1560497) # Break the geometry by reversing it. -sf::st_geometry(x)[10] <- sf::st_reverse(sf::st_geometry(x)[10]) +sf::st_geometry(x)[10] <- sf::st_reverse(sf::st_geometry(x)[10]) # Note that the end node is different now. (n2 <- get_node(x[10, ], position = "end")) @@ -130,7 +130,7 @@

Examples#> 1 (1520229 1560983) # Pass the broken geometry to fix_flowdir with the network for toCOMID -sf::st_geometry(x)[10] <- fix_flowdir(x$id[10], x) +sf::st_geometry(x)[10] <- fix_flowdir(x$id[10], x) # Note that the geometry is now in the right order. (n3 <- get_node(x[10, ], position = "end")) @@ -144,7 +144,7 @@

Examples#> * <POINT [m]> #> 1 (1520118 1560497) -plot(sf::st_geometry(x)[10]) +plot(sf::st_geometry(x)[10]) plot(n1, add = TRUE) plot(n2, add = TRUE, col = "blue") plot(n3, add = TRUE, cex = 2, col = "red") diff --git a/docs/reference/format_index_ids.html b/docs/reference/format_index_ids.html index 358d2ac..c68762d 100644 --- a/docs/reference/format_index_ids.html +++ b/docs/reference/format_index_ids.html @@ -89,7 +89,7 @@

Value

Examples

-
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+    
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 y <- add_toids(x) |>
   make_index_ids(long_form = TRUE) |>
diff --git a/docs/reference/get_hydro_location.html b/docs/reference/get_hydro_location.html
index bb93b0b..f91bb2e 100644
--- a/docs/reference/get_hydro_location.html
+++ b/docs/reference/get_hydro_location.html
@@ -79,15 +79,23 @@ 

Arguments +

Value

+ + +

sfc_POINT simple feature geometry list of length nrow(indexes)

+ + +

Examples

source(system.file("extdata", "sample_flines.R", package = "nhdplusTools"))
 
 indexes <- index_points_to_lines(sample_flines,
-                   sf::st_sfc(sf::st_sfc(list(sf::st_point(c(-76.86934, 39.49328)),
-                                              sf::st_point(c(-76.91711, 39.40884)),
-                                              sf::st_point(c(-76.88081, 39.36354))),
+                   sf::st_sfc(sf::st_sfc(list(sf::st_point(c(-76.86934, 39.49328)),
+                                              sf::st_point(c(-76.91711, 39.40884)),
+                                              sf::st_point(c(-76.88081, 39.36354))),
                               crs = 4326)))
 #> Warning: converting to LINESTRING, this may be slow, check results
 
diff --git a/docs/reference/get_node.html b/docs/reference/get_node.html
index ee345ca..d381d10 100644
--- a/docs/reference/get_node.html
+++ b/docs/reference/get_node.html
@@ -88,19 +88,19 @@ 

Value

Examples


-x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 start <- get_node(x, "start")
 end <- get_node(x, "end")
 
-plot(sf::st_zm(sf::st_geometry(x)),
+plot(sf::st_zm(sf::st_geometry(x)),
      lwd = x$StreamOrde, col = "blue")
-plot(sf::st_geometry(start), add = TRUE)
+plot(sf::st_geometry(start), add = TRUE)
 
 
-plot(sf::st_zm(sf::st_geometry(x)),
+plot(sf::st_zm(sf::st_geometry(x)),
      lwd = x$StreamOrde, col = "blue")
-plot(sf::st_geometry(end), add = TRUE)
+plot(sf::st_geometry(end), add = TRUE)
 
 
 
diff --git a/docs/reference/get_partial_length.html b/docs/reference/get_partial_length.html index d57ca1b..4c563f8 100644 --- a/docs/reference/get_partial_length.html +++ b/docs/reference/get_partial_length.html @@ -102,7 +102,7 @@

Value

Examples


-x <- sf::read_sf(system.file("extdata", "walker.gpkg", package = "hydroloom"))
+x <- sf::read_sf(system.file("extdata", "walker.gpkg", package = "hydroloom"))
 
 hydro_location <- list(comid = 5329339,
                        reachcode = "18050005000078",
diff --git a/docs/reference/hy.html b/docs/reference/hy.html
index 6c42642..9c17e2f 100644
--- a/docs/reference/hy.html
+++ b/docs/reference/hy.html
@@ -85,7 +85,7 @@ 

Value

Examples

-
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+    
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 
 hy(x)
 #> Simple feature collection with 746 features and 35 fields
diff --git a/docs/reference/hy_reverse.html b/docs/reference/hy_reverse.html
index 79a4379..61b065c 100644
--- a/docs/reference/hy_reverse.html
+++ b/docs/reference/hy_reverse.html
@@ -74,10 +74,18 @@ 

Argumentshydroloom_names.

+
+

Value

+ + +

returns x with attribute names converted to original names provided to hy

+ + +

Examples

-
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
+    
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
 x <- hy(x)
 
 hy_reverse(x)
diff --git a/docs/reference/hydroloom_name_definitions.html b/docs/reference/hydroloom_name_definitions.html
index 6d7ad47..740a00c 100644
--- a/docs/reference/hydroloom_name_definitions.html
+++ b/docs/reference/hydroloom_name_definitions.html
@@ -64,6 +64,12 @@
     
+
+

Value

+ + +

named character vector with hydroloom_names class to support custom print method

+
-
+