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.

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

Value

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

Details

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

Examples

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" )
#> Coordinate Reference System: #> User input: +proj=omerc +lat_0=37.385 +lonc=-108.51 +alpha=-10.8099400559583 +gamma=0 +k_0=1.29863131831123 +x_0=500 +y_0=500 #> wkt: #> PROJCRS["Screwy Legacy Grid", #> BASEGEOGCRS["Screwy Legacy Grid", #> DATUM["World Geodetic System 1984", #> ELLIPSOID["WGS 84",6378137,298.257223563, #> LENGTHUNIT["metre",1]], #> ID["EPSG",6326]], #> PRIMEM["Greenwich",0, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8901]]], #> CONVERSION["Screwy Legacy Grid", #> METHOD["Hotine Oblique Mercator (variant B)", #> ID["EPSG",9815]], #> PARAMETER["Latitude of projection centre",37.385, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8811]], #> PARAMETER["Longitude of projection centre",-108.51, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8812]], #> PARAMETER["Azimuth of initial line",-10.8099400559583, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8813]], #> PARAMETER["Angle from Rectified to Skew Grid",0, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8814]], #> PARAMETER["Scale factor on initial line",1.29863131831123, #> SCALEUNIT["unity",1], #> ID["EPSG",8815]], #> PARAMETER["Easting at projection centre",500, #> LENGTHUNIT["metre",1], #> ID["EPSG",8816]], #> PARAMETER["Northing at projection centre",500, #> LENGTHUNIT["metre",1], #> ID["EPSG",8817]]], #> CS[Cartesian,2], #> AXIS["(E)",east, #> ORDER[1], #> LENGTHUNIT["metre",1, #> ID["EPSG",9001]]], #> AXIS["(N)",north, #> ORDER[2], #> LENGTHUNIT["metre",1, #> ID["EPSG",9001]]]]
# 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" )
#> Coordinate Reference System: #> User input: +proj=omerc +lat_0=37.384999622921 +lonc=-108.509999731967 +alpha=-10.8146235871119 +gamma=0 +k_0=1.29877699316682 +x_0=500 +y_0=500 #> wkt: #> PROJCRS["Great New Grid", #> BASEGEOGCRS["Great New Grid", #> DATUM["World Geodetic System 1984", #> ELLIPSOID["WGS 84",6378137,298.257223563, #> LENGTHUNIT["metre",1]], #> ID["EPSG",6326]], #> PRIMEM["Greenwich",0, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8901]]], #> CONVERSION["Great New Grid", #> METHOD["Hotine Oblique Mercator (variant B)", #> ID["EPSG",9815]], #> PARAMETER["Latitude of projection centre",37.384999622921, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8811]], #> PARAMETER["Longitude of projection centre",-108.509999731967, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8812]], #> PARAMETER["Azimuth of initial line",-10.8146235871119, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8813]], #> PARAMETER["Angle from Rectified to Skew Grid",0, #> ANGLEUNIT["degree",0.0174532925199433], #> ID["EPSG",8814]], #> PARAMETER["Scale factor on initial line",1.29877699316682, #> SCALEUNIT["unity",1], #> ID["EPSG",8815]], #> PARAMETER["Easting at projection centre",500, #> LENGTHUNIT["metre",1], #> ID["EPSG",8816]], #> PARAMETER["Northing at projection centre",500, #> LENGTHUNIT["metre",1], #> ID["EPSG",8817]]], #> CS[Cartesian,2], #> AXIS["(E)",east, #> ORDER[1], #> LENGTHUNIT["metre",1, #> ID["EPSG",9001]]], #> AXIS["(N)",north, #> ORDER[2], #> LENGTHUNIT["metre",1, #> ID["EPSG",9001]]]]