Shopping Cart

Search:

Signup

Contact

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

# FileMaker Pro Custom Functions

DistanceGeoCoord ( Lat1deg ; Lat1mm ; Lat1ss ; Lon1deg ; Lon1mm ; Lon1ss ; Lat2deg ; Lat2mm ; Lat2ss ; Lon2deg ; Lon2mm ; Lon2ss ; U ; Version )

Rate this function:

Discuss this Custom Function

Edward_Souza, n/a
n/a

Measure the distance between two geographic coordinates

Sample Input:
 DistanceGeoCoord ( 50 ; 6 ; 44 ; 8 ; 44 ; 5 ; 52 ; 31 ; 20 ; 13 ; 17 ; 51 ; Km ; Radial )
Sample Output:
 /* Distance between Frankfurt and Berlin (If "U" = Km) 418.34 (If "U" = Mi) 259.95

Then copy & paste into FileMaker Advanced's Edit Custom Function window.

## Description:

This is a rather complete and flexible custom function on measuring linear distances between two geographic coordinates, for it allows the user/developer to insert coordinate values in DMS (Degrees, Minutes, and Seconds) and DD (Decimal Degrees). Yet, it goes a bit further on flexibility , for it permits the calculation of angle functions either in Degrees or Radians.
The function itself is quite straightforward and easy to understand. Please refer to the text in the beginning and inside-function notes for deeper information.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

## Discuss:

hello, edward,

this is nice function. thanks for sharing it.
i would like to know how to add different measures in this function, and how to do it.
thank you, jean

Gil Jean, Paris Fr
February 26, 2010 8:34am

Salut, Gil Jean,

Let us say you need to measure the linear distance between two coordinates in inches. The first thing to do give this unit a "name" or an acronym (for the sake of an example, let us call it "In") then include it plus the radius of earth on the Equator (which, by my calculations, is 251107782.481124 inches) to the "R" variables.
When done, "R" shall look like this:
R =
Case(
U = "Km"; 6378.137; // radius of the earth in kilometers
U = "m"; 6378137; // radius of the earth in meters
U = "Mi"; 3963.191; // radius of the earth in statute miles
U = "NMi"; 3437.74677; // radius of the earth in nautical miles
U = "In"; 251107782.481124 // radius of the earth in inches
)
The next step is to include "In" to the validation parameter below "R". This would then look like this:
//If you added a new value, place its acronym here as well
IsEmpty( U ) or ( U ≠ "Km" and U ≠ "m" and U ≠ "Mi" and U ≠ "NMi" and U ≠ "In" );
"Error - Missing (or Wrong) Unit";
That's this simple. I hope I could've been of any help.
Edward

Edward Souza, Sao Paulo, Brazil
February 26, 2010 2:29pm

Hello Edward,

What is the difference between the 2 parameter "Version": Radians or Degrees.

What do you mean by "isolate or not the
coordinates"?

Thanks

Ben

Ben, Belgium
March 07, 2010 4:38am