Geotools distance calculation fails with no convergence exception for several lat lon points

故事扮演 提交于 2019-12-05 12:19:16

The problem is that this is not a straightforward calculation as the Vincenty algorithm is an iterative process and some sets of points don't necessarily converge (within the limit set).

There are two possible solutions 1 - edit the GeodeticCalculator to increase the number of possible iterations from 12 to 15, this works in this case but I can't guarantee it in others. Or 2 use another algorithm, following links from this question's answers I found the GeographicLib library at Sourceforge and used that instead with your points. It is written by the author (@cffk) of the paper linked to in the other answer.

For your points it gives a very reasonable looking 20004 Km.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!