Reputation: 47
I'm a beginning programmer that wants to start learning a bit more advanced stuff. Therefore I would like to write a simple java program where a user can input two cities with their respective countries and the output would then be the distance between these two cities.
I wanted to do this using the OpenStreetMap API but I'm having a really hard time trying to make sense of it all. My question is the following. Is this a program that a beginner should be able to write or am I really underestimating this? Could anybody maybe point me in the right direction or is there a great online resource for this stuff.
I've been reading up on their wiki but it's not really helping.
Thanks in advance.
Upvotes: 0
Views: 5000
Reputation: 21469
Take a look at the list of online routers for OSM. Choose one that fits your needs (e.g. GraphHopper) and call it's API with your two cities. Then just parse the returned data (usually JSON or GPX).
If you need the location (i.e. coordinates) for these cities then take a look at Nominatim or one of the other geocoders for OSM.
This is a job a "beginner" should be able to solve given that the has some basic understanding in programming and APIs.
Upvotes: 2