Geodesy: how to calculate the straight line distance between two locations, which is represented by longitude and latitude?

To get the cartesian (2d-) distance on a map, have a look at Proj4.jl which is a Julia wrapper around a relatively widely used C library. As @improbable22 already wrote, this depends on the map projection.

1 Like