Learn R Programming

bcmaps

An R package of spatial map layers for British Columbia.

bcmaps provides access to various spatial layers of British Columbia, such as administrative boundaries, natural resource management boundaries, watercourses, census boundaries, etc. All layers are available as sf objects in the BC Albers projection, which is the B.C. Government standard.

Most layers are accessed directly from the B.C. Data Catalogue using the bcdata R package under the hood. See each layer’s individual help file for more detail.

IMPORTANT NOTE Support for Spatial objects (sp) was removed in {bcmaps} v1.3.0. Please use sf objects with {bcmaps}. A discussion on the evolution of the spatial software stack in R can be found here: https://r-spatial.org/r/2022/04/12/evolution.html.

Installation

You can install bcmaps from CRAN:

install.packages("bcmaps")

To install the development version of the bcmaps package, you need to install the remotes package then the bcmaps package.

install.packages("remotes")
remotes::install_github("bcgov/bcmaps")

Quick Start

To see the layers that are available, run the available_layers() function:

library(bcmaps)
available_layers()

Most layers are accessible by a shortcut function by the same name as the object. Then you can use the data as you would any sf object.

library(sf)

bc <- bc_bound()
plot(st_geometry(bc))

Vignettes

Getting Started with bcmaps
Working with bcmaps layers and point data

You can also view vignettes by typing browseVignettes("bcmaps") in your R session after you install bcmaps.

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 licences, including the B.C. Data Catalalogue (Open Government Licence - British Columbia) and Statistics Canada (Statistics Canada Open Licence Agreement). See the data-raw folder for details on each source dataset.

Licence

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

Copy Link

Version

Install

install.packages('bcmaps')

Monthly Downloads

509

Version

2.2.1

License

Apache License (== 2.0) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Andy Teucher

Last Published

December 21st, 2024

Functions in bcmaps (2.2.1)

nr_areas

British Columbia Natural Resource (NR) Areas
combine_nr_rd

Combine Northern Rockies Regional Municipality with Regional Districts
delete_cache

View and delete cached files
municipalities

British Columbia Municipalities
census_economic

Current Census Economic Region Boundaries
fsa

British Columbia Forward Sortation Areas
health_hsda

Health Service Delivery Area Boundaries
census_division

Current Census Division Boundaries
health_chsa

Community Health Service Areas - CHSA
fix_geo_problems

Check and fix polygons that self-intersect, and sometimes can fix orphan holes
mapsheets_250K

NTS 250K Grid - Digital Baseline Mapping at 1:250,000 (NTS)
ecoprovinces

British Columbia Ecoprovinces
gw_aquifers

British Columbia's developed ground water aquifers
ecosections

British Columbia Ecosections
mapsheets_50K

NTS 50K Grid - Digital Baseline Mapping at 1:50,000 (NTS)
health_ha

Health Authority Boundaries
ecoregions

British Columbia Ecoregions
utm_convert

Convert a data.frame of UTM coordinates to an sf object with a single CRS
health_lha

Local Health Area Boundaries
hydrozones

Hydrologic Zone Boundaries of British Columbia
vrt_files

List the files that a vrt is built on
transform_bc_albers

Transform a Spatial* object to BC Albers projection
vrt_info

Get metadata about a .vrt file
water_districts

British Columbia's Water Management Districts
summarize_raster_list

Summarize a list of rasters into a list of numeric vectors
water_precincts

British Columbia's Water Management Precincts
self_union

Union a SpatialPolygons* object with itself to remove overlaps, while retaining attributes
watercourses_15M

British Columbia watercourses at 1:15M scale
raster_by_poly

Overlay a SpatialPolygonsDataFrame or sf polygons layer on a raster layer and clip the raster to each polygon. Optionally done in parallel
nr_regions

British Columbia Natural Resource (NR) Regions
get_layer

Get a B.C. spatial layer
nr_districts

British Columbia Natural Resource (NR) Districts
watercourses_5M

British Columbia watercourses at 1:5M scale
regional_districts

British Columbia Regional Districts
wsc_drainages

Water Survey of Canada Sub-Sub-Drainage Areas
get_poly_attribute

Get or calculate the attribute of a list-column containing nested dataframes.
tsa

British Columbia Timber Supply Areas and TSA Blocks
bcmaps-package

bcmaps: Map Layers and Spatial Utilities for British Columbia
bc_cities

BC Major Cities Points
bc_area

The size of British Columbia
bc_bbox

Get an extent/bounding box for British Columbia
bc_bound_hres

BC Boundary - High Resolution
bc_bound

BC Boundary
bec

British Columbia BEC Map
airzones

British Columbia Air Zones
bc_neighbours

Boundary of British Columbia, provinces/states and the portion of the Pacific Ocean that borders British Columbia
census_metropolitan_area

Current Census Metropolitan Areas
census_subdivision

Current Census Subdivision Boundaries
cded_terra

Get Canadian Digital Elevation Model (CDED) as a terra object
census_dissemination_area

Current Census Dissemination Areas
cded_raster

Get Canadian Digital Elevation Model (CDED) as a raster object
available_layers

List available data layers
cded_stars

Get Canadian Digital Elevation Model (CDED) as a stars object
census_tract

Current Census Tract Boundaries
bec_colours

Biogeoclimatic Zone Colours
cded

Canadian Digital Elevation Model (CDED)