bcmaps icon indicating copy to clipboard operation
bcmaps copied to clipboard

Use modification date in record to know when to update cache layers.

Open boshek opened this issue 4 years ago • 0 comments

All the pieces are here just to stitch them together.

library(bcdata)
#> 
#> Attaching package: 'bcdata'
#> The following object is masked from 'package:stats':
#> 
#>     filter
library(bcmaps)
#> Loading required package: sf
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE

lyr <- bcmaps:::available_layers()
nd <- lyr[lyr$layer_name == "nr_districts", ]

rec <- bcdc_get_record(nd$record)
#> Authorizing with your stored API key
rec$record_last_modified
#> [1] "2022-01-07"

attributes(nr_districts())$time_downloaded
#> nr_districts was updated on 2021-01-22
#> [1] "2021-01-22 06:32:22 PST"

boshek avatar Feb 02 '22 00:02 boshek