Created
August 4, 2023 17:42
-
-
Save MathewBiddle/5c2ef3272d92cc2af64fe92708b0afc9 to your computer and use it in GitHub Desktop.
Search MarineGazetteer for polygon overlap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
Righteous. Thanks for sharing!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://lifewatch.github.io/mregions2/articles/mregions2.html