TO_TM: To convert from Geographic coordinate to TM.

Description Usage Arguments Value Note References Examples

View source: R/TO_TM.R

Description

With this function it is possible to convert from Geographic coordinate to TM using the Central meridian, Scale factor Ko, False East, False North and obtain the decimal precision that you assign.

Usage

1
TO_TM(a = 47, longlat_df, d, e, f, g, digits = 4)

Arguments

a

Selection of Ellipsoid.

longlat_df

Sexagesimal longitude and latitude as dataframe.

d

Central meridian.

e

Scale factor Ko.

f

False East (FE).

g

False North (FN).

digits

Number of digits the seconds are rounded to. DEFAULT: 4

Value

data.frame with the data in the following order: "East", "North", "X", "Y".

Note

create data frame of epsg codes by epsg <- rgdal::make_EPSG()

References

https://github.com/OSGeo/PROJ & https://github.com/cran/rgdal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Test data
CM <- -69.00000
SC_FACTOR_Ko <- 0.99960
FE <- 500000.00000
FN <- 10000000.00000

# Point name
Pto <- "St1"

# Longitude
g <- -71
m <- 18
s <- 44.86475

# Value in sexagesimal
sexa_long <- sexagesimal(g, m, s)

# Latitude
g1 <- -33
m1 <- 12
s1 <- 27.11457

# Value in sexagesimal
sexa_lat <- sexagesimal(g1, m1, s1)

# Longitude and Latitude as data.frame
longlat_df <- as.data.frame(cbind(Pto,sexa_long,sexa_lat))

# ELLIPSOIDAL HEIGHT (h)
h <- 31.885

# To know the ellipsoids and the order open the Ellipsoids in the package and look for it number
Ellip <- Ellipsoids
#View(Ellip)

# We choose the number 47 which is WGS84
value <- TO_TM(a = 47, longlat_df, CM, SC_FACTOR_Ko, FE, FN, digits = 4)
print(value)

GeodesiCL documentation built on May 25, 2021, 5:10 p.m.