• Your shopping cart is empty!
Sample Codes (ColdFusion)
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- :::                                                                         ::: -->
<!-- :::  This routine calculates the distance between two points (given the     ::: -->
<!-- :::  latitude/longitude of those points). It is being used to calculate     ::: -->
<!-- :::  the distance between two locations using GeoDataSource (TM) prodducts  ::: -->
<!-- :::                                                                         ::: -->
<!-- :::  Definitions:                                                           ::: -->
<!-- :::    South latitudes are negative, east longitudes are positive           ::: -->
<!-- :::                                                                         ::: -->
<!-- :::  Passed to function:                                                    ::: -->
<!-- :::    lat1, lon1 = Latitude and Longitude of point 1 (in decimal degrees)  ::: -->
<!-- :::    lat2, lon2 = Latitude and Longitude of point 2 (in decimal degrees)  ::: -->
<!-- :::                                                                         ::: -->
<!-- :::  Worldwide cities and other features databases with latitude longitude  ::: -->
<!-- :::  are available at http://www.geodatasource.com                          ::: -->
<!-- :::                                                                         ::: -->
<!-- :::  For enquiries, please contact sales@geodatasource.com                  ::: -->
<!-- :::                                                                         ::: -->
<!-- :::  Official Web site: http://www.geodatasource.com                        ::: -->
<!-- :::                                                                         ::: -->
<!-- :::             GeoDataSource.com (C) All Rights Reserved 2017              ::: -->
<!-- :::                                                                         ::: -->
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->

<cfset radlat1="((pi()" *="" lat1)="" 180)=""></cfset>
<cfset radlat2="((pi()" *="" lat2)="" 180)=""></cfset>
<cfset radlon1="((pi()" *="" lon1)="" 180)=""></cfset>
<cfset radlon2="((pi()" *="" lon2)="" 180)=""></cfset>
<cfset theta="lon1-lon2"></cfset>
<cfset radtheta="((pi()" *="" theta)="" 180)=""></cfset>
<cfset dist="((60" *="" 1.1515)="" (180="" pi())="" (acos((sin(radlat1)="" sin(radlat2))="" +="" (cos(radlat1)="" cos(radlat2)="" cos(radtheta)))))=""></cfset>

The sample code is licensed under LGPLv3.