{"id":22463706,"url":"https://github.com/poissonconsulting/fwatlasbc","last_synced_at":"2025-08-02T05:32:22.057Z","repository":{"id":41268679,"uuid":"307518346","full_name":"poissonconsulting/fwatlasbc","owner":"poissonconsulting","description":"A R package to get data from the Freshwater Atlas of British Columbia","archived":false,"fork":false,"pushed_at":"2024-10-26T00:18:05.000Z","size":5658,"stargazers_count":9,"open_issues_count":16,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-27T00:49:41.466Z","etag":null,"topics":["bc","fwapg","fwapgr"],"latest_commit_sha":null,"homepage":"https://poissonconsulting.github.io/fwatlasbc/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poissonconsulting.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-26T22:17:19.000Z","updated_at":"2024-10-25T22:28:52.000Z","dependencies_parsed_at":"2024-10-24T21:33:43.634Z","dependency_job_id":"c4e76a5f-f8fd-4b4c-8b8d-eb4fa063945c","html_url":"https://github.com/poissonconsulting/fwatlasbc","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Ffwatlasbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Ffwatlasbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Ffwatlasbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Ffwatlasbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poissonconsulting","download_url":"https://codeload.github.com/poissonconsulting/fwatlasbc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439452,"owners_count":17920026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bc","fwapg","fwapgr"],"created_at":"2024-12-06T09:13:50.171Z","updated_at":"2024-12-06T09:13:50.522Z","avatar_url":"https://github.com/poissonconsulting.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# fwatlasbc \u003cimg src=\"man/figures/logo.png\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![R-CMD-check](https://github.com/poissonconsulting/fwatlasbc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/poissonconsulting/fwatlasbc/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/poissonconsulting/fwatlasbc/graph/badge.svg)](https://app.codecov.io/gh/poissonconsulting/fwatlasbc)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/license/mit/)\n\u003c!-- badges: end --\u003e\n\n`fwatlasbc` is an R package for querying data from the [Freshwater Atlas](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/topographic-data/freshwater) (FWA) of British Columbia. \nSpatial data are returned as [simple features](https://github.com/r-spatial/sf).\n\n`fwatlasbc` wraps [`fwapgr`](https://github.com/poissonconsulting/fwapgr) an R package that uses the [fwapg API](https://www.hillcrestgeo.ca/fwapg/index.html).\n\n## Installation\n\nYou can install the latest version of `fwatlasbc` from [GitHub](https://github.com/poissonconsulting/fwatlasbc) with:\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"poissonconsulting/fwatlasbc\")\n```\n\n## Demonstration\n\nFind stream names using regular expression.\nThere may be more than one stream name that matches the regular expression.\n```{r}\nlibrary(fwatlasbc)\nstreams \u003c- fwa_find_stream_names(\"steep c\")\nstreams\n```\n\nAdd blue line keys (blk) to stream names.\nThere may be multiple streams with the same name.\n```{r}\nblks \u003c- fwa_add_blks_to_stream_name(streams)\nblks\nblks \u003c- blks[blks$blk == 356534225, ]\n```\n\nAlternatively get the nearest blue line key and river meter (rm) from the longitude and latitude. \nThe river meter is the distance in meters as the fish swims from the mouth of the river.\nThe distance_to_lon_lat is the how far the original point was from the stream in meters.\n\n```{r}\nfwa_add_blk_to_lon_lat(data.frame(lon = -132.26, lat = 53.36))\n```\n\nGet watershed (by aggregating fundamental watersheds) for a blue line key and river meter (by default 0).\nIf it errors try increasing the river meter.\n```{r}\nwshed \u003c- fwa_add_watershed_to_blk(blks)\nwshed\n```\n\nGet stream network for the watershed polygon.\nNote that rm is from the original watershed while downstream/upstream_route_measure are the equivalents for the stream segment in the network.\n```{r}\nnetwork \u003c- fwa_add_collection_to_polygon(wshed, \"stream_network\")\nnetwork\n```\n\nConvert the stream network into a table of blue line keys with regularly spaced river meters starting at 0.\n```{r}\n# rms \u003c- fwa_convert_stream_network_to_rms(network, interval = 100)\n# rms\n```\n\nPlot the watershed, network and river meters.\n```{r dpi=300, fig.width=7, fig.height=7}\nggplot2::ggplot() +\n  ggplot2::geom_sf(data = wshed) +\n  ggplot2::geom_sf(data = network, color = \"blue\") +\n  #  ggplot2::geom_sf(data = rms) +\n  NULL\n```\n\n## Inspiration\n\n`fwatlasbc` supersedes the archived [`fwabc`](https://github.com/poissonconsulting/fwabc) which retrieved data via [WFS](https://openmaps.gov.bc.ca/geo/pub/wfs?service=WFS\u0026version=2.0.0\u0026request=GetFeature\u0026typeName=WHSE_BASEMAPPING.FWA_LAKES_POLY\u0026outputFormat=json\u0026SRSNAME=epsg%3A3005\u0026CQL_FILTER=GNIS_NAME_1=%27Quamichan%20Lake%27) using [`bcdata`](https://github.com/bcgov/bcdata). \n\n## Creditation\n\n`fwatlasbc` relies on [fwapg API](https://www.hillcrestgeo.ca/fwapg/index.html) which is created, maintained and hosted by [Simon Norris](https://github.com/smnorris/fwapg) at [Hillcrest Geographics](https://hillcrestgeo.ca/main/). \n\n## Contribution\n\nPlease report any [issues](https://github.com/poissonconsulting/fwatlasbc/issues).\n\n[Pull requests](https://github.com/poissonconsulting/fwatlasbc/pulls) are always welcome.\n\n### Code of Conduct\n\nPlease note that `fwatlasbc` is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). \nBy contributing to this project, you agree to abide by its terms.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoissonconsulting%2Ffwatlasbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoissonconsulting%2Ffwatlasbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoissonconsulting%2Ffwatlasbc/lists"}