Skip to content

Instantly share code, notes, and snippets.

@pumphandle
Created July 12, 2019 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pumphandle/0abfa2c1739a64af909af781320c1a74 to your computer and use it in GitHub Desktop.
Save pumphandle/0abfa2c1739a64af909af781320c1a74 to your computer and use it in GitHub Desktop.
Finds distance to nearest shoreline in the continental US
library(rgdal)
library(geosphere)
coast <- readOGR(dsn="shapefile path", layer="us_medium_shoreline")
dist2Line(c(-85,32),coast,distfun=distGeo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment