Skip to content

Commit

Permalink
self repair in dem_download_big_area_rgugik
Browse files Browse the repository at this point in the history
  • Loading branch information
j-miszczyszyn committed Feb 18, 2024
1 parent 82654bf commit f0cef35
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 63 deletions.
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Package: foRestools
Title: Tools for foresters
Version: 1.0.1

Authors@R:
person("First", "Last", , "[email protected]", role = c("cre","aut"),
Authors@R: person("First", "Last", , "[email protected]", role = c("cre","aut"),
comment = c(ORCID = "0009-0002-8592-946X"))
Description: Calculate vegetation indices and generate statistics and charts for user defined districts
License: MIT + file LICENSE
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ export(define_nir)
export(define_red)
export(define_rededge)
export(define_yellow)
export(dem_download_big_area_rgugik)
export(ortho_download_big_area_rgugik)
importFrom(lifecycle,deprecated)
28 changes: 9 additions & 19 deletions R/dem_download_big_area_rgugik.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@

#' Title
#'
#' @param x - path to your shapefile
#' @param y - integer of length 1 or 2, number of grid cells in x and y direction (columns, rows)
#'
#' @return
#' @export
#'
#' @examples
dem_download_big_area_rgugik=function(x,y){
aoi=sf::st_read(x)
grid=sf::st_make_grid(aoi, n=y)
aoi=sf::st_intersection(aoi,grid)
dem_download_big_area_rgugik <- function(x, y) {
aoi <- sf::st_read(x)
grid <- sf::st_make_grid(aoi, n = y)
aoi <- sf::st_intersection(aoi, grid)
plot(aoi)
result=data_frame()
for (i in 1:length(aoi$geometry)) {
req_df=rgugik::DEM_request(aoi[i,])
result=dplyr::bind_rows(req_df, result)
result <- tibble::tibble()
for (i in seq_len(nrow(aoi))) {
req_df <- rgugik::DEM_request(aoi[i, ])
result <- dplyr::bind_rows(result, req_df)
}
return(result)
print("This tools is based on https://github.com/kadyb/rgugik")
return(result)
}
23 changes: 11 additions & 12 deletions R/ortho_download_big_area_rgugik.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@

#' Title
#'
#' @param x - path to your shapefile
#' @param y - integer of length 1 or 2, number of grid cells in x and y direction (columns, rows)
#' @param x
#' @param y
#'
#' @return
#' @export
#'
#' @examples
ortho_download_big_area_rgugik=function(x,y){
aoi=sf::st_read(x)
grid=sf::st_make_grid(aoi, n=y)
aoi=sf::st_intersection(aoi,grid)
ortho_download_big_area_rgugik <- function(x, y) {
aoi <- sf::st_read(x)
grid <- sf::st_make_grid(aoi, n = y)
aoi <- sf::st_intersection(aoi, grid)
plot(aoi)
result=data_frame()
for (i in 1:length(aoi$geometry)) {
req_df=rgugik::ortho_request(aoi[i,])
result=dplyr::bind_rows(req_df, result)
result <- tibble::tibble()
for (i in seq_len(nrow(aoi))) {
req_df <- rgugik::ortho_request(aoi[i, ])
result <- dplyr::bind_rows(result, req_df)
}
return(result)
print("This tools is based on https://github.com/kadyb/rgugik")
return(result)
}
20 changes: 0 additions & 20 deletions man/dem_download_big_area_rgugik.Rd

This file was deleted.

8 changes: 1 addition & 7 deletions man/ortho_download_big_area_rgugik.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0cef35

Please sign in to comment.