Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. ##BUILDINGS DATA
  2.  
  3. buildings_data<-readOGR("buildings.shp")
  4. buildings<- spTransform(buildings, CRS("+proj=utm +zone=45 +a=6377299.151
  5. +b=6356098.145120132
  6. +towgs84=295,736,257,0,0,0,0 +units=m +no_defs "))
  7.  
  8. ##LATITUDES/LONGITUDES DATA
  9.  
  10. locations<-read.csv("20190712033434-47083-data.csv")
  11.  
  12. locations <- SpatialPointsDataFrame(coords = locations, data = locations,
  13. proj4string =
  14. CRS("+proj=longlat +datum=WGS84"))
  15. locations<- spTransform(locations, CRS("+proj=utm +zone=45 +a=6377299.151
  16. +b=6356098.145120132
  17. +towgs84=295,736,257,0,0,0,0 +units=m +no_defs "))
  18.  
  19. minimum_distance<- apply(gDistance(locations, buildings,byid=TRUE),2,min)
  20.  
  21. Error in RGEOSDistanceFunc(spgeom1, spgeom2, byid, "rgeos_distance") :
  22. negative length vectors are not allowed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement