Skip to content

Commit

Permalink
fix shapefile export
Browse files Browse the repository at this point in the history
  • Loading branch information
dindiarto committed Aug 6, 2024
1 parent c805195 commit aaad602
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ Imports:
tidyselect,
shinycssloaders,
leaflet,
htmltools
htmltools,
zip,
utils
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map_chr)
importFrom(readr,read_csv)
importFrom(readr,write_csv)
importFrom(rlang,.data)
importFrom(sf,st_as_sf)
importFrom(sf,st_as_sfc)
Expand Down Expand Up @@ -132,4 +133,4 @@ importFrom(tidyr,unnest_longer)
importFrom(tidyr,unnest_wider)
importFrom(tidyselect,all_of)
importFrom(tools,file_ext)
importFrom(utils,zip)
importFrom(zip,zip)
5 changes: 3 additions & 2 deletions R/sm_suitability_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#' @importFrom sf write_sf st_as_sfc st_bbox
#' @importFrom terra writeRaster
#' @importFrom shinycssloaders withSpinner
#' @importFrom utils zip
#' @importFrom htmltools h2 h4 p
#'
#' @export
Expand Down Expand Up @@ -51,6 +50,8 @@ suitabilityAnalysisUI <- function(id) {
#' @rdname suitabilityAnalysisUI
#' @importFrom dplyr left_join mutate case_when
#' @importFrom leaflet colorFactor
#' @importFrom zip zip
#' @importFrom readr write_csv
#'
#' @export
suitabilityAnalysisServer <- function(id, submittedData) {
Expand Down Expand Up @@ -240,7 +241,7 @@ suitabilityAnalysisServer <- function(id, submittedData) {
append = FALSE)
shp_files <- list.files(path = tempdir, pattern = "suitability_map", full.names = TRUE)
# Zip the temporary directory and write it to the specified file
zip(file,files=shp_files)
zip::zipr(file,files=shp_files, include_directories=FALSE)
}
)

Expand Down

0 comments on commit aaad602

Please sign in to comment.