I have this spatialLine in R:
library(sp) library(maptools) library(SDraw) library(leaflet) x <- c(153.9, 152.67072,147.9879,144.25364,135.45557,116.03998,76.92708,45.10622,37.02522,36.76888,36.41,37.19583,41.55226,50.99487,53.18) y <- c(73.52,75.80461,78.28467,80.82467,83.32397,85.49637,86.39683,85.16955,82.60437,78.01859,73.35001,72.87417,71.23226,71.55405,68.73) d <- SpatialLines(list(Lines(Line(cbind(x,y)), ID='a'))) crs(d) <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" leaflet(data = d) %>% addTiles() %>% addPolylines() # just plot the line
I want to measure its length. I tried:
> lineLength(d, byid = T)  148.407
However, this is not good (the actual size of this would be aroung ~4000 km as you can see). How can I actually measure the path length?