Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. paste (shpPath, "/", layers, "_WGS84.shp", sep = "")
  2.  
  3. uploadShpfile <- reactive({
  4. if (!is.null(input$zip)) {
  5. zipFile <- input$zip
  6. zipPath <- substr(zipFile$datapath, 1, nchar(zipFile$datapath) - 5)
  7. unzip(zipFile$datapath, exdir = zipPath)
  8. pwd <- getwd()
  9. updir <- dirname(zipFile$datapath[1])
  10. setwd(updir)
  11. for (i in 1:nrow(zipFile)) {
  12. file.rename(zipFile$datapath[i], zipFile$name[i])
  13. }
  14. shpName <- zipFile$name[grep(x = zipFile$name, pattern = "*.shp")]
  15. shpPath <- paste(updir, shpName, sep = "/")
  16. setwd(updir)
  17. Layers <- ogrListLayers(shpPath)
  18. shpName <- readOGR(shpPath)
  19. shpName <- spTransform(shpName,CRS("+proj=longlat +datum=WGS84"))
  20. shapefile(shpName, paste(shpPath, "/", Layers, "_WGS84.shp", sep = ""))
  21. shpName
  22. }
  23. })
  24.  
  25. observeEvent(input$send, {
  26. x <- 'blabla.sh /blabla/blabla.shp input$indice input$dates[1] input$dates[2]'
  27. system(x)
  28. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement