|
@@ -10,13 +10,13 @@
|
|
|
#' @keywords maa-amet, ortofoto
|
|
#' @keywords maa-amet, ortofoto
|
|
|
#' @export
|
|
#' @export
|
|
|
#' @examples
|
|
#' @examples
|
|
|
-#' ## Not run:
|
|
|
|
|
-#' ##
|
|
|
|
|
-#' ## maaamet_ortofotod()
|
|
|
|
|
-#' ##
|
|
|
|
|
-#' ## End(**Not run**)
|
|
|
|
|
|
|
+#' \dontrun{
|
|
|
|
|
+#'
|
|
|
|
|
+#' conf <- ruut::get_config()
|
|
|
|
|
+#' maaamet_ortofotod(epk10t = 54711, dir = "~/ortofotod", conf = conf)
|
|
|
|
|
+#' }
|
|
|
maaamet_ortofotod <- function(epk10t = NULL, dir = "~/ortofotod", conf = NULL) {
|
|
maaamet_ortofotod <- function(epk10t = NULL, dir = "~/ortofotod", conf = NULL) {
|
|
|
- # epk10t <- 54711
|
|
|
|
|
|
|
+ # epk10t <- 54711; epk10t <- 65813
|
|
|
# epk10t numbri õigsuse kontroll
|
|
# epk10t numbri õigsuse kontroll
|
|
|
epk10t_all <- utils::read.csv(file = system.file("csv", "epk10t.csv", package = "estmap"), header = T)[, "nr"]
|
|
epk10t_all <- utils::read.csv(file = system.file("csv", "epk10t.csv", package = "estmap"), header = T)[, "nr"]
|
|
|
if (!epk10t %in% epk10t_all) {
|
|
if (!epk10t %in% epk10t_all) {
|
|
@@ -44,7 +44,7 @@ maaamet_ortofotod <- function(epk10t = NULL, dir = "~/ortofotod", conf = NULL) {
|
|
|
url_new <- urltools::param_set(url_source, key = "kaardiruut", value = epk10t)
|
|
url_new <- urltools::param_set(url_source, key = "kaardiruut", value = epk10t)
|
|
|
## Allalaadimine
|
|
## Allalaadimine
|
|
|
html_file <- readLines(url_new)
|
|
html_file <- readLines(url_new)
|
|
|
- page <- xml2::read_html(html_file)
|
|
|
|
|
|
|
+ page <- xml2::read_html(html_file[1])
|
|
|
website <- ""
|
|
website <- ""
|
|
|
website <- page %>%
|
|
website <- page %>%
|
|
|
rvest::html_nodes("li a") %>%
|
|
rvest::html_nodes("li a") %>%
|