This is a wrapper around SpatialLinesMidPoints() that allows it to find the midpoint of lines that are not projected, which have a lat/long CRS.

line_midpoint(l)

Arguments

l

A spatial lines object

See also

Examples

data(routes_fast) line_midpoint(routes_fast[2:5, ])
#> Transforming to CRS +proj=aeqd +lat_0=53.82475517 +lon_0=-1.52535729 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs
#> Warning: CRS object has comment, which is lost in output
#> class : SpatialPointsDataFrame #> features : 4 #> extent : -1.533454, -1.514055, 53.82031, 53.82947 (xmin, xmax, ymin, ymax) #> crs : +proj=longlat +datum=WGS84 +no_defs #> variables : 17 #> names : plan, start, finish, length, time, waypoint, cum_hill, change_elev, dif_max_min, up_tot, down_tot, av_incline, co2_saving, calories, busyness, ... #> min values : 1, 1, 1, 1535, 313, 37, 87, -61, 39, 14, 47, 0.0376344086021505, 286, 20, 2259, ... #> max values : 1, 1, 1, 2976, 829, 97, 112, -4, 65, 54, 75, 0.0566775244299674, 555, 78, 7062, ...