LongLatToUTM: To convert from Geographic coordinate to UTM coordinate.

Description Usage Arguments Value Note References See Also Examples

View source: R/LongLatToUTM.R

Description

With this function it is possible to convert from Geographic coordinate to UTM coordinate. It is also possible to convert from other coordinate reference systems by selecting their EPGS number to UTM coordinate. Review notes and references.

Usage

1
LongLatToUTM(longlat_df, crs = 4326, units = "m", digits = 4)

Arguments

longlat_df

Point name, Sexagesimal longitude and latitude as dataframe.

crs

EPGS number of the new coordinate reference system to transform. DEFAULT: 4326 (WGS84)

units

Select units for UTM to work. DEFAULT: 'm'

digits

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

Value

a list with a data.frame and leaflet map.

Note

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

References

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

See Also

data.frame

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
# 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 <- data.frame(Pto,sexa_long,sexa_lat)

value <- LongLatToUTM(longlat_df, crs = 4326, units = 'm', digits = 4)
print(value)

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