Handles the data frame returned by shiny::fileInput(), including
multi-file uploads of shapefile sidecars (.shp, .dbf, .shx, .prj)
and zipped archives containing any supported format. When upload is
NULL or empty the function returns NULL so callers can fall back to
demo data.
Arguments
- upload
The value of
input$<id>from ashiny::fileInput()widget. Each row is one uploaded file withnameanddatapathcolumns. WhenNULLor a zero-row data frame, returnsNULL.
Examples
# Typical Shiny server usage:
if(interactive()){
observeEvent(input$spatial_upload, {
x <- read_dragmapr_sf_upload(input$spatial_upload)
if (!is.null(x)) {
state$source <- x
}
})
}
