Hi there.
I have an app that reads geotiff files (.tif) and renders a map.
The rgdal() package does the geotiff file' reading and my app works locally like a charm.
BUT when my app is deployed on the shinyapps.io' server, the rgdal() package is unable to read the geotiff file.
From the admin dashboard, the logs is the following :
Warning: Error in .local: An error occurred while creating a virtual connection to the DAP server:
Error while reading the URL: > Blockquote http://static.ligair.fr/Public/communication/Datavisionair/Region/CarteRegionale_IQA_j1.tif.ver.
The OPeNDAP server returned the following message:
Not Found: The data source or server could not be found.
Often this means that the OPeNDAP server is missing or needs attention; Please contact the server administrator.
After many weeks of attemps and research I was unabled to fix it or at least find a workaround.
Any help will be very much appreciated.
Many thanks.
Here the reprex
library(shiny)
library(shinydashboard)
library(rgdal)
body <- dashboardBody(
box(width=6, title="Reading geotif file with readLines()", solidHeader = FALSE, collapsible = FALSE,
h4("OK"),
textOutput('readFile')
),
box(width=6, title="Retrieve info from geotif file with GDALinfo()", solidHeader = FALSE, collapsible = FALSE,
h4("Failed"),
verbatimTextOutput ('infoTif')
)
)
ui <- dashboardPage(header=dashboardHeader(), sidebar=dashboardSidebar(), body)
server <- function(input, output, session) {
# READ GEOTIF FILE
geotif_file <- "http://static.ligair.fr/Public/communication/Datavisionair/Region/CarteRegionale_IQA_j1.tif"
output$readFile <- renderText(readLines(geotif_file)[1:10])
# RETRIEVE INFO FROM TIF
output$infoTif <- renderPrint(GDALinfo(geotif_file))
}
# Run the application
shinyApp(ui = ui, server = server)