Learn R Programming

rangeBuilder (version 1.6)

filterByLand: Filter occurrences based on land vs ocean

Description

Identifies occurrence records that do not occur on land.

Usage

filterByLand(coords, proj = "+proj=longlat +datum=WGS84")

Value

returns a logical vector where TRUE means the point falls on land.

Arguments

coords

coordinates in the form of a 2 column numeric matrix, data.frame, numeric vector, or SpatialPoints object. If Spatial object, proj4string must be specified.

proj

proj4string of input coords. Ignored if input coords are spatial object.

Author

Pascal Title

Details

This function uses a rasterized version of the GSHHG (global self-consistent, hierarchical, high-resolution geography database, https://www.soest.hawaii.edu/pwessel/gshhg/), that has been buffered by 2 km.

Examples

Run this code

data(crotalus)

#identify points that fall off land
filterByLand(crotalus[,c('decimallongitude','decimallatitude')])

Run the code above in your browser using DataLab