# calculate distance between two latitude longitude points

**URL:** <https://forum.knime.com/t/calculate-distance-between-two-latitude-longitude-points/11152>\
**Category:** Community Extensions\
**Tags:** palladian-selenium\
**Created:** [May 29, 2018, 8:28am UTC](https://forum.knime.com/t/calculate-distance-between-two-latitude-longitude-points/11152 "2018-05-29T08:28:52Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Thyme](https://forum-cdn.knime.com/user_avatar/forum.knime.com/thyme/32/34550_2.png) [@Thyme](https://forum.knime.com/u/Thyme)\
**Post date:** [April 5, 2022, 8:59pm UTC](https://forum.knime.com/t/calculate-distance-between-two-latitude-longitude-points/11152/12 "2022-04-05T20:59:22Z")

</div>

You might want to check the links in this thread. Most of them are links _to_ this thread, they’re found below each post. There should still be something useful to be found in some of them. Especially this one:

> [@I need help to calculate the distance between longitude and latitude with KNIME](https://forum.knime.com/t/i-need-help-to-calculate-the-distance-between-longitude-and-latitude-with-knime/37897/11):
>
> Hi @zhangsan Please find below a very simple solution implemented in Java to calculate distances between two Latitude and Longitude coordinates. It does it in Km & Miles (land & Nautical) [20211205 Pikairos calculate distance between longitude and latitude in Java.knwf](https://forum.knime.com/uploads/short-url/5BnlFfPYNprJMT1Rehh3wojvlsA.knwf) (28 KB) Hope this helps wink Best wishes Ael PS: The Java source code is from here relaxed 你好 @zhangsan 请在下面找到一个用 Java 实现的非常简单的解决方案，用于计算两个纬度和经度坐标之间的距离。 它以公里和英里（陆地和海洋）完成 希望这可以帮助 ;-） 最好的祝愿 Ael

and also the [Haversine formula](https://en.wikipedia.org/wiki/Haversine_formula) and for some use cases more general the [Great-circle distance](https://en.wikipedia.org/wiki/Great-circle_distance).

You haven’t given us much information about your problem, but a general outline could look like this:

1. Cross Join your input tables/vectors (beware, table size blows up dramatically)
2. calculate distance between points in each row (Haversine formula)
3. for each target point, select shortest distance (Duplicate Row Filter on target point, using Min-distance as tiebreaker)

Let us know if you need any more help! 🙂

---

_[View the full topic](https://forum.knime.com/t/calculate-distance-between-two-latitude-longitude-points/11152)._
