Skip to contents

RhumbLine: loxodrome distance R sqrt(dphi^2 + q^2 dlambda^2) and bearing atan2(dlambda, dpsi) the short way round (as geosphere::distRhumb; method = "geosphere" copies bearingRhumb's double wrap across the antimeridian). GeodeticToEcef and EcefToGeodetic: ellipsoidal conversions (IOGP guidance note 7-2). HelmertTransform: seven-parameter similarity transformation (position-vector or coordinate-frame). BlockCvFolds: blocks of an nx x ny grid shuffled by a Philox permutation and dealt to k folds. KmeansCvFolds: folds from Lloyd's k-means with k-means++ seeding. TemporalStratifiedSample: proportional allocation with largest remainders and Philox simple random samples per period. NestedGrid: quadtree cell indices per level. Indices and folds are 0-based, as the Python arm.

Usage

RhumbLine(lat1, lon1, lat2, lon2, radius = 6378137, method = "shortest")

GeodeticToEcef(lat, lon, h, ellipsoid = "WGS84")

EcefToGeodetic(X, Y, Z, ellipsoid = "WGS84", tol = 1e-14)

HelmertTransform(
  xyz,
  tx,
  ty,
  tz,
  rx,
  ry,
  rz,
  ds_ppm,
  convention = "position_vector"
)

BlockCvFolds(coords, nx, ny, k, seed = 0)

KmeansCvFolds(coords, k, max_iter = 100, seed = 0)

TemporalStratifiedSample(times, n_sample, n_strata = 4, seed = 0)

NestedGrid(coords, levels, bbox = NULL)

Arguments

lat1, lon1, lat2, lon2

End points (degrees).

radius

Sphere radius (m).

method

"shortest" or "geosphere".

lat, lon, h

Geodetic latitude, longitude (degrees) and height.

ellipsoid

Name ("WGS84", "GRS80", "WGS72", "Clarke1866", "Airy1830", "Intl1924") or c(a, f).

X, Y, Z

ECEF coordinates.

tol

Iteration tolerance.

xyz

ECEF coordinate vector.

tx, ty, tz

Translations (m).

rx, ry, rz

Rotations (arc-seconds).

ds_ppm

Scale change (ppm).

convention

"position_vector" or "coordinate_frame".

coords

Coordinate matrix.

nx, ny

Blocks along x and y.

k

Number of folds or clusters.

seed

Philox seed.

max_iter

Lloyd iterations.

times

Observation times.

n_sample

Sample size.

n_strata

Number of time strata.

levels

Number of quadtree levels.

bbox

Bounding box c(x0, x1, y0, y1), or NULL.

Value

A list or numeric vector.

References

IOGP (2019). Geomatics Guidance Note 7-2. Roberts, D. R. et al. (2017). Ecography 40, 913-929. Brenning, A. (2012). IGARSS 2012, 5372-5375. Cochran, W. G. (1977). Sampling Techniques. Samet, H. (1984). ACM Computing Surveys 16, 187-260.

Examples

RhumbLine(0, 0, 0, 1)
#> $distance
#> [1] 111319.5
#> 
#> $bearing
#> [1] 90
#> 
HelmertTransform(c(3657660.66, 255768.55, 5201382.11), 0, 0, 4.5, 0, 0, 0.554, 0.219)
#> [1] 3657660.8  255778.4 5201387.7