Skip to content

Commit 8b26bab

Browse files
authored
Merge pull request #19 from bcgov/add_water
Add water
2 parents d7b5078 + 830c6c3 commit 8b26bab

18 files changed

Lines changed: 173 additions & 4 deletions

R/water_districts.R

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

R/water_precincts.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2017 Province of British Columbia
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and limitations under the License.
12+
13+
#' Polygons delineating British Columbia's Water Management Precincts. Water Precincts are
14+
#' jurisdictional areas within a Water District.
15+
#'
16+
#' @format A spatialPolygonsDataFrame with polygons delineating Water Management Precincts for British Columbia.
17+
#'
18+
#' @source Original data from
19+
#' \href{https://catalogue.data.gov.bc.ca/dataset/water-management-precincts}{},
20+
#' under the
21+
#' \href{http://www2.gov.bc.ca/gov/content/data/open-data/open-government-license-bc}{Open
22+
#' Government License - British Columbia}.
23+
#'
24+
"water_precincts"

README.Rmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ install_github("bcgov/bcmaps", build_vignettes = TRUE)
4747

4848
### Usage
4949

50-
At the moment, there are twelve layers available:
50+
At the moment, there are fourteen layers available:
5151

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

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

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

80+
- `water_districts`: Boundaries of British Columbia's Water Management Districts.
81+
82+
- `water_precincts`: Boundaries of British Columbia's Water Management Precincts.
8083

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

169172
- 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.
170173

171-
- 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.
174+
- 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.
172175

173176

174177
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.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install_github("bcgov/bcmaps", build_vignettes = TRUE)
2727

2828
### Usage
2929

30-
At the moment, there are twelve layers available:
30+
At the moment, there are fourteen layers available:
3131

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

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

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

60+
- `water_districts`: Boundaries of British Columbia's Water Management Districts.
61+
62+
- `water_precincts`: Boundaries of British Columbia's Water Management Precincts.
63+
6064
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.
6165

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

160164
- 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.
161165

162-
- 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.
166+
- 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.
163167

164168
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.

data-raw/process_water_districts.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2017 Province of British Columbia
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and limitations under the License.
12+
13+
library("sp")
14+
library("rgdal")
15+
library("devtools")
16+
17+
water_districts_zip <- "data-raw/water_districts/BCGW_78757263_1494953755959_11056.zip"
18+
19+
unzip(water_districts_zip, exdir = "data-raw/water_districts")
20+
21+
water_districts <- readOGR(dsn = "data-raw/water_districts/LWADM_DA",
22+
layer = "LWADM_DA_polygon", stringsAsFactors = FALSE)
23+
24+
water_districts <- spTransform(water_districts, "+init=epsg:3005")
25+
26+
use_data(water_districts, overwrite = TRUE, compress = "xz")

data-raw/process_water_precincts.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2017 Province of British Columbia
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and limitations under the License.
12+
13+
library("sp")
14+
library("rgdal")
15+
library("devtools")
16+
17+
water_precincts_zip <- "data-raw/water_precincts/BCGW_78757263_1494953784758_11056.zip"
18+
19+
unzip(water_precincts_zip, exdir = "data-raw/water_precincts")
20+
21+
water_precincts <- readOGR(dsn = "data-raw/water_precincts/LWADM_PA",
22+
layer = "LWADM_PA_polygon", stringsAsFactors = FALSE)
23+
24+
water_precincts <- spTransform(water_precincts, "+init=epsg:3005")
25+
26+
use_data(water_precincts, overwrite = TRUE, compress = "xz")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LWADM_DA
2+
contents_of_order.txt
3+
licence.txt
4+
LWADM_DA.html
5+
README.txt
2.59 MB
Binary file not shown.
198 KB
Binary file not shown.

data-raw/water_districts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## BC Water Management Districts
2+
3+
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)).

0 commit comments

Comments
 (0)