Skip to contents

Flags records outside the Natural Earth land polygons, by a planar point-in-polygon test in longitude and latitude through a grid index that resolves boundary cells exactly. The land layer is chosen with land_scale: 110 (default), 50, or 10. The 1:10 million layer is downloaded once by download_reference().

Usage

clean_sea(x, ...)

Arguments

x

A data frame of occurrence records.

...

Further arguments to flag_occurrences(): columns, reference, gazetteers, land_scale.

Value

clean_<test>(): the rows of x the test does not flag, with the columns of x unchanged. See keep_unflagged(), Cleaning functions.

Fields

lon, lat.

CoordinateCleaner

Equivalent to cc_sea() with its default scale = 110 (clean_coordinates() uses seas_scale = 50, which is land_scale = 50 here); identical flags on the same layer. CoordinateCleaner downloads the layer through rnaturalearth at run time; here it is bundled and pinned.

Custom gazetteer

gazetteers = list(sea = polygons), an sf or sfc object of land polygons; see flag_occurrences().

Examples

x <- data.frame(decimalLongitude = c(12.58, 16.37, -30), decimalLatitude = c(55.67, 48.21, 40))
flag_occurrences(x, tests = "sea")$flag_sea
flag_occurrences(x, tests = "sea", land_scale = 50)$flag_sea
clean_sea(x, land_scale = 50)