define_legacy_grid: Define a floating grid coordinate reference system for a...

Description Usage Arguments Details Value Examples

View source: R/define_legacy_grid.R

Description

This function defines a floating grid coordinate reference system in the Oblique Mercator projection for a legacy (existing) floating grid based on the coordinates for a primary datum and a secondary point.

Usage

1
2
3
4
5
6
7
8
define_legacy_grid(
  pt_0_geo,
  pt_0_grid = c(0, 0),
  pt_1_geo,
  pt_1_grid,
  geo_crs = 4326,
  name = NULL
)

Arguments

pt_0_geo

A numeric vector of the geographic coordinates (c(longitude, latitude)) of the primary datum, in WGS84 decimal degrees

pt_0_grid

A numeric vector of the geographic coordinates (c(easting, northing)) of the primary datum, in local coordinates (defaults to c(0,0))

pt_1_geo

A numeric vector of the geographic coordinates (c(longitude, latitude)) of the secondary point, in WGS84 decimal degrees

pt_1_grid

A numeric vector of the geographic coordinates (c(easting, northing)) of the secondary point, in local coordinates

geo_crs

The coordinate reference system of the geographic coordinates. Can be defined using any method used by [sf::st_crs()].

name

An optional name for the floating grid coordinate reference system

Details

This function requires the latitude and longitude coordinates (in WGS84 decimal degrees) of the primary datum and a secondary point.

Value

Object of class crs, which is a list with elements input (length-1 character) and wkt (length-1 character).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
define_legacy_grid(
  pt_0_geo = c(-108.51, 37.385),
  pt_0_grid = c(500, 500),
  pt_1_geo = c(-108.511, 37.384),
  pt_1_grid = c(360, 380),
  name = "Screwy Legacy Grid"
)

# Or define from a different coordinate reference system:
define_legacy_grid(
  pt_0_geo = c(720446.8, 4140492.5),
  pt_0_grid = c(500, 500),
  pt_1_geo = c(720361.2, 4140379.2),
  pt_1_grid = c(360, 380),
  geo_crs = 6341,
  name = "Great New Grid"
)

crowcanyon/localgrid documentation built on March 21, 2021, 4:36 a.m.