Skip to content

the last row in divide-attributes is missing from the extracted subset #9

@taddyb

Description

@taddyb

Summary

I'm currently trying to make a subset of the hydrofabric for some routing code and noticed the downstream-most divide is missing from the divide-attributes layer.

My suspicion is the origin is not included when running the query for the divide-attributes.

I've run this with a few different attributes and am always finding the downstream-most catchment/divide missing.

Reproducibility

subset_fabric <- get_subset(gpkg = gpkg, id="nex-87405", lyrs = c("divides", "flowpaths", "network", "nexus", "flowpath-attributes", "flowpath-attributes-ml", "lakes", "divide-attributes"))

and saving the subset to a GPKG using the following lines of code:

> st_write(subset_fabric$flowpaths, "/Users/taddbindas/projects/ddr/data/jrb_2.gpkg", "flowpaths", append = TRUE)
> st_write(subset_fabric$nexus, "/Users/taddbindas/projects/ddr/data/jrb_2.gpkg", "nexus", append = TRUE)
> st_write(subset_fabric$divides, "/Users/taddbindas/projects/ddr/data/jrb_2.gpkg", "divides", append = TRUE)
> st_write(subset_fabric$lakes, "/Users/taddbindas/projects/ddr/data/jrb_2.gpkg", "lakes", append = TRUE)
> con <- dbConnect(RSQLite::SQLite(), "/Users/taddbindas/projects/ddr/data/jrb_2.gpkg")
> dbWriteTable(con, "network", subset_fabric$network)
> dbWriteTable(con, "divide-attributes", subset_fabric[["divide-attributes"]])
> dbWriteTable(con, "flowpath-attributes", subset_fabric[["flowpath-attributes"]])
> dbWriteTable(con, "flowpath-attributes-ml", subset_fabric[["flowpath-attributes-ml"]])
> dbDisconnect(con)

Here is a photo of the divides and divide-attributes tables printed in QGIS next to each other

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions