1 Reply Latest reply on Jul 26, 2014 2:55 AM by Markus Schneider

    Calculate Distance Between Two LAT/LONG Positons

    JeremyHurd

      Title

      Calculate Distance Between Two LAT/LONG Positons

      Post

           Stumped!

           I have created a database that I will be using for observations in a helicopter.  What I would like to do is be able to calculate the distance (value output preferably in meters) between two geographical points in a flight path.  Basically, I would use the LocationValue feature to obtain both sets of LAT/LONG data and then I would want a field to display the calculated distance between those two points.

           I did some research on the forums and the closest result I could find referenced a link with a sample script in 2009, but it's a little beyond my scripting capabilities to tweak enough to fit my application:

           http://www.briandunning.com/cf/143

           Any help is appreciated, thanks!

        • 1. Re: Calculate Distance Between Two LAT/LONG Positons
          Markus Schneider

               You need FileMaker Pro Advanced to work with custom functions. 

               Adding a cf can be done easily by copy&paste (function name, parameters, function)

               in short / 'pseudo code':

               - Add New function

               - copy name from briandunning, paste it into the name-field of the cf

               - copy parameter (one by one), paste it into the param' field, klick the '+' to add it

               - copy the formula an paste it into the big field

               if there are errors when You leave the cf definition box, there might be problems with parameters - or the FileMaker version..

               After creating that cf, You can use it just the way You use standard FileMaker functions as shown in the example on the briandunning site

                

               If You don't have an Advanced version, You can create a formula using a couple of helper-fields or a script that fills/calculates $-variables and calculates the final field. All methods will need some basic knowledge of FileMaker - but that's not rocket-science (-: