tolatlon: A function to calculate distance (kilometer) between two...

Description Usage Arguments Examples

View source: R/latlon2meter.r

Description

Modfied from https://www.r-bloggers.com/great-circle-distance-calculations-in-r/ https://rdrr.io/cran/prettymapr/src/R/scalebar.R epsg = 4326 decimal degree several functions to convert lat long to meters, projected to lat long

Usage

1
tolatlon(x, y, epsg)

Arguments

lat1

Latitute for location 1

lon1

Longitude for location 2

lat2

Latitute for location 1

lon2

Longitude for location 2

Examples

1
2
3
4
latlon2meter(lat1 = 45, lon1 = -90, lat2 = 34.5, lon2 = -125.5)  # USA map with  projection
.geodist(x1 = 34.1, y1 = 45, x2 = 34.5, y2 = 45.5, epsg = 4326)
bx <- bbox(us.states)
latlon2meter(lat1 = bx[2,1], lon1 = bx[1,1], lat2 = bx[2,2], lon2 = bx[1,1])

kevinlzheng/statemaps documentation built on May 20, 2019, 1:56 p.m.