Unable to render {include} The included page could not be found.

Determining the length between geographical locations is currently not implemented in Net Topology Suite (in JTS this is called Orthodromic Distance). This distance is referred to as the ellipsoidal distance. Exactly this type of calculation is needed to provide scalebar functionality.

A C# library exists that performs a calculation to determine this distance, an example of its usage is provided below. Theory can be found in the attached pdf file. The library has been added to delft-tools\shared\geodesy

Imports System
Imports Gavaghan.Geodesy

    Public Class VincentyGeodeticProblems

    '//Answers is in meters!
    Shared Function Distance _
        (ByVal Loc1_X As Double, ByVal Loc1_Y As Double, _
    byval Loc2_X as Double, byval Loc2_Y as Double) _
        as Double
       
       
            ' instantiate the calculator
            Dim geoCalc As New GeodeticCalculator()

            ' select a reference elllipsoid
            Dim reference As Ellipsoid = Ellipsoid.WGS84

            ' set loc 1 coordinates
            Dim Loc1 As GlobalCoordinates
            Loc1 = New GlobalCoordinates(Loc1_X, Loc1_Y)

            ' set loc 2 coordinates
            Dim Loc2 As GlobalCoordinates
            Loc2 = New GlobalCoordinates(Loc2_X, Loc2_Y)

            ' calculate the geodetic curve
            Dim geoCurve As GeodeticCurve = _
            geoCalc.CalculateGeodeticCurve(reference, Loc1, Loc2)

                     return geoCurve.EllipsoidalDistance
           
        End function

    End Class
  • No labels

1 Comment

  1. Unknown User (kok_ec)

    Some notes:

    • This geodetic calculator library is used in distance calculations in the new ScaleBarTool and MeasureTool. It has been added to the /lib.
    • In the near future it should ideally use the actual Ellipsoid of the currently loaded map instead of the default WGS 84.
    • In the distant future distance measurements might be implemented in the Net Topology Suite which can then replace the currently used external class.