![]() ![]() |
Home |
How it works |
Projects archive |
Contact Us Air Compressor Bot |
|
| The Career Path of Freelance Programming Jobs |
Zip Code Radius for Visual Foxpro 9 |
![]() |
Bidding Time: |
01/06/2008 15:07 - 11/06/2008 00:00 |
||
Budget: |
$30-250 |
||
Status: |
Closed | ||
|
|
|||
Job Type: |
|||
Description: |
We current have our programmer write us an application that will required some help. We need a programmer that can write us a class that will allow us to be able to enter a zipcode and the miles radius. The class should query our zipcode database with contain all latitude and longitde information will return all the zipcodes that will match the search. Then we will need the class to check each zipcode found and query locate our providers database and return any matching providers zip code within the search match. We at this time can take the results and place it within our application. Note: We search the internet and found the math formula as shown: The Great Circle method isn't that hard. Here's the formula (this is in C# but it can be easily ported to any other language): private int GetDistance(float lat1, float lon1, float lat2, float lon2) { double distance = Math.Acos((Math.Sin(lat1) * Math.Sin(lat2)) + (Math.Cos(lat1) * Math.Cos(lat2) * Math.Cos(lon2 - lon1))); int idistance = (int) Math.Round(distance * 3963); return idistance; } Note that longitudes and latitudes must be in radians. To use this to grab everything with a certain radius straight from the database, you can do something like (this was in SQL Server 2K so you can't use aliases in the WHERE clause): SELECT a.name, a.city, a.state, ROUND( (ACOS( (SIN(c.latitude) * SIN(a.latitude)) + (COS(c.latitude) * COS(a.latitude) * COS(a.longitude - c.longitude)) ) ) * 3963,1 ) AS distance FROM Airports a, Cities c WHERE ( ACOS( (SIN(c.latitude) * SIN(a.latitude)) + (COS(c.latitude) * COS(a.latitude) * COS(a.longitude - c.longitude)) ) ) * 3963 <= [RADIUS IN MILES] AND c.zip='[ZIP CODE]' ORDER BY distance Need a bid and timeframe if you can do the project.
This project is the proprietary information of .
Click here to remove this project from OUR database.
|
||
Operating System: |
MS Windows | ||
Database System: |
Other | ||
| <<< back |
|
| Home | Projects archive | RSS | Resources | Links | Contact Us | © 2004-2009 ProjectsList.biz /0.218 |