Skip to content

Instantly share code, notes, and snippets.

@MathewBiddle
Created August 4, 2023 17:42
Show Gist options
  • Save MathewBiddle/5c2ef3272d92cc2af64fe92708b0afc9 to your computer and use it in GitHub Desktop.
Save MathewBiddle/5c2ef3272d92cc2af64fe92708b0afc9 to your computer and use it in GitHub Desktop.
Search MarineGazetteer for polygon overlap
library(sf)
library(dplyr)
#get WKT
bb_points <- event %>%
st_as_sf(coords = c("decimalLongitude", "decimalLatitude"),
crs = "WGS84") %>%
st_bbox() %>%
st_as_sfc() %>%
st_cast(to = "POINT")
lapply(bb_points, mregions2::gaz_search) %>%
data.table::rbindlist() %>%
distinct() %>%
filter(preferredGazetteerNameLang =="English" & status == "standard")
@sformel-usgs
Copy link

Righteous. Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment