{"id":84778,"name":"fwapg","description":"Extends British Columbia's Freshwater Atlas with PostgreSQL/PostGIS.","url":"https://github.com/smnorris/fwapg","last_synced_at":"2026-05-14T07:30:21.363Z","repository":{"id":39725336,"uuid":"185426100","full_name":"smnorris/fwapg","owner":"smnorris","description":"PostgreSQL tools for working with British Columbia's Freshwater Atlas","archived":false,"fork":false,"pushed_at":"2026-04-29T19:18:44.000Z","size":9921,"stargazers_count":10,"open_issues_count":36,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-01T01:00:45.429Z","etag":null,"topics":["british-columbia","freshwater-atlas","fwa","lakes","linear-referencing","postgis","rivers","streams","watersheds"],"latest_commit_sha":null,"homepage":"https://smnorris.github.io/fwapg","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smnorris.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-07T15:07:42.000Z","updated_at":"2026-04-29T19:18:48.000Z","dependencies_parsed_at":"2024-02-08T01:22:52.240Z","dependency_job_id":"f1eb5dbc-00cc-4bb1-a586-c71bc912150a","html_url":"https://github.com/smnorris/fwapg","commit_stats":{"total_commits":442,"total_committers":2,"mean_commits":221.0,"dds":0.03167420814479638,"last_synced_commit":"9500b61f22fe8d4ae6059bbba3e3e5d97cb9899d"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/smnorris/fwapg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smnorris","download_url":"https://codeload.github.com/smnorris/fwapg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32633438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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"}},"owner":{"login":"smnorris","name":"Simon Norris","uuid":"1323293","kind":"user","description":"","email":"","website":"www.hillcrestgeo.ca","location":"British Columbia","twitter":null,"company":"Hillcrest Geographics","icon_url":"https://avatars.githubusercontent.com/u/1323293?v=4","repositories_count":52,"last_synced_at":"2025-10-10T16:35:26.744Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/smnorris","funding_links":[],"total_stars":51,"followers":55,"following":38,"created_at":"2022-11-05T19:12:36.181Z","updated_at":"2025-10-10T16:35:26.744Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smnorris","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smnorris/repositories"},"packages":[{"id":14071150,"name":"github.com/smnorris/fwapg","ecosystem":"go","description":null,"homepage":null,"licenses":"mit","normalized_licenses":["MIT"],"repository_url":"https://github.com/smnorris/fwapg","keywords_array":[],"namespace":null,"versions_count":19,"first_release_published_at":"2026-03-18T12:27:47.939Z","latest_release_published_at":"2026-04-17T21:01:59.000Z","latest_release_number":"v0.7.2","last_synced_at":"2026-05-11T06:01:21.829Z","created_at":"2026-03-18T12:27:46.079Z","updated_at":"2026-05-11T06:01:21.829Z","registry_url":"https://pkg.go.dev/github.com/smnorris/fwapg","install_command":"go get github.com/smnorris/fwapg","documentation_url":"https://pkg.go.dev/github.com/smnorris/fwapg#section-documentation","metadata":{},"repo_metadata":{"id":39725336,"uuid":"185426100","full_name":"smnorris/fwapg","owner":"smnorris","description":"PostgreSQL tools for working with British Columbia's Freshwater Atlas","archived":false,"fork":false,"pushed_at":"2026-04-17T21:03:20.000Z","size":9915,"stargazers_count":10,"open_issues_count":35,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-22T21:04:24.807Z","etag":null,"topics":["british-columbia","freshwater-atlas","fwa","lakes","linear-referencing","postgis","rivers","streams","watersheds"],"latest_commit_sha":null,"homepage":"https://smnorris.github.io/fwapg","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smnorris.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-07T15:07:42.000Z","updated_at":"2026-04-17T21:04:34.000Z","dependencies_parsed_at":"2024-02-08T01:22:52.240Z","dependency_job_id":"f1eb5dbc-00cc-4bb1-a586-c71bc912150a","html_url":"https://github.com/smnorris/fwapg","commit_stats":{"total_commits":442,"total_committers":2,"mean_commits":221.0,"dds":0.03167420814479638,"last_synced_commit":"9500b61f22fe8d4ae6059bbba3e3e5d97cb9899d"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/smnorris/fwapg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smnorris","download_url":"https://codeload.github.com/smnorris/fwapg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32242315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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"}},"repo_metadata_updated_at":"2026-05-01T01:04:35.620Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":5.227687248297523,"dependent_packages_count":4.898440373970379,"stargazers_count":null,"forks_count":null,"docker_downloads_count":null,"average":5.063063811133951},"purl":"pkg:golang/github.com/smnorris/fwapg","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/smnorris/fwapg","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/smnorris/fwapg","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/smnorris/fwapg/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2026-04-29T03:01:54.521Z","issues_count":116,"pull_requests_count":33,"avg_time_to_close_issue":5214409.641975309,"avg_time_to_close_pull_request":211478.625,"issues_closed_count":81,"pull_requests_closed_count":32,"pull_request_authors_count":2,"issue_authors_count":6,"avg_comments_per_issue":1.1293103448275863,"avg_comments_per_pull_request":0.030303030303030304,"merged_pull_requests_count":28,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":11,"past_year_pull_requests_count":8,"past_year_avg_time_to_close_issue":1366049.8333333333,"past_year_avg_time_to_close_pull_request":27579.875,"past_year_issues_closed_count":6,"past_year_pull_requests_closed_count":8,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":2,"past_year_avg_comments_per_issue":1.2727272727272727,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":7,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/issues","maintainers":[{"login":"smnorris","count":140,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/smnorris"},{"login":"daimoriwaki","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/daimoriwaki"}],"active_maintainers":[{"login":"smnorris","count":17,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/smnorris"}]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fsmnorris%2Ffwapg/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fsmnorris%2Ffwapg/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fsmnorris%2Ffwapg/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fsmnorris%2Ffwapg/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fsmnorris%2Ffwapg/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fsmnorris%2Ffwapg/codemeta","maintainers":[],"registry":{"name":"proxy.golang.org","url":"https://proxy.golang.org","ecosystem":"go","default":true,"packages_count":2135855,"maintainers_count":0,"namespaces_count":782439,"keywords_count":112823,"github":"golang","metadata":{"funded_packages_count":53495},"icon_url":"https://github.com/golang.png","created_at":"2022-04-04T15:19:22.939Z","updated_at":"2026-04-19T05:14:45.920Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages","maintainers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/maintainers","namespaces_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/namespaces"}}],"commits":{"id":1382546,"full_name":"smnorris/fwapg","default_branch":"main","total_commits":489,"total_committers":2,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":244.5,"dds":0.02862985685071573,"past_year_total_commits":31,"past_year_total_committers":1,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":31.0,"past_year_dds":0.0,"last_synced_at":"2026-05-11T06:02:33.917Z","last_synced_commit":"8e72ae476156ba0d89988bb1921d83bdbab8dc9e","created_at":"2023-09-21T13:10:12.452Z","updated_at":"2026-05-11T06:02:33.762Z","committers":[{"name":"Simon Norris","email":"snorris@hillcrestgeo.ca","login":"smnorris","count":475},{"name":"franTarkenton","email":"kevin.netherton@gov.bc.ca","login":"franTarkenton","count":14}],"past_year_committers":[{"name":"Simon Norris","email":"snorris@hillcrestgeo.ca","login":"smnorris","count":31}],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-05-13T00:00:10.629Z","repositories_count":6233266,"commits_count":894160728,"contributors_count":34889676,"owners_count":1152111,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"smnorris/fwapg","html_url":"https://github.com/smnorris/fwapg","last_synced_at":"2026-04-29T03:01:54.521Z","status":null,"issues_count":116,"pull_requests_count":33,"avg_time_to_close_issue":5214409.641975309,"avg_time_to_close_pull_request":211478.625,"issues_closed_count":81,"pull_requests_closed_count":32,"pull_request_authors_count":2,"issue_authors_count":6,"avg_comments_per_issue":1.1293103448275863,"avg_comments_per_pull_request":0.030303030303030304,"merged_pull_requests_count":28,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":11,"past_year_pull_requests_count":8,"past_year_avg_time_to_close_issue":1366049.8333333333,"past_year_avg_time_to_close_pull_request":27579.875,"past_year_issues_closed_count":6,"past_year_pull_requests_closed_count":8,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":2,"past_year_avg_comments_per_issue":1.2727272727272727,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":7,"created_at":"2023-09-21T13:10:42.593Z","updated_at":"2026-04-29T03:01:54.522Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/smnorris%2Ffwapg/issues","issue_labels_count":{"bug":24,"enhancement":9,"data":2,"advertising":1},"pull_request_labels_count":{},"issue_author_associations_count":{"OWNER":108,"NONE":7,"COLLABORATOR":1},"pull_request_author_associations_count":{"OWNER":32,"CONTRIBUTOR":1},"issue_authors":{"smnorris":108,"joethorley":3,"NewGraphEnvironment":2,"paddleman":1,"daimoriwaki":1,"heckstra":1},"pull_request_authors":{"smnorris":32,"franTarkenton":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-05-11T00:00:23.633Z","repositories_count":14565655,"issues_count":34192271,"pull_requests_count":112028531,"authors_count":11258856,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{"OWNER":7,"NONE":1},"past_year_pull_request_author_associations_count":{"OWNER":8},"past_year_issue_authors":{"smnorris":7,"NewGraphEnvironment":1},"past_year_pull_request_authors":{"smnorris":8},"maintainers":[{"login":"smnorris","count":140,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/smnorris"},{"login":"daimoriwaki","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/daimoriwaki"}],"active_maintainers":[{"login":"smnorris","count":15,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/smnorris"}]},"events":{"total":{"DeleteEvent":8,"PullRequestEvent":11,"IssuesEvent":18,"IssueCommentEvent":17,"PushEvent":91,"CreateEvent":11},"last_year":{"DeleteEvent":4,"PullRequestEvent":4,"IssuesEvent":7,"IssueCommentEvent":2,"PushEvent":52,"CreateEvent":3}},"keywords":["british-columbia","freshwater-atlas","fwa","lakes","linear-referencing","postgis","rivers","streams","watersheds"],"dependencies":[{"ecosystem":"pypi","filepath":"docs/requirements.txt","sha":null,"kind":"manifest","created_at":"2022-08-25T14:41:54.328Z","updated_at":"2022-08-25T14:41:54.328Z","repository_link":"https://github.com/smnorris/fwapg/blob/main/docs/requirements.txt","dependencies":[{"id":2696582331,"package_name":"myst_parser","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":2696582332,"package_name":"sphinx_rtd_theme","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/build-docker-image.yml","sha":null,"kind":"manifest","created_at":"2024-02-01T06:44:02.404Z","updated_at":"2024-02-01T06:44:02.404Z","repository_link":"https://github.com/smnorris/fwapg/blob/main/.github/workflows/build-docker-image.yml","dependencies":[{"id":15958285314,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":15958285315,"package_name":"docker/login-action","ecosystem":"actions","requirements":"65b78e6e13532edd9afa3aa52ac7964289d1a9c1","direct":true,"kind":"composite","optional":false},{"id":15958285316,"package_name":"docker/metadata-action","ecosystem":"actions","requirements":"9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7","direct":true,"kind":"composite","optional":false},{"id":15958285317,"package_name":"docker/build-push-action","ecosystem":"actions","requirements":"f2a1d5e99d037542a71f64918e516c093c6f3fc4","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/build-docs.yml","sha":null,"kind":"manifest","created_at":"2024-02-01T06:44:02.447Z","updated_at":"2024-02-01T06:44:02.447Z","repository_link":"https://github.com/smnorris/fwapg/blob/main/.github/workflows/build-docs.yml","dependencies":[{"id":15958286322,"package_name":"actions/checkout","ecosystem":"actions","requirements":"master","direct":true,"kind":"composite","optional":false},{"id":15958286323,"package_name":"erpcya/sphinx-action","ecosystem":"actions","requirements":"feature/#update-sphinx-base-image","direct":true,"kind":"composite","optional":false},{"id":15958286703,"package_name":"ad-m/github-push-action","ecosystem":"actions","requirements":"master","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"docker","filepath":"Dockerfile","sha":null,"kind":"manifest","created_at":"2024-02-01T06:44:02.786Z","updated_at":"2024-02-01T06:44:02.786Z","repository_link":"https://github.com/smnorris/fwapg/blob/main/Dockerfile","dependencies":[{"id":15958286704,"package_name":"ghcr.io/osgeo/gdal","ecosystem":"docker","requirements":"ubuntu-small-3.8.0","direct":true,"kind":"build","optional":false}]},{"ecosystem":"docker","filepath":"docker-compose.yml","sha":null,"kind":"manifest","created_at":"2024-02-01T06:44:02.953Z","updated_at":"2024-02-01T06:44:02.953Z","repository_link":"https://github.com/smnorris/fwapg/blob/main/docker-compose.yml","dependencies":[{"id":15958286794,"package_name":"postgis/postgis","ecosystem":"docker","requirements":"16-3.4","direct":true,"kind":"runtime","optional":false},{"id":15958286795,"package_name":"pramsey/pg_featureserv","ecosystem":"docker","requirements":"latest","direct":true,"kind":"runtime","optional":false},{"id":15958286796,"package_name":"pramsey/pg_tileserv","ecosystem":"docker","requirements":"latest","direct":true,"kind":"runtime","optional":false}]}],"score":null,"created_at":"2023-09-21T12:55:56.896Z","updated_at":"2026-05-14T07:30:21.368Z","avatar_url":"https://github.com/smnorris.png","language":"PLpgSQL","category":"Hydrosphere","sub_category":"Freshwater and Hydrology","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"# fwapg\n\n`fwapg` extends British Columbia's [Freshwater Atlas](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/topographic-data/freshwater) (FWA) with PostgreSQL/PostGIS. `fwapg` provides additional tables, indexes and functions to:\n\n- quickly translate arbitrary point locations (`X,Y`) to a linear reference positions (`blue_line_key, measure`) on the stream network\n- enable speedy upstream/downstream queries throughout BC\n- quickly and cleanly generate watershed boundaries upstream of arbitrary locations\n- enable cross-boundary queries by combining FWA data with data from neighbouring jurisdictions\n- enable querying of FWA features via spatial SQL\n- provide `gradient` values for every FWA stream\n- enable quickly serving FWA features as vector tiles (MVT)\n- enable quickly serving FWA features and custom fwapg functions\n- link additional data to FWA streams (PCIC mean annual discharge, modelled channel width, upstream precipitation)\n\nSee [documentation](https://smnorris.github.io/fwapg/) for setup and usage details, plus table and function references.\n\n\n## Quickstart\n\n1. Ensure all requirements/dependencies are met/installed. \n    - access to a PostgreSQL (\u003e13) database with the PostGIS extension\n    - GDAL \u003e=3.6\n    - Python 3\n    - [`bcdata`](https://github.com/smnorris/bcdata)\n\nSee the `docker/loader/Dockerfile` for the full list of dependencies.\n    \n\n2. Ensure you have a `DATABASE_URL` environment variable set to point to your database, for example:\n\n        export DATABASE_URL=postgresql://username:password@localhost:5432/fwapg\n\n3. Get scripts, load and optimize the data:\n\n        git clone https://github.com/smnorris/fwapg.git\n        cd fwapg\n        psql $DATABASE_URL -f db/schema.sql # create db schema\n        ./load.sh                           # load the data\n\nThe full load takes some time - but once complete, you can run `fwapg` enabled queries with your favorite sql client. For example:\n\n*Locate the nearest point on the FWA stream network to a X,Y location on Highway 14:*\n\n        SELECT \n          gnis_name, \n          blue_line_key, \n          downstream_route_measure\n        FROM FWA_IndexPoint(ST_Transform(ST_GeomFromText('POINT(-123.7028 48.3858)', 4326), 3005));\n\n          gnis_name  | blue_line_key | downstream_route_measure\n        -------------+---------------+--------------------------\n         Sooke River |     354153927 |        350.2530543284006\n\n*Generate the watershed upstream of this location:*\n\n        SELECT ST_ASText(geom) FROM FWA_WatershedAtMeasure(354153927, 350);\n\n         st_astext\n        --------------\n        POLYGON((...\n\n*Select all stream upstream of this location:*\n\n        SELECT ST_ASText(geom)\n        FROM FWA_UpstreamTrace(354153927, 350);\n\n         st_astext\n        --------------\n        LINESTRINGZM((...\n\n\nSee [Usage](https://smnorris.github.io/fwapg/01_usage.html) for more examples.\n\n\n## Tile and feature services\n\n`fwapg` features and functions are served from hillcrestgeo.ca as GeoJSON or vector tiles via these web services and wrappers:\n\n- [features.hillcrestgeo.ca/fwa](https://features.hillcrestgeo.ca/fwa): tables and functions served as GeoJSON\n- [fwapgr (R)](https://github.com/poissonconsulting/fwapgr): an R wrapper around the `features.hillcrestgeo.ca/fwa` feature service\n- [fwatlasbc (R)](https://github.com/poissonconsulting/fwatlasbc): an R package for higher level queries\n- [tiles.hillcrestgeo.ca/bcfishpass](https://tiles.hillcrestgeo.ca/bcfishpass): FWA features (and others) served as vector tiles (MVT)\n\n\n## Source data\n\n- BC Freshwater Atlas [documentation](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/topographic-data/freshwater) and [license](https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc)\n\n- BC stream contributing areas (watershed boundaries) outside of BC were provided by Dan Weller, DFO \n\n## Development and testing\n\nSee `db/README.md` for how to apply migrations.\n\nExtremely basic tests are included for selected functions.\nIf changing a covered function, run the individual test. For example:\n\n    psql -f tests/test_fwa_upstream.sql\n\nAll results should be true.\n\n## Docker on ARM64\n\nOn ARM64 platforms (eg MacOS), remember to build the postgis image before running `docker compose build` or `docker compose up -d`.\nDocker will pull this postgis image from the cache instead of attempting to download (an arm64 image is not currently published). \n\n        docker build \\\n          https://github.com/postgis/docker-postgis.git#master:16-3.5 \\\n          -t postgis/postgis:16-3.5\n\n## Documentation\n\nDocumentation is built from the markdown files in `/docs`.\nInfo in the table reference page (`02_tables_views.md`) can be autogenerated from comments in the database. To dump the text to stdout:\n```\ncd docs\n./table_reference.sh \n```","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/84778","html_url":"https://ost.ecosyste.ms/projects/84778"}