Skip to content

Commit

Permalink
Support for downloading from GUGIK with rgugik package
Browse files Browse the repository at this point in the history
  • Loading branch information
j-miszczyszyn committed Feb 18, 2024
1 parent 6efae68 commit 6088ec9
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export(define_nir)
export(define_red)
export(define_rededge)
export(define_yellow)
export(dem_download_big_area_rgugik)
export(ortho_download_big_area_rgugik)
23 changes: 23 additions & 0 deletions R/dem_download_big_area_rgugik.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

#' 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)
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)
}
return(result)
print("This tools is based on https://github.com/kadyb/rgugik")
}
20 changes: 20 additions & 0 deletions man/dem_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 6088ec9

Please sign in to comment.