project_midpoint: Calculate the midpoint between two coordinates (KY and TN)

project_midpointR Documentation

Calculate the midpoint between two coordinates (KY and TN)

Description

Takes Kentucky or Tennessee-based Northing and Easting engineering survey measurements [based in the State Plane Coordinate System (SPCS)] in meters, international foot, or US survey foot and converts those values into geodetic coordinates of the World Geodetic System (WGS) (19)84 (EPSG:4326). [MapTiler Reference] Each latitude Y and longitude X point is verified to be located within Kentucky or Tennessee.

Usage

project_midpoint(
  Northing_begin,
  Easting_begin,
  Northing_end,
  Easting_end,
  units = c("survey_ft", "foot", "meters"),
  location = c("KY", "TN"),
  output = c("simple", "advanced")
)

Arguments

Northing_begin

numeric vector (or character vector with numbers, commas, and decimal points) that contains the Northing engineering survey measurement in meters, international foot, or US survey foot

Easting_begin

numeric vector (or character vector with numbers, commas, and decimal points) that contains the Northing engineering survey measurement in meters, international foot, or US survey foot

Northing_end

numeric vector (or character vector with numbers, commas, and decimal points) that contains the Northing engineering survey measurement in meters, international foot, or US survey foot

Easting_end

numeric vector (or character vector with numbers, commas, and decimal points) that contains the Northing engineering survey measurement in meters, international foot, or US survey foot

units

character vector that contains the system of units (options are survey_ft (United States Customary System) [US survey foot], foot, or meters (International System of Units) [meters] only 1 set of units at a time

location

character vector that contains the location name ('KY' for Kentucky or 'TN' for Tennessee) only 1 location at a time

output

character vector that contains simple for the default result using a simple data.table or advanced for the result as a complex data.table

Value

the projected associated latitude Y and longitude X mid point coordinates in Decimal Degrees as a data.table or as an enhanced data.table with the Northing and Easting coordinates in US survey foot, international foot, and meters in addition to the Y and X coordinates for the begin, middle, and end points

Note

Please Note: If you have Kentucky North/South Zone survey measurements, then please use the Kentucky Geological Survey, University of Kentucky - Kentucky Single Coordinate Conversion Tool (http://kgs.uky.edu/kgsweb/CoordConversionTool.asp) instead. That tool will give you the geographic coordinates too. This R function, project_midpoint will only be valid for NAD83 / Kentucky Single Zone.

Useful Tennessee reference Web site Tennessee Department of Transportation Roadway Design Survey Standards https://www.tn.gov/tdot/roadway-design/survey-standards.html

Useful Kentucky reference Web site Kentucky Transportation Cabinet Survey Coordination https://transportation.ky.gov/Highway-Design/Pages/Survey-Coordination.aspx

Author(s)

Irucka Embry

Source

  1. Win-Vector Blog. John Mount, June 11, 2018, "R Tip: use isTRUE()", https://win-vector.com/2018/06/11/r-tip-use-istrue/.

  2. Latitude Longitude Coordinates to State Code in R - Stack Overflow answered by Josh O'Brien on Jan 6 2012 and edited by Josh O'Brien on Jun 18, 2020. See https://stackoverflow.com/questions/8751497/latitude-longitude-coordinates-to-state-code-in-r.

  3. r - Convert column classes in data.table - Stack Overflow answered by Matt Dowle on Dec 27 2013. See https://stackoverflow.com/questions/7813578/convert-column-classes-in-data-table.

  4. Excel vlook up function in R for data frame - Stack Overflow answered by Tyler Rinker on Apr 8 2013 and edited by Tyler Rinker on Feb 26 2014. See https://stackoverflow.com/questions/15882743/excel-vlook-up-function-in-r-for-data-frame.

  5. r - How to not run an example using roxygen2? - Stack Overflow answered and edited by samkart on Jul 9 2017. (Also see the additional comments in response to the answer.) See https://stackoverflow.com/questions/12038160/how-to-not-run-an-example-using-roxygen2.

  6. devtools - Issues in R package after CRAN asked to replace dontrun by donttest - Stack Overflow answered by Hong Ooi on Sep 1 2020. (Also see the additional comments in response to the answer.) See https://stackoverflow.com/questions/63693563/issues-in-r-package-after-cran-asked-to-replace-dontrun-by-donttest.

References

  1. udunits.dat, v 1.18 2006/09/20 18:59:18 steve Exp, https://web.archive.org/web/20230202155021/https://www.unidata.ucar.edu/software/udunits/udunits-1/udunits.txt. Retrieved thanks to the Internet Archive: Wayback Machine

  2. Spatial Reference, Aug. 13, 2004, "EPSG:3088: NAD83 / Kentucky Single Zone", https://spatialreference.org/ref/epsg/3088/.

  3. Spatial Reference, March 7, 2000, "EPSG:32136 NAD83 / Tennessee", https://spatialreference.org/ref/epsg/32136/.

  4. MapTiler Team, "EPSG:4326: WGS 84 – WGS84 - World Geodetic System 1984, used in GPS, https://epsg.io/4326.

  5. Tennessee Department of Transportation Design Division, Tennessee Department of Transportation Tennessee Geodetic Reference Network (TGRN) Reference Manual Second Edition Issued, page ix, https://www.tn.gov/content/dam/tn/tdot/documents/TgrnComposite.pdf.

  6. Earth Point, "State Plane Coordinate System - Convert, View on Google Earth", https://www.earthpoint.us/StatePlane.aspx.

  7. National Geodetic Survey datasheet95, version 8.12.5.3, online retrieval date July 25, 2019, Mid Valley Oil Rad Relay Twr designation, HA1363 PID, Grayson County Kentucky, Clarkson (1967) USGS Quad, https://www.ngs.noaa.gov/cgi-bin/ds_mark.prl?PidBox=HA1363.

  8. National Geodetic Survey datasheet95, version 8.12.5.3, online retrieval date July 25, 2019, 2006 42 07 designation, DL4005 PID, Fayette County Kentucky, Lexington West (1993) USGS Quad, https://www.ngs.noaa.gov/cgi-bin/ds_mark.prl?PidBox=DL4005.

Examples


# Example 1

library(iemisc)

Northing_begin <- 283715.8495
Easting_begin <- 1292428.3999

Northing_end <- 303340.6977
Easting_end <- 1295973.7743

project_midpoint(Northing_begin, Easting_begin, Northing_end, Easting_end,
units = "survey_ft", location = "TN", output = "simple")







# See Source 5 and Source 6

# Please see the error messages

library(iemisc)

# Tennessee (TN) Northing and Easting in meters

Northing2 <- c(232489.480, 234732.431)

Easting2 <- c(942754.124, 903795.239)

dt4 <- try(project_midpoint(Northing2, Easting2, units = "survey_ft",
location = "TN", output = "simple"))







iemisc documentation built on Sept. 25, 2023, 5:09 p.m.