geodesic: To convert from Cartesian coordinate to Geographic...

Description Usage Arguments Value Note References Examples

View source: R/Geodesic.R

Description

With this function it is possible to convert from Cartesian coordinate to Geographic coordinate and obtain the decimal precision that you assign.

Usage

1
geodesic(a, XYZ_df, digits = 4)

Arguments

a

Selection of Ellipsoid.

XYZ_df

Sexagesimal longitude and latitude as dataframe.

digits

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

Value

data.frame with the data in the following order: "Pt", "Lat", "Lon", "H".

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
# Point name
Pto <- "St1"

# Cartesian data
X <- 1711591.78090565
Y <- -5060304.1659587
Z <- -3473256.69328603

# Pto, X, Y and Z as data.frame
XYZ_df <- as.data.frame(cbind(Pto, X, Y, Z))

# 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 5 which is GRS80
value <- geodesic(5, XYZ_df, digits = 4)
print(value)

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