Skip to content

Commit

Permalink
Merge pull request #19 from bcgov/add_water
Browse files Browse the repository at this point in the history
Add water
  • Loading branch information
stephhazlitt authored May 16, 2017
2 parents d7b5078 + 830c6c3 commit 8b26bab
Show file tree
Hide file tree
Showing 18 changed files with 173 additions and 4 deletions.
24 changes: 24 additions & 0 deletions R/water_districts.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2017 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

#' Polygons delineating British Columbia's Water Management Districts. Water Districts are
#' administrative areas established by the WATER REGULATIONS.
#'
#' @format A spatialPolygonsDataFrame with polygons delineating Water Management Districts for British Columbia.
#'
#' @source Original data from
#' \href{https://catalogue.data.gov.bc.ca/dataset/water-management-districts}{},
#' under the
#' \href{http://www2.gov.bc.ca/gov/content/data/open-data/open-government-license-bc}{Open
#' Government License - British Columbia}.
#'
"water_districts"
24 changes: 24 additions & 0 deletions R/water_precincts.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2017 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

#' Polygons delineating British Columbia's Water Management Precincts. Water Precincts are
#' jurisdictional areas within a Water District.
#'
#' @format A spatialPolygonsDataFrame with polygons delineating Water Management Precincts for British Columbia.
#'
#' @source Original data from
#' \href{https://catalogue.data.gov.bc.ca/dataset/water-management-precincts}{},
#' under the
#' \href{http://www2.gov.bc.ca/gov/content/data/open-data/open-government-license-bc}{Open
#' Government License - British Columbia}.
#'
"water_precincts"
7 changes: 5 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install_github("bcgov/bcmaps", build_vignettes = TRUE)

### Usage

At the moment, there are twelve layers available:
At the moment, there are fourteen layers available:

- `bc_bound`: Coarse provincial boundary of British Columbia (1:7.5M scale).

Expand Down Expand Up @@ -77,6 +77,9 @@ At the moment, there are twelve layers available:

- `gw_aquifers`: Boundaries of British Columbia's developed ground water aquifers (that have been mapped).

- `water_districts`: Boundaries of British Columbia's Water Management Districts.

- `water_precincts`: Boundaries of British Columbia's Water Management Precincts.

To load any of them, simply type `data(layer_name)`, where `layer_name` is the
name of the layer of interest. Then you can use the data as you would any `sp`
Expand Down Expand Up @@ -168,7 +171,7 @@ The data and code in this repository is licensed under multiple licenses.

- Source data in `/data-raw/canvec_15M_hydro` and `/data-raw/canvec_5M_hydro` is licensed under the [Open Government License - Canada version 2.0](http://open.canada.ca/en/open-government-licence-canada). See LICENSE.Canada-OGL-2.0 in the appropriate directory.

- Source data in `/data-raw/gw_aquifers` is licensed under the [Open Government License - British Columbia version 2.0](http://www2.gov.bc.ca/gov/content?id=A519A56BC2BF44E4A008B33FCF527F61). See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.
- Source data in `/data-raw/gw_aquifers`, `/data-raw/water_districts` and `/data-raw/water_precincts` is licensed under the [Open Government License - British Columbia version 2.0](http://www2.gov.bc.ca/gov/content?id=A519A56BC2BF44E4A008B33FCF527F61). See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.


This repository is maintained by [Environmental Reporting BC](http://www2.gov.bc.ca/gov/content?id=FF80E0B985F245CEA62808414D78C41B). Click [here](https://github.com/bcgov/EnvReportBC-RepoList) for a complete list of our repositories on GitHub.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install_github("bcgov/bcmaps", build_vignettes = TRUE)

### Usage

At the moment, there are twelve layers available:
At the moment, there are fourteen layers available:

- `bc_bound`: Coarse provincial boundary of British Columbia (1:7.5M scale).

Expand Down Expand Up @@ -57,6 +57,10 @@ At the moment, there are twelve layers available:

- `gw_aquifers`: Boundaries of British Columbia's developed ground water aquifers (that have been mapped).

- `water_districts`: Boundaries of British Columbia's Water Management Districts.

- `water_precincts`: Boundaries of British Columbia's Water Management Precincts.

To load any of them, simply type `data(layer_name)`, where `layer_name` is the name of the layer of interest. Then you can use the data as you would any `sp` object.

A couple of simple examples:
Expand Down Expand Up @@ -159,6 +163,6 @@ The data and code in this repository is licensed under multiple licenses.

- Source data in `/data-raw/canvec_15M_hydro` and `/data-raw/canvec_5M_hydro` is licensed under the [Open Government License - Canada version 2.0](http://open.canada.ca/en/open-government-licence-canada). See LICENSE.Canada-OGL-2.0 in the appropriate directory.

- Source data in `/data-raw/gw_aquifers` is licensed under the [Open Government License - British Columbia version 2.0](http://www2.gov.bc.ca/gov/content?id=A519A56BC2BF44E4A008B33FCF527F61). See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.
- Source data in `/data-raw/gw_aquifers`, `/data-raw/water_districts` and `/data-raw/water_precincts` is licensed under the [Open Government License - British Columbia version 2.0](http://www2.gov.bc.ca/gov/content?id=A519A56BC2BF44E4A008B33FCF527F61). See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.

This repository is maintained by [Environmental Reporting BC](http://www2.gov.bc.ca/gov/content?id=FF80E0B985F245CEA62808414D78C41B). Click [here](https://github.com/bcgov/EnvReportBC-RepoList) for a complete list of our repositories on GitHub.
26 changes: 26 additions & 0 deletions data-raw/process_water_districts.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2017 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

library("sp")
library("rgdal")
library("devtools")

water_districts_zip <- "data-raw/water_districts/BCGW_78757263_1494953755959_11056.zip"

unzip(water_districts_zip, exdir = "data-raw/water_districts")

water_districts <- readOGR(dsn = "data-raw/water_districts/LWADM_DA",
layer = "LWADM_DA_polygon", stringsAsFactors = FALSE)

water_districts <- spTransform(water_districts, "+init=epsg:3005")

use_data(water_districts, overwrite = TRUE, compress = "xz")
26 changes: 26 additions & 0 deletions data-raw/process_water_precincts.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2017 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

library("sp")
library("rgdal")
library("devtools")

water_precincts_zip <- "data-raw/water_precincts/BCGW_78757263_1494953784758_11056.zip"

unzip(water_precincts_zip, exdir = "data-raw/water_precincts")

water_precincts <- readOGR(dsn = "data-raw/water_precincts/LWADM_PA",
layer = "LWADM_PA_polygon", stringsAsFactors = FALSE)

water_precincts <- spTransform(water_precincts, "+init=epsg:3005")

use_data(water_precincts, overwrite = TRUE, compress = "xz")
5 changes: 5 additions & 0 deletions data-raw/water_districts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
LWADM_DA
contents_of_order.txt
licence.txt
LWADM_DA.html
README.txt
Binary file not shown.
Binary file added data-raw/water_districts/LICENSE.OGL-vbc2.0.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions data-raw/water_districts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## BC Water Management Districts

The file `BCGW_78757263_1494953755959_11056.zip` contains the British Columbia Water Management District polygons, downloaded from the [BC Data Catalogue](https://catalogue.data.gov.bc.ca/dataset/water-management-districts) under the ([Open Government License - British Columbia](http://www2.gov.bc.ca/gov/content/data/open-data/open-government-license-bc)).
5 changes: 5 additions & 0 deletions data-raw/water_precincts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
LWADM_PA
contents_of_order.txt
licence.txt
LWADM_PA.html
README.txt
Binary file not shown.
Binary file added data-raw/water_precincts/LICENSE.OGL-vbc2.0.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions data-raw/water_precincts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## BC Water Management Precincts

The file `BCGW_78757263_1494953784758_11056.zip` contains the British Columbia Water Management Precinct polygons, downloaded from the [BC Data Catalogue](https://catalogue.data.gov.bc.ca/dataset/water-management-precincts) under the ([Open Government License - British Columbia](http://www2.gov.bc.ca/gov/content/data/open-data/open-government-license-bc)).
Binary file added data/water_districts.rda
Binary file not shown.
Binary file added data/water_precincts.rda
Binary file not shown.
23 changes: 23 additions & 0 deletions man/water_districts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/water_precincts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b26bab

Please sign in to comment.