Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. VillageName1, VillageName2
  2. Village1, Village2
  3. Village1, Village3
  4. Village1, Village4
  5. ...
  6. Village2379, Village2378
  7.  
  8. sea <- readOGR('World_EEZ_v8_2014.shp')
  9. ocean_indo_shapefile <- sea[sea$Country == "Indonesia", ]
  10.  
  11. #this function creates the points from Village1 to Village2 in 100m intevals, output is a dataframe
  12. points <- create_coordinates(village1_lat, village1_long, village2_lat, village2_long, 0.1)
  13.  
  14. coordinates(points) <- ~ Longitude + Latitude
  15. proj4string(points) <- proj4string(ocean_indo_shapefile)
  16. #the calculation below is slow
  17. water_in_meter <- length(points[ocean_indo_shapefile,])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement