How can I determine whether a coordinate is above land or ocean with a confidence metric in R?
I've used the sf package method described in another question: Given Lat and Lon identify if point over land or ocean using R
#Obtain latitude and logitude values.
lat <- filtered.records.coord$lat
lon <- filtered.records.coord$lon
#Place the values into a data frame.
points <- data.frame("Var1" = lon, "Var2" = lat)
#Find which points fall over land
pts <- st_as_sf(points, coords=1:2, crs=4326)
ii <- !is.na(as.numeric(st_intersects(pts, world)))
#Combine GPS results with record information.
filtered.records.coord$land <- ii
However, is there a way to determine if a coordinate is by the coastline for example and not far inland? Or some sort of confidence to the TRUE or FALSE offered by the sf package? I wish to identify borderline points.