Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query builder interface #4

Merged
merged 7 commits into from
Nov 27, 2024
Merged

Conversation

program--
Copy link
Member

This PR bumps hfsubsetR to version 0.3.0.

Features

  • Adds a query builder interface:

    Normal Interface

    get_subset(
      hl_uri = "gages-06752260",
      layers = c("divides", "network"),
      gpkg = "/path/to/my.gpkg",
      outfile = "my_subset.gpkg",
      overwrite = TRUE
    )

    Query Builder Interface

    query() |>
      query_set_id(identifier = "gages-06752260", type = "hl_uri") |>
      query_set_layers(layers = c("divides", "network")) |>
      query_set_sink(sink = "my_subset.gpkg", overwrite = TRUE) |>
      query_set_source(src = query_source_sf("/path/to/my.gpkg")) |>
      query_subset()

    This change is primary for two reasons: (1) to ensure maintainability for hfsubsetR in the future, as the query builder interface allows us to maintain decoupling of the components that make up a query; and, (2) allows increased flexibility for hfsubsetCLI in constructing queries from user parameters.

Fixes

  • Changes findOrigin and findOriginQuery to snake_case to match rest of package.
  • Fixes an issue with S3 dispatch on finding origins, where dplyr throws on comparison with an identifier-classed character (used as.character() to resolve).

anguswg-ucsb and others added 5 commits November 26, 2024 11:43
…onality in get_subset(), added simple tests checking outputs of a get_subset() on new test gpkg, fixed a missing git status in query_subset(), bumped version to 0.2.1
… commented out old versions of tests in test-origin.R and test-get_subset.R, added tests for find_origin() function
@program-- program-- merged commit 7dcccdb into owp-spatial:main Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants