jitter_latlong: Jitter latitude and longitude coordinates

View source: R/01-jitter-latlong.R

jitter_latlongR Documentation

Jitter latitude and longitude coordinates

Description

Given a latitude or longitude coordinate, return that coordinate jittered plus or minus a certain maximum amount. This function assumes a spherical earth when calculating the maximum amount to jitter.

Usage

jitter_latlong(coord, type = c("lat", "long"), latitude, km = 1)

Arguments

coord

The coordinate in degrees

type

Whether the coordinate is latitude or longitude

latitude

If the coordinate is longitude, then the latitude to use for calculating the maximum amount to jitter.

km

The maximum number of kilometers to jitter a point plus or minus.

Value

The jittered coordinate in degrees.

See Also

length_of_degree

Examples

jitter_latlong(-73, type = "long", lat = 43, km = 1)
jitter_latlong(42, type = "lat", km = 1)

Pandora-IsoMemo/iso-app documentation built on Dec. 22, 2024, 7:57 a.m.