-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d2964
commit 9887a92
Showing
4 changed files
with
61 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# long-term cache | ||
|
||
library(httr) | ||
am <- 'https://github.com/ipeaGIT/geobr/releases/download/v1.7.0/amazonia_legal.gpkg' | ||
as <- 'https://github.com/ipeaGIT/geobr/releases/download/v1.7.0/amazonia_legal_simplified.gpkg' | ||
|
||
|
||
|
||
eee <- HEAD(url = am) | ||
eee$headers$etag | ||
eee$all_headers | ||
|
||
HEAD(url = am)$headers$etag | ||
|
||
# get all etags for metadata table | ||
aaa <- lapply(X = c(am, as), FUN = function(x){HEAD(url = x)$headers$etag}) | ||
unlist(aaa) | ||
|
||
|
||
f <- 'C:/Users/user/Downloads/amazonia_legal (2).gpkg' | ||
|
||
file.info(f)$ctime | ||
|
||
fff <- HEAD(url = f) | ||
|
||
|
||
|
||
#' metadata table should have url and etag | ||
|
||
#' DOWNLOAD fun | ||
#' 1)if etag is not saved locally, | ||
#' download fun should save etag locally and download data | ||
#' if etag and data exists locally, then compare against metadata | ||
# |