sl.lonlat.identical: Check if Lon-Lat Vectors Share Elements

sl.lonlat.identicalR Documentation

Check if Lon-Lat Vectors Share Elements

Description

Check if two pairs of longitude and latitude vectors have identical element pairs. Note that the comparison is done element-wise: if identical coordinates are contained but at different positions in the vector pairs, that's not identified.

Usage

sl.lonlat.identical(lon1, lat1, lon2, lat2, recycle = FALSE, tolerance = 0)

Arguments

lon1

a vector giving the longitudes of the first set of points.

lat1

a vector giving the latitudes of the first set of points.

lon2

a vector giving the longitudes of the second set of points.

lat2

a vector giving the latitudes of the second set of points.

recycle

a logical value indicating whether the coordinate vectors shall be recycled if they are shorter than the longest one of them.

tolerance

a scalar giving the numerical tolerance, that is, by how much coordinates may differ to be counted as 'identical' (in degrees, applied separately to the longitudes and the latitudes).

Value

A vector with logical values indicating at which positions points are identical (or closer than the tolerance).

Note

This function is used in sl.plot.polygon.

Author(s)

Helge Goessling

Examples

sl.lonlat.identical(lon1=1:5,lat1=rep(10,5),lon2=rep(4,5),lat2=13:9)
## Should return:
## [1] FALSE FALSE FALSE  TRUE FALSE

helgegoessling/spheRlab documentation built on April 8, 2024, 8:34 a.m.