bcmaps
An R package of map layers for British Columbia
Features
Various layers of British Columbia, such as administrative boundaries, natural resource management boundaries, etc. All layers are available as sp objects, and are in BC Albers projection, which is the B.C. government standard.
Installation
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)
Usage
At the moment, there are nine layers available:
bc_bound
: Coarse provincial boundary of British Columbia (at 1:7.5M scale).bc_bound_hres
: Detailed provincial boundary, from Statistics Canada.regional_districts_analysis
: Detailed Regional District boundaries (which are based on Canadian Census boundaries). Suitable for situations where you need detailed boundaries (faithful to the original representation).regional_districts_disp
: Simplified 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 B.C.'s 10 ecoprovincesecoregions
: Boundaries of B.C.'s 43 ecoregionsairzones
: Boundaries of B.C.'s 7 Air Zonesnr_areas
: Boundaries of B.C.'s 3 Natural Resource (NR) Areasnr_regions
: Boundaries of B.C.'s 8 Natural Resource (NR) Regionsnr_districts
: Boundaries of B.C.'s 24 Natural Resource (NR) Districtswatersheds
: Watershed boundaries delineated for Canada-BC hydrometric stations
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)
Size of British Columbia
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
Vignettes
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")
.
Project Status
Under active development, we will add different layers iteratively.
Getting Help or Reporting an Issue
To report bugs/issues/feature requests, please file an issue.
How to Contribute
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.
Source data
The source datasets used in this package come from various sources under open licenses, including DataBC (Open Government License - British Columbia) and Statistics Canada (Statistics Canada Open Licence Agreement). See the data-raw
folder for details on each source dataset.
License
The data and code in this repository is licensed under multiple licenses.
All R code in the
/R
directory and the/data-raw
directory is licensed under the Apache License 2.0. See LICENSE.Apache-2.0 in the appropriate directories.Source data in
/data-raw/bc_bound
is licensed under the Open Government License - Canada version 2.0. See LICENSE.Canada-OGL-2.0 in the appropriate directory.Source data in
/data-raw/census-divisions_statscan
is licensed under the Statistics Canada Open License Agreement. See LICENSE.StatsCan-OLA in the appropriate directory.Source data in
/data-raw/prov_territories_statscan
is licensed under the Statistics Canada Open License Agreement. See LICENSE.StatsCan-OLA in the appropriate directory.Source data in
/data-raw/ecoprovinces
is licensed under the Open Government License - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.Source data in
/data-raw/ecoregions
is licensed under the Open Government License - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.Source data in
/data-raw/airzones
is licensed under the Open Government License - British Columbia version 2.0. See LICENSE.OGL-vbc2.0.pdf in the appropriate directory.
This repository is maintained by Environmental Reporting BC. Click here for a complete list of our repositories on GitHub.