GeoBox(latitude;longitude; radius)
Rate this function: Average rating: 3.0 (2 votes) Discuss this Custom Function
Steve Murray, Steve Murray
http://www.nurse.tv
Calculates latitude and longitude boundaries at radius of a location.
Sample Input:
| GeoBox (35.0846 ; 106.6516 ; 20 ) |
|
Sample Output:
34.7955
35.3737
106.2983
107.0049 |
|
Description:
Use with your database of locations or addresses, each record having latitude and longitude geo data.
Given a longitude and latitude (ie. from a zip code db or geocode lookup) for your centerpoint and a radius in miles. This function will calculate boundary latitudes and longitudes, creating a box area for finding locations within the radius of the box's centerpoint. The result is delivered in a four member value list. (lat1¶lat2¶long1¶long2). Use FileMaker's GetValue function to retreive the values.
Typical Use:
You can use the values for a Find:
criteria: Latitude= lat1 ... lat2 AND Longitude = long1 ... long2.
Or you can create a multipredicate relationship to define the range and pull in related records.
Things to consider:
Due to the fact that we are using a box instead of a circle, there is margin of error here but acceptable for most applications, such as retail locations, delivery information, etc.
These calculations are generally accepted formulas for approximate (close enough) results. There are other, albeit more complex formulas if pinpoint accuracy is required.
If your DB containing geo location data contains negative values (ie. negative longitudes for western hemisphere), it is best to just remove the negative signs and make sure that all data represents absolute values. This is easier than adjusting calculation results or find requests for occurances of negative values in your fields. This is valid as long as your radius calcs do not involve more than one quadrant. For example, the North American quadrant is all north latitudes and west longitudes.
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:There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
|
Newest Custom Functions:
| 1. |
MaxLength ( field, foundCnt ) |
| |
(Thu, Jul 29, 4:37pm) |
| 2. |
DayCounter ( Date_Start ; Date_End; Days_of_Week ) |
| |
(Wed, Jul 28, 1:20pm) |
| 3. |
Is_FM_Go_iPad |
| |
(Fri, Jul 23, 7:55am) |
| 4. |
Is_FM_Go |
| |
(Fri, Jul 23, 7:54am) |
| 5. |
IsFilled ( field ) |
| |
(Wed, Jul 21, 7:19am) |
| 6. |
DateQuarterAsRange ( theDate ) |
| |
(Thu, Jul 15, 5:37pm) |
| 7. |
DateQuarterEnd ( theDate ) |
| |
(Thu, Jul 15, 5:35pm) |
| 8. |
DateQuarterBegin ( theDate ) |
| |
(Thu, Jul 15, 5:30pm) |
 |
|