An R package of map layers for British Columbia.
Various layers of British Columbia, such as administrative boundaries, natural resource management boundaries, watercourses etc. All layers are available as sp objects, and are in BC Albers projection, which is the B.C. Government standard.
The package is not available on CRAN, but can be installed using the devtools package:
install.packages("devtools") # if not already installed
library(devtools)
install_github("bcgov/bcmaps", build_vignettes = TRUE)
At the moment, there are sixteen layers available:
-
bc_bound
: Coarse provincial boundary of British Columbia (1:7.5M scale). -
bc_bound_hres
: Detailed provincial boundary of British Columbia from Statistics Canada. -
regional_districts_analysis
: Detailed B.C. Regional District boundaries based on Canadian Census boundaries. Suitable for situations where you need detailed boundaries (faithful to the original representation). -
regional_districts_disp
: Simplified B.C. Regional District boundaries. Much smaller file size than the analysis layer, suitable for situations where you don't need detailed boundaries, often useful when making maps for display. -
ecoprovinces
: Boundaries of British Columbia's 10 ecoprovinces. -
ecoregions
: Boundaries of British Columbia's 43 ecoregions. -
airzones
: Boundaries of British Columbia's 7 Air Zones. -
nr_areas
: Boundaries of British Columbia's 3 Natural Resource (NR) Areas. -
nr_regions
: Boundaries of British Columbia's 8 Natural Resource (NR) Regions. -
nr_districts
: Boundaries of British Columbia's 24 Natural Resource (NR) Districts. -
watersheds
: Boundaries of British Columbia's hydrometric watersheds, delineated for Canada-British Columbia hydrometric stations. -
watercourses_15M
: Watercourses for British Columbia at 1:15M scale. -
watercourses_5M
: Watercourses for British Columbia at 1:5M scale. -
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. -
hydrozones
: Hydrologic Zone Boundaries of British Columbia. -
wsc_drainages
: Water Survey of Canada Sub-Sub-Drainage Areas.
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:
library(bcmaps)
#> Loading required package: sp
# Load and plot the boundaries of B.C.
data(bc_bound)
plot(bc_bound)
## Next load the Regional Districts data, then extract and plot the Kootenays
data(regional_districts_disp)
kootenays <- regional_districts_disp[grep("Kootenay",
regional_districts_disp$region_name), ]
plot(kootenays)
text(coordinates(kootenays),
labels = kootenays$region_name, cex = 0.6)
# Load watercourse data and plot with boundaries of B.C.
data(watercourses_15M)
plot(bc_bound)
plot(watercourses_15M, add = TRUE)
There is also a simple function that returns the size of B.C. in various units. You can choose total area, land area only, or freshwater area only:
bc_area("total", "ha")
#> total_ha
#> 94473500
bc_area("land", "m2")
#> land_m2
#> 9.25186e+11
bc_area("freshwater", "km2")
#> freshwater_km2
#> 19549
We have written a short vignette on plotting points on one of the layers from bcmaps
. You can view the vignette online here or if you installed the package using devtools::install_github("bcgov/bcmaps", build_vignettes = TRUE)
you can open it using browseVignettes("bcmaps")
.
Further development of the bcmaps
package is on hold until the enhancements outlined in Issue #2 and #21 are implemented. We are hoping to tackle these in 2018.
If you are using the new R package sf, you can convert the bcmaps
sp objects to sf
objects with sf::st_as_sf()
install.packages("sf") # if not already installed
library(sf)
bc_bound_sf <- st_as_sf(bcmaps::bc_bound)
To report bugs/issues/feature requests, please file an issue.
Pull requests of new B.C. layers are welcome. If you would like to contribute to the package, please see our CONTRIBUTING guidelines.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
The source datasets used in this package come from various sources under open licences, including DataBC (Open Government Licence - British Columbia) and Statistics Canada (Statistics Canada Open Licence Agreement). See the data-raw
folder for details on each source dataset.
The data and code in this repository is licenced under multiple licences.
-
All R code in the
/R
directory and the/data-raw
directory is licenced under the Apache License 2.0. See LICENSE.Apache-2.0 in the appropriate directories. -
Source data in
/data-raw/bc_bound
is licenced under the Open Government Licence - Canada version 2.0. See LICENSE.Canada-OGL-2.0 in the appropriate directory. -
Source data in
/data-raw/census-divisions_statscan
is licenced under the Statistics Canada Open Licence Agreement. See LICENSE.StatsCan-OLA in the appropriate directory. -
Source data in
/data-raw/prov_territories_statscan
is licenced under the Statistics Canada Open Licence Agreement. See LICENSE.StatsCan-OLA in the appropriate directory. -
Source data in
/data-raw/ecoprovinces
and/data-raw/ecoregions
is licenced under the Open Government Licence - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory. -
Source data in
/data-raw/airzones
is licenced under the Open Government Licence - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory. -
Source data in
/data-raw/nr_areas
,/data-raw/nr_regions
and/data-raw/nr_districts
is licenced under the Open Government Licence - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory. -
Source data in
/data-raw/watershed_boundaries
is licenced under the Open Government Licence - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory. -
Source data in
/data-raw/hydrozones
is licenced under the Open Government Licence - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory. -
Source data in
/data-raw/canvec_15M_hydro
and/data-raw/canvec_5M_hydro
is licenced under the Open Government Licence - Canada version 2.0. See LICENSE.Canada-OGL-2.0 in the appropriate directory. -
Source data in
/data-raw/gw_aquifers
,/data-raw/water_districts
and/data-raw/water_precincts
is licenced under the Open Government Licence - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory. -
Source data in
/data-raw/wsc_drainages
is licenced under the Open Government Licence - Canada version 2.0. See LICENSE.Canada-OGL-2.0 in the appropriate directory.
This repository is maintained by Environmental Reporting BC. Click here for a complete list of our repositories on GitHub.