DistanceGeoCoord ( Lat1deg ; Lat1mm ; Lat1ss ; Lon1deg ; Lon1mm ; Lon1ss ; Lat2deg ; Lat2mm ; Lat2ss ; Lon2deg ; Lon2mm ; Lon2ss ; U ; Version )
Measure the distance between two geographic coordinates
Average rating: 4.4 (36 votes) Log in to vote
Edward_Souza n/a n/a |
(If "U" = Km) 418.34
(If "U" = Mi) 259.95
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
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.
Comments
Gil Jean, Paris Fr Feb 26, 2010 |
||
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 |
||
Edward Souza, Sao Paulo, Brazil Feb 26, 2010 |
||
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 |
||
Ben, realseeds Mar 7, 2010 |
||
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 |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.