Method: Proj::PjObject#lp_distance

Defined in:
lib/proj/pj_object.rb

#lp_distance(coord1, coord2) ⇒ Float

Calculate geodesic distance between two points in geodetic coordinates. The calculated distance is between the two points located on the ellipsoid. Note that the axis order of the transformation object is not taken into account, so even though a CRS object comes with axis ordering latitude/longitude coordinates used in this function should be reordered as longitude/latitude.

Parameters:

  • coord1 (Coordinate)

    Coordinate of first point. Must be lat/long in radians

  • coord2 (Coordinate)

    Coordinate of second point. Must be lat/long in radians

Returns:

  • (Float)

    Distance between the coordinates in meters

See Also:



474
475
476
# File 'lib/proj/pj_object.rb', line 474

def lp_distance(coord1, coord2)
  Api.proj_lp_dist(self, coord1, coord2)
end