SphericalDistanceCalculator

From Fmepedia


This page contains a Custom Transformer created by an fmepedia user.
  See the attached files list at the foot of this page for the zip file containing this custom transformer.  



Created by: Dmitri Bagh


SphericalDistanceCalculator calculates shortest distances between points on the Earth surface. It considers the Earth has spherical shape, and this is why it cannot be used for exact calculations. Taking into account flattening out the Earth requires much more sophisticated formulas. The Spherical Distance calulation is sometimes referred to as Haversines

   http://en.wikipedia.org/wiki/Haversine_formula

This transformer allows to calculate some interesting statistics. For example, if we pass all world capitals through SphericalDistanceCalculator, and then query results, we will know that Sarajevo, Bosnia-Herzegovina, is the closest capital to all others with total distance 1,416,274 km, and average 6379.6 km. A perfect place to minimize fuel costs (well, our world, of course, is not that simple). And if you are looking for the perfect getaway, Wellington with its 2,993,276 km of total distance to other capitals looks like a remote place. Two closest capitals are Brazzaville (Kongo) and Kinshasa (Zaire), two most remote from each other - Taipei, Taiwan and Asuncion, Paraguay.

SphericalDistanceCalculator and OrthodromeReplacer transformers - used in an example workspace (World Traveller.zip - included in download) to calculate the distance between two locations in LL coordinate systems. Calculates the travel distance and travel (flying) time. Use File->Run and you'll be prompted to select your origin and destination. Add more cities by editing the cities.csv file and the workspace header (for prompting).

In the second example workspace (Shortest Distance Test.zip - included in download) the SphericalDistanceCalculator is used to measure the distance between cities with the results written to Excel.


Attached Files
filesizedate
SphericalDistance.zip753.7 kB09/25/06
sphericalDistanceCalculator.jpg22.5 kB09/25/06
User Comments Add a new comment

The type of calculation is sometimes referred to as Haversines

    http://en.wikipedia.org/wiki/Haversine_formula