Guest User

Untitled

a guest
Oct 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. setwd("~/R/maps")
  2. ukgrid = "+init=epsg:27700"
  3. latlong = "+init=epsg:4326"
  4. holes <- read.csv("Pothole_Enquiries_2016.csv", header = TRUE)
  5. map <- readRDS("GBR_adm2.rds")
  6. plot(map, col = 'grey', border = 'darkgrey')
  7. holes <- subset(holes, select = c("EASTING","NORTHING"))
  8. holes$holes_ID <- 1:nrow(holes)
  9. coords <- cbind(EASTING = as.numeric(as.character(holes$EASTING)),NORTHING = as.numeric(as.character(holes$NORTHING)))
  10. holes_SP <- SpatialPointsDataFrame(coords, data = data.frame(holes$holes_ID), proj4string = CRS("+init=epsg:27700")
  11. holes_SP_LL <- spTransform(holes_SP, CRS(latlong))
  12. points(holes_SP_LL,col=2,pch=18)
Add Comment
Please, Sign In to add comment