Skip to content

Commit

Permalink
text
Browse files Browse the repository at this point in the history
  • Loading branch information
reedalexandria committed Jun 21, 2023
1 parent cd9730a commit e2960df
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 46 deletions.
Binary file modified .DS_Store
Binary file not shown.
42 changes: 2 additions & 40 deletions pyforest-dashboard/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,12 @@ library(rsconnect)
library(fresh)
library(DT)
library(shinythemes)
# library(shiny.slider) #Didn't load (?)


# READ IN DATA ----

#make sure you cd into pyforest-dashboard

## ------------------------------------------land use assessment data ------------------------------------------
#tsosie
# Unauthorized deforestation
# combined_illegal_df_by_dist <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_illegal_df_by_dist.rds")
# combined_illegal_df_by_dist$normalized_value <- combined_illegal_df_by_dist$sum_df_ha / combined_illegal_df_by_dist$total_area_ha
# combined_illegal_df_by_dpto <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_illegal_df_by_dpto.rds")
# combined_illegal_df_by_dpto$normalized_value <- combined_illegal_df_by_dpto$sum_df_ha / combined_illegal_df_by_dpto$total_area_ha

## Authorized deforestation
# combined_auth_df_by_dist <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_auth_df_by_dist.rds")
# combined_auth_df_by_dist$normalized_value <- combined_auth_df_by_dist$sum_df_ha / combined_auth_df_by_dist$total_area_ha
# combined_auth_df_by_dpto <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_auth_df_by_dpto.rds")
# combined_auth_df_by_dpto$normalized_value <- combined_auth_df_by_dpto$sum_df_ha / combined_auth_df_by_dpto$total_area_ha
#make sure you change directory to pyforest-dashboard


#local data
## ------------------------------------------land use plan assessment data ------------------------------------------
# Unauthorized deforestation
combined_illegal_df_by_dist <- st_read("data/combined_illegal_df_by_dist.gpkg")
combined_illegal_df_by_dist$normalized_value <- combined_illegal_df_by_dist$sum_df_ha / combined_illegal_df_by_dist$total_area_ha
Expand All @@ -75,7 +58,6 @@ combined_illegal_df_by_dpto <- st_read("data/combined_illegal_df_by_dpto.gpkg")
combined_illegal_df_by_dpto$normalized_value <- combined_illegal_df_by_dpto$sum_df_ha / combined_illegal_df_by_dpto$total_area_ha
combined_illegal_df_by_dpto$year_range <- gsub("_", "-", combined_illegal_df_by_dpto$year_range)


# Authorized deforestation
combined_auth_df_by_dist <- st_read("data/combined_auth_df_by_dist.gpkg")
combined_auth_df_by_dist$normalized_value <- combined_auth_df_by_dist$sum_df_ha / combined_auth_df_by_dist$total_area_ha
Expand All @@ -86,36 +68,16 @@ combined_auth_df_by_dpto$normalized_value <- combined_auth_df_by_dpto$sum_df_ha
combined_auth_df_by_dpto$year_range <- gsub("_", "-", combined_auth_df_by_dpto$year_range)

## ------------------------------------------ land use assessment sub tab ------------------------------------------
# #tsosie
# compliance <- st_read("~/../../capstone/pyforest/shinydata/lup_assessment/compliance_updated.gpkg")
# compliance <- st_transform(compliance, 4326)

#local data
compliance <- st_read("data/compliance_updated.gpkg")
compliance <- st_transform(compliance, 4326)

## ------------------------------------------ deforestation and forest cover statistics data ------------------------------------------
# #tsosie
# datadir <- path.expand("~/../../capstone/pyforest")
# py_fl_dept <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/department_forest_loss.gpkg"))
# py_fl_dist <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/district_forest_loss.gpkg"))
# chaco_fl <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/chaco_forest_loss.gpkg"))
# chaco_fc <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/chaco_forest_cover.gpkg"))

#local data
py_fl_dept <- read_sf("data/department_forest_loss.gpkg")
py_fl_dist <- read_sf("data/district_forest_loss.gpkg")
chaco_fl <- read_sf("data/chaco_forest_loss.gpkg")
chaco_fc <- read_sf("data/chaco_forest_cover.gpkg")


#tsosie
# # Source in normalized deforestation data values
# source(here::here("pyforest-dashboard/R/forest_loss_standardizing_for_visuals.R"))
# py_fc_dept <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/department_forest_cover.gpkg"))
# py_fc_dist <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/district_forest_cover.gpkg"))

#local data
source("R/forest_loss_standardizing_for_visuals.R")
py_fc_dept <- read_sf("data/department_forest_cover.gpkg")
py_fc_dist <- read_sf("data/district_forest_cover.gpkg")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ account: hendatasrl
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 9275632
bundleId: 7326646
bundleId: 7367125
url: https://hendatasrl.shinyapps.io/pyforest-dashboard/
when: 1686349009.60165
lastSyncTime: 1686349009.60168
when: 1687272194.96148
lastSyncTime: 1687272194.96149
asMultiple: FALSE
asStatic: FALSE
3 changes: 2 additions & 1 deletion pyforest-dashboard/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,13 @@ server <- function(input, output, session) {
content = function(file) {
tempReport <- file.path(tempdir(), "report.Rmd")
file.copy("report.Rmd", tempReport, overwrite = TRUE)

rmarkdown::render(tempReport, output_file = file,
params = list(data = compliance_filter(),
map = compliance_map(),
table = compliance_table()))
}

) # END PUT ID


Expand Down
2 changes: 1 addition & 1 deletion pyforest-dashboard/text/data_source.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The data used in this app is sourced from the National Forestry Institute of Paraguay (INFONA). INFONA provides land use plan shapefiles and deforestation raster files, which serve as the foundation for our analysis. For the most up-to-date data, we recommend visiting [INFONA's official website](https://www.infona.gov.py/) and submitting a request for the desired information. To access our results data, please visit our [Zenodo repository](https://zenodo.org/communities/pyforest/).
The data used in this app is sourced from the National Forestry Institute of Paraguay (INFONA). INFONA provided land use plan shapefiles and deforestation raster files, which serve as the foundation for our analysis. For the most up-to-date data, we recommend visiting [INFONA's official website](https://www.infona.gov.py/) and submitting a request for the desired information. To access our results data, please visit our [Zenodo repository](https://zenodo.org/communities/pyforest/).

3 changes: 2 additions & 1 deletion pyforest-dashboard/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,8 @@ tabItem(tabName = "put_id",
style = "max-height: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center;",
uiOutput("maps_predictions_by_scenario")
)
)
),
downloadButton("downloadBtn", "Download Image") # Add download button
)
),
column(width = 8,
Expand Down

0 comments on commit e2960df

Please sign in to comment.