473,395 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DotNet way to calculate distances between cities

Is there a way to calculate miles between two places in DotNet? Is
there a third party tool available that can be incorporated into
DotNet that would work well?
Jul 17 '08 #1
5 2917
Doug <dn******@dtgnet.comwrote:
Is there a way to calculate miles between two places in DotNet? Is
there a third party tool available that can be incorporated into
DotNet that would work well?
There's the Haversine formula (not in the framework, but easy to
reproduce):

http://en.wikipedia.org/wiki/Haversine_formula

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jul 17 '08 #2
On Jul 17, 2:24*pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Doug <dnlwh...@dtgnet.comwrote:
Is there a way to calculate miles between two places in DotNet? *Is
there a third party tool available that can be incorporated into
DotNet that would work well?

There's the Haversine formula (not in the framework, but easy to
reproduce):

http://en.wikipedia.org/wiki/Haversine_formula

--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon_skeet
C# in Depth:http://csharpindepth.com
Wouldn't you need to know the longitude and latitude for that to
work? Obviously I know you need to have some basis to start
with...but is there something out there that has that available? I.E.
if I said Chicago, Illinois, is there something that would give me the
longitude and latitude for that (dotnet or third party)?
Jul 17 '08 #3

You can check this out I guess:

http://msdn.microsoft.com/en-us/library/aa905677.aspx

Windows Live
Windows Virtual Earth SDK

"Doug" <dn******@dtgnet.comwrote in message
news:13**********************************@z72g2000 hsb.googlegroups.com...
Is there a way to calculate miles between two places in DotNet? Is
there a third party tool available that can be incorporated into
DotNet that would work well?

Jul 17 '08 #4
Doug <dn******@dtgnet.comwrote:
Wouldn't you need to know the longitude and latitude for that to
work?
Yes. I was assuming you had that.
Obviously I know you need to have some basis to start
with...but is there something out there that has that available? I.E.
if I said Chicago, Illinois, is there something that would give me the
longitude and latitude for that (dotnet or third party)?
There may be publicly available lists around - the only time I've dealt
with geographic data like this it's been as part of another API which
had all the longitude and latitude data.

Just a very quick search on the net finds some results though, e.g.
http://www.bcca.org/misc/qiblih/latlong_us.html

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jul 17 '08 #5
"Doug" <dn******@dtgnet.comwrote in message
news:c4**********************************@m73g2000 hsh.googlegroups.com...
Wouldn't you need to know the longitude and latitude for that to
work? Obviously I know you need to have some basis to start
with...but is there something out there that has that available? I.E.
if I said Chicago, Illinois, is there something that would give me the
longitude and latitude for that (dotnet or third party)?
Google Maps has an API that returns information (including latitude and
longitude) for the location that you supply, such as "Chicago, Illinois".
Requires (free) registration to get a Key that lets you activate the API.
http://code.google.com/apis/maps/doc...ocoding_Direct

Jul 17 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jayne Wolps | last post by:
Hello I wonder if anyone can help. I would like to know how certain sites: http://aboutbritain.com/ArundelCastle.htm, and http://travel.knowhere.co.uk/place/+bristol-0/ manage to put approx...
6
by: Chuck | last post by:
Blackridge VA and La Crosse VA share a common ZIP code, 23950. I would like to make a small table of ZIP codes, Cities, and States to only include the ZIP codes for members of a small club. The...
1
by: Hul Tytus | last post by:
comp.lang.c converting a point known by 4 distances to xyz coordinates? Amongst all the librarys on the internet there is certainly source for a routine that converts a point known by 4...
3
by: bhavik | last post by:
Is there a database in .Net which lists all countries, cities, addresses, etc. (first browse and select from avavilable countries, then once specified, all available cities in this country can be...
6
by: David Lozzi | last post by:
Hey All, I need to add a locator service for asp.net where a user would specify a zip code and then the returned list would be displayed in order of closest to furthest. I realize this is a third...
7
by: David Freeman | last post by:
Hi There! I'm trying to create a User Registration page in ASP.NET and wondering what is the best way to get the list of up-to-date Countries and Cities? Are there any Web Services on the web...
1
by: Bob | last post by:
The physical design of my forms changes - control sizes and distances, even where the center of the screen is supposed to be - when a user runs my DotNet applications on a Windows NT machine using...
13
by: racygirl | last post by:
Hi all, I was just wondering, is it possible to write a solution to the following problem with the following criteria: 1. it must be as efficient as possible at run-time 2. be in O(1) 3. and...
0
by: Ronald S. Cook | last post by:
I'm looking for code to calculate the distancde (in miles) between two cities. I'm assuming latitude/longitude would be the inputs (which I'll derive from zip codes being entered by the user). ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.