# output$downloadData <- downloadHandler(
#
# filename = function(file) { paste('ShapeFile','.shp', sep='') },
# content = function(file) {
#
# writeOGR(SHP, dsn="DownloadShapes", driver="ESRI Shapefile", layer="XY_Shapefile")})
output$downloadShp <- downloadHandler(
filename = 'fbCrawlExport.zip',
content = function(file) {
if (length(Sys.glob("fbCrawl.*"))>0){
file.remove(Sys.glob("fbCrawl.*"))
}
writeOGR(SHP, dsn="fbCrawl.shp", layer="fbCrawl", driver="ESRI Shapefile")
write.csv(as.data.frame(cbind(SHP@data, as.data.frame(SHP@coords))), "fbCrawl.csv")
zip(zipfile='fbCrawlExport.zip', files=Sys.glob("fbCrawl.*"))
file.copy("fbCrawlExport.zip", file)
if (length(Sys.glob("fbCrawl.*"))>0){
file.remove(Sys.glob("fbCrawl.*"))
}
}
)
})
}
))