Search code examples
javajts

JTS.orthodromicDistance incorrectly calculate the equatorial radius of the earth


JTS.orthodromicDistance(new Coordinate(0,0), new Coordinate(180,0), DefaultGeographicCRS.WGS84) * 2 is equal to 40075016 but must be equal to 6378000.


Solution

  • You get what you asked for. Your formula calculates the circumference, which is 2*pi*radius.

    The radius is circumference / (2*pi), indeed about 6378000.