Getting Distance between two addresses
I need help , i am doing a school assignment which involves creating an application which a user can input two addresses and output the driving distance between them.
I don't have a clue whether it can be done or where to start
Can you please give me an idea on where to start
Thanks in advance :)
Re: Getting Distance between two addresses
check out Scanner (Java 2 Platform SE 5.0)
or you could go on youtube and search for name "thenewboston" he has beginner java tutorials like 60 or so and explains nicely everything
Re: Getting Distance between two addresses
Quote:
Originally Posted by
Shockwave786
I don't have a clue whether it can be done
Funny enough some problems can not be solved, but that is a different story.
Quote:
Originally Posted by
Shockwave786
or where to start
Can you please give me an idea on where to start
Sure can:
Quote:
Originally Posted by
Shockwave786
...a user can input two addresses...
You said it yourself mate. derekxec mentioned a class which will assist in doing just that.
Re: Getting Distance between two addresses
Quote:
Originally Posted by
Shockwave786
...whether it can be done...
I think I would work on this part before getting too deep into implementation details.
I mean, forget Java for a minute. Forget programming. Forget everything except the problem:
If you wanted to give someone driving instructions to get from, say, 950 Mission Street in San Francisco, California, to, say, 1807 Telegraph Avenue in Oakland, California, how would you do it? If you can't figure out this part, then there's not much use in wasting a lot of time learning some programming language just for this task, right?
Well since I don't live in San Francisco or Oakland, I don't know how to get from Point A to Point B, but I do know how to get driving instructions from Google or Bing or MapQuest or ...
So, before trying to figure out how I would create the driving instructions, I might try one of those sites to see what they present.
Wow! It's all there: How to get from Point A to Point B. Amazing!
Now, here's the thing. It took hundreds of programmers (thousands, probably) many man-hours (thousands, hundreds of thousands, whatever) to create the applications and probably even more resources to create a data base that can be used to tell us how to get from Point A to Point B for just about anywhere on the planet.
How the heck could anyone do that as a homework assignment? (That's a rhetorical question. I don't need to see your answer. The site's swear filter would probably redact most of your response anyhow.)
Well, here's what I might do: I would see if there were any references on the web that talked about embedding driving instructions into a Java program.
A couple of potentially useful hits:
Getting Started with Bing Maps in Java
Google Maps API
Etc.
Now, it still might be pretty hairy for a beginning Java programmer to implement a program using stuff like that, but maybe it gives you something to be thinking about as you work your way through Java tutorials or other reference material.
Cheers!
Z