pointsOver | R Documentation |
To find the if points are within a polygon shapefile given a set of coordinates
pointsOver(
lon,
lat,
lands,
projection = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"
)
lon |
A numeric vector with longitude information. |
lat |
A numeric vector with latitude information. |
lands |
Layer from which the geometries or attributes are queried. This arguments allows 'SpatialPolygons' or 'SpatialPolygonsDataFrame' class objects. |
projection |
Character string describing a projection and datum in the PROJ.4 format. |
This function return 'TRUE' or 'FALSE' label based on whether the point is on land or not.
## Not run: # Create an artificial data set
x = data.table(lat=1:10, lon=1:10)
world = rnaturalearthdata::countries50
x$label = pointsOnLand(x$lon, x$lon, world)
head(x)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.