cded_()
functions, the ask
argument, which controls if the user is asked to store data in the
cache, was ignored. It is now respected (#147).utm_convert()
now respects tibble
classes
(#143,
#148).utm_convert()
where new coordinates
could be mismatched with the wrong rows from the input data frame. (#146, #148)utm_convert()
to convert tabular data
with X and Y coordinates in (possibly multiple) UTM zones to a single
CRS.cded_terra()
cded_raster()
- this will be
removed in a future version.sp
and
raster
supportWe’ve removed support for the sp
and raster
packages, especially those parts that require the use of the
rgdal
and rgeos
packages, which will be
retired in October 2023. See the r-spatial
blog for details of this evolution.
class
argument in all of the data download
functions: get_layer()
and all of the wrapper shortcuts
such as bc_bound()
, census_tract()
, etc. These
functions will now only return sf
objects.Spatial
method of
transform_bc_albers()
is removed.fix_geo_problems()
is removed. For sf
objects simply use sf::st_make_valid()
self_union()
is removed. Use
raster::union()
for SpatialPolygonsDataFrame
s,
or sf::st_union()
with sf
objects
instead.get_poly_attribute()
is removed.raster_by_poly()
is retained for now as it does not
rely on rgdal
or rgeos
, just sp
and raster
, which are still being maintained.pkgdown
site for bcmaps
https://bcgov.github.io/bcmaps/ (#63)README
to a Get Started with bcmaps
article/vignette (#42)bc_bound_hres()
(#124)sp
and raster
supportWe’ve started the process of removing support for the sp
and raster
packages, especially those parts of that require
the use of the rgdal
and rgeos
packages, which
will be retired in October 2023. See the r-spatial
blog for details of this evolution. We will fully remove support for
Spatial
classes (from package sp
) in the next
release in Summer 2023.
class
argument in
all of the data download functions: get_layer()
and all of
the wrapper shortcuts such as bc_bound()
,
census_tract()
, etc. This argument will be removed in the
next version of bcmaps
as these functions will only return
sf
objects.Spatial
method of
transform_bc_albers()
is deprecated.fix_geo_problems()
is deprecated and will be removed
completely in Summersf
objects simply use
sf::st_make_valid()
self_union()
is deprecated and will be removed in
Summer 2023. Use raster::union()
for
SpatialPolygonsDataFrame
s, or sf::st_union()
with sf
objects instead.get_poly_attribute()
is deprecated because it had a
very niche application for calculating attributes on a
SpatialPolygonsDataFrame
, which we are removing support
for. It will be removed completely in Summer 2023.bec
and tsa
layers are now downloaded
directly from the BC Data Catalogue. This ensures that these are
up-to-date and means that we do not rely on the manual updating of these
layers at https://github.com/bcgov/bcmapsdata. (#62, #115)bcmapsdata
package has been removed.sf
or Spatial
) returned are topologically
valid and in the standard CRS of “EPSG:3005” (BC Albers). #96cded
files.show_cached_files()
to show the
files that you have cached (and how much space they’re taking up on your
computer). (#92, #93)tools::R_user_dir("bcmaps", "cache")
to determine the cache
directory, while when R version is < 4.0, it will use
rappdirs::user_cache_dir("bcmaps")
. This is to align with
CRAN’s storage policy using the tools
approach while
maintaining backwards compatibility with older R versions. Unfortunately
this will require users who updated to version 1.0 to re-download layers
because we are caching layers in a different location on your file
system from that version. Users wishing to clear the old cache location
could run bcmaps::delete_cache()
before updating to bcmaps
1.0.1. (#83)cded_raster
and cded_stars
directly
accepts a bounding box generated by sf::st_bbox
as an aoi.
(#87)mapsheets_50K()
, mapsheets_250K()
) would not
work if sf
was linked to older GDAL/PROJ libraries due to
different formats of coordinate reference systems. (#85)census_dissemination_area()
,
census_metropolitan_area()
, census_tract()
(#82).available_layers
bc_neighbours
previously used data from Natural
Earth. The availability of a Hi-Res B.C. boundaries over WFS from the
B.C. Data Catalogue means that the layer can now be created directly by
{bcmaps}.fsa
), health boundaries
(health_*
) and some census boundaries
(census_*
).stars
or
raster
objects (#73)raster_by_poly()
&
summarize_raster_list()
) is now reliant on users setting up
their own future::plan()
to specify strategy and number of
workers, rather than setting defaults (this is the best practice
according to the author of the future package @HenrikBengtsson, #69)fix_geo_problems()
would fail
depending on the version of GEOS
upon which sf
was built.raster_by_poly()
fails informatively when there are
NA
values in the column on which the polygons are to be
split (#48, thanks @j-galloway)raster_by_poly()
(and
summarize_raster_list()
) now uses the future.apply
package for parallelism, enabling easy parallelization across platforms
(#49)get_layer()
(and in turn, any of the individual layer
functions) now sets the crs
so the crs
representation will always be up to date with the user’s sf
version (#51, https://github.com/r-spatial/sf/issues/1225)bc_neighbours()
function to call layers
containing adjacent jurisdictions.geometry
column in all layers is
consistently named "geometry"
(Thanks @boshek)bc_bbox()
to get a bounding box for British
Columbia (#40).bcmapsdata
because of this R bug
(https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17520)self_union()
would fail due to a
change in the raster
package (30cef3438)available_layers()
has changed:
shortcut_function
column is now logical, uses better column
names, and has a custom print function that gives more information.
(#34)combine_nr_rd()
function from
regional_districts()
and municipalities()
.
This function combines Regional Districts with the Northern Rockies
Regional Municipalities to create a full provincial layer of
‘Regional-District-like’ polygons.available_layers()
bec
(and other large downloadable layers) show up in
the output of available_layers()
, bec()
works,
and get_layer("bec")
works so that getting downloadable
datasets is indistinguishable from getting local datasets. (#32)sf
functions that have been
moved to the lwgeom
package. They now use the
lwgeom
function (Fixes CRAN CHECK NOTE; #33).bc_cities()
which is a point layer of
B.C.’s major cities.raster_by_poly
to overlay a
SpatialPolygonsDataFrmae or sf polygons layer on a raster layer and clip
the raster to each polygon, and summarize_raster_list
to
summarize the results of raster_to_poly
get_layer()
now only accepts characters (#31)check_write_to_data_dir
where it was not
creating data directorybec()
, which uses the new function
get_big_data()
(#28).bec_colours()
(and alias
bec_colors()
) to generate a vector of colours that match
the standard colours used to colour Biogeoclimatic Zone maps.getNamespaceExports("bcmaps")
so that you can call layers
without loading the package via bcmaps::
watersheds
layer from packageecosections
to packageThis is a major new release with breaking changes.
All data has been removed from the bcmaps
package and
moved to the bcmaps.rdata
package, which is hosted on the
bcgov drat repository: https://github.com/bcgov/drat. That package must
be installed in order for bcmaps
to access the data. It can
be installed with:
install.packages('bcmaps.rdata', repos='https://bcgov.github.io/drat/')
In previous versions of bcmaps
, data was stored in the
package and loaded by calling data("layername")
or simply
layername
(e.g., data("bc_bound")
or
bc_bound
).
Now loading data requires a function call - either using a shortcut
function that is the same name as the dataset (e.g.,
bc_bound()
whereas previously one would simply use
bc_bound
). Alternatively, one can use the
get_layer()
function (e.g.,
get_layer("bc_bound")
).
Another major change is that all the layers are now returned as
sf
classes by default, rather than Spatial
classes. Spatial
versions of the data can still be obtained
by setting the class
argument to "sp"
in
get_layer()
and the shortcut functions (E.g.,
bc_bound(class = "sp")
or
get_layer("bc_bound", class = "sp")
).
wsc_drainages
hydrozones
dataset.bc_bound_hres
and
airzones
(#13)water_districts
and water_precincts
datasets.gw_aquifers
dataset.tries
argument to fix_geo_problems
function to set the maximum number of iterations it should go through in
attempting to repair topological issues.watercourses_15M
and
watercourses_5M
datasets to UTF-8.watercourses_15M
and watercourses_5M
datasets.fix_geo_problems
and transform_bc_albers
are Generic functions with methods for sf
objects as well
as Spatial
objectsfix_self_intersect
is now defunctfix_self_intersect
has been renamed to
fix_geo_problems
(but kept as an alias for now)fix_geo_problems
can often also fix orphaned holes in
addition to self-intersections.watersheds
dataset (#15, @markjohnsonubc)NEWS.md
file to track changes to the
package.Added two new functions to create and work with SpatailPolygonsDataFrames with nested data frames:
self_union
performs a union on a single
SpatialPolygons*
object to take into account overlaps.
Polygon attributes are combined in a nested dataframe.get_poly_attribute
allows you to easily parse a nested
data frame column (created by self_union
) to extract or
calculate the attributes you wantAdded a couple of convenience functions:
transform_bc_albers()
transforms a Spatial object to BC
Albers projectionfix_self_intersect()
checks for and repairs
self-intersecting polygonsAdded 3 Natural Resource layers (areas, regions and districts)
Added high resolution BC boundaries (bc_bound_hres
)
Added bc_area
function