I wanted to calculate distances between geographic locations given as (latitude, longitude) pairs and I found a solution using Java Distance (attached example workflow). If you want result in miles, change the Earth to 3959 mi (6371 km).
If you are intrested in that topic (or different formulas) visit:
- http://www.movable-type.co.uk/scripts/latlong.html
- http://rosettacode.org/wiki/Haversine_formula
- https://stackoverflow.com/questions/120283/how-can-i-measure-distance-and-create-a-bounding-box-based-on-two-latitudelongi
Hi rchar01,
Thanks for providing this example. I have a question that maybe someone can help me with… I am trying to run this file but only have the distance calculate by region.
For example, if in my file I had an additional column, “region”, I would want to calculate points in region A only with other points in region A, points in region B only with other points in region B, etc. The only way I can think to do this is to split regions into their own separate input files, but that method is quite cumbersome.
I’ve tried using row filter and group nodes but haven’t been able to successfully pull this off.