---
title: "iemisc: Engineering Survey Examples"
author: "Irucka Embry, E.I.T. (EcoC²S)"
date: "`r Sys.Date()`"
lang: en-us
urlcolor: blue
output:
  rmarkdown::pdf_document:
    highlight: kate
    toc: true
    latex_engine: xelatex
vignette: >
  %\VignetteIndexEntry{iemisc Engineering Survey Examples}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

\bigskip

# Replicate the R code

Note: If you wish to replicate the R code below, then you will need to copy and paste the following commands in R first (to make sure you have the package and its dependencies):  

```{r eval = FALSE, tidy = TRUE}
install.packages("iemisc", "pander")
# install the packages and their dependencies
```

\bigskip
\bigskip

```{r, warning = FALSE, message = FALSE, tidy = TRUE}
# load the required packages
install.load::load_package("iemisc", "pander")
```

\bigskip
\bigskip

# Midpoint

## Examples

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

Northing_begin <- 283715.8495
Easting_begin <- 1292428.3999

Northing_end <- 303340.6977
Easting_end <- 1295973.7743

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




# Tennessee (TN) Northing and Easting in meters

Northing2 <- c(232489.480, 234732.431)

Easting2 <- c(942754.124, 903795.239)

dt4A <- project_midpoint(Northing2[1], Easting2[1], Northing2[2], Easting2[2],
"meters", "TN", output = "advanced")
pander(dt4A)
```

\bigskip
\bigskip
\bigskip
\bigskip

# Engineering Survey 1 (engr_survey)

## Example 1

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

# Tennessee (TN) Northing and Easting in US Survey foot
Northing3 <- c("630817.6396", "502170.6065", "562,312.2349", "574,370.7178")

Easting3 <- c("2559599.9201", "1433851.6509", "1,843,018.4099", "1,854,896.0041")

dt3A <- engr_survey(Northing3[1], Easting3[1], "survey_ft", "TN", output =
"basic", utm = 1)
pander(dt3A) # first set of Northing, Easting points


dt3B <- engr_survey(Northing3[2], Easting3[2], "survey_ft", "TN", output =
"basic", utm = 0)
pander(dt3B) # second set of Northing, Easting points


dt3C <- engr_survey(Northing3[3], Easting3[3], "survey_ft", "TN", output =
"basic", utm = 1)
pander(dt3C) # third set of Northing, Easting points


dt3D <- engr_survey(Northing3[4], Easting3[4], "survey_ft", "TN", output =
"basic", utm = 0)
pander(dt3D) # fourth set of Northing, Easting points
```

\bigskip
\bigskip

## Example 2

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

# Tennessee (TN) Northing and Easting in meters

Northing4 <- c(232489.480, 234732.431)

Easting4 <- c(942754.124, 903795.239)

dt4A <- engr_survey(Northing4[1], Easting4[1], "meters", "TN", output = "table", utm = 0)
pander(dt4A)


dt4B <- engr_survey(Northing4[2], Easting4[2], "meters", "TN", output = "table", utm = 0)
pander(dt4B)
```

\bigskip
\bigskip
\bigskip
\bigskip

# Engineering Survey 1 Batch Mode (engr_survey_batch)

## Examples

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

# Tennessee (TN) Northing and Easting in meters

Northing2 <- c(232489.480, 234732.431)

Easting2 <- c(942754.124, 903795.239)

dt4 <- engr_survey_batch(Northing2, Easting2, "meters", "TN", output = "table")
pander(dt4)
```

\bigskip
\bigskip
\bigskip
\bigskip

# Engineering Survey 2 (engr_survey2)

## Examples

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

station5 <- "516+64.10"
station6 <- "511+29.10"

engr_survey2(station5, station6, units1 = "foot", units2 = "kilometers")


station7 <- "303+91.00"
station8 <- "299+41.00"

engr_survey2(station7, station8, units1 = "meters", units2 = "foot")



station9 <- "43+50.00"
station10 <- "52+00.00"

engr_survey2(station9, station10, units1 = "foot", units2 = "mile")
```

\bigskip
\bigskip
\bigskip
\bigskip

# Engineering Survey 3 (engr_survey3)

## Example

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

engr_survey3(23, station_distance = 100, units = "survey_mile", output = "numeric")
```

\bigskip
\bigskip
\bigskip
\bigskip

# Engineering Survey 4 (engr_survey4)

## Example

```{r, warning = FALSE, message = FALSE, tidy = TRUE}

engr_survey4(1394.32, "45+43.12", units = "kilometers")
```

\bigskip
\bigskip
\bigskip
\bigskip

# Conversion of Latitude/Longitude Coordinates to Engineering Survey Measurements (engr_survey_reverse)

```{r, warning = FALSE, message = FALSE, tidy = TRUE}
# Tennessee

lat <- 35.8466965

long <- -088.9206794

dt1A <- engr_survey_reverse(lat, long, units = "survey_ft", location = "TN", output =
"table", utm = 0)
pander(dt1A)



# Kentucky

lats <- "37'50'21.5988''N"
longs <- "84'16'12.0720'W"

dt2B <- engr_survey_reverse(lats, longs, "foot", "KY", output = "table", utm = 0)
pander(dt2B)
```

\bigskip
\bigskip
\bigskip
\bigskip

# EcoC²S Links

EcoC²S Home -- https://www.ecoccs.com/  
About EcoC²S -- https://www.ecoccs.com/about_ecoc2s.html  
Services -- https://www.ecoccs.com/services.html  
Products -- https://www.questionuniverse.com/products.html  
EcoC²S Media -- https://www.ecoccs.com/media.html  
EcoC²S Resources -- https://www.ecoccs.com/resources.html  
R Trainings and Resources provided by EcoC²S (Irucka Embry, E.I.T.) -- https://www.ecoccs.com/rtraining.html  

\bigskip
\bigskip

# Copyright and License

All R code written by Irucka Embry is distributed under the GPL-3 (or later) license, see the [GNU General Public License {GPL} page](https://www.gnu.org/licenses/gpl-3.0.html).  

All written content originally created by Irucka Embry is copyrighted under the Creative Commons Attribution-ShareAlike 4.0 International License. All other written content retains the copyright of the original author(s).  

This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).  
