Learn R Programming

GeodesiCL (version 1.0.0)

LongLatToUTM: To convert from Geographic coordinate to UTM coordinate.

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

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.

References

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

See Also

data.frame

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab