Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
boshek opened this issue Feb 2, 2022 · 0 comments
Open

Comments

@boshek
Copy link
Collaborator

boshek commented Feb 2, 2022

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant