We currently have a program that returns a locations latitude and longitude. Searching the web I've located an RPG program that calculates the distance between 2 locations however it gives me the miles using a straight line. When I search Google maps it shows me the distance in miles using the shortest route but it is more than my calculated route as Google maps uses roads instead of a straight line. Is there a way in RPG/ILE to retrieve Google distances like we currently do for the latitude and longitude? We are on V7r1. We need more accurate distance calcs for transportation costs. Thank you in advance.
I'm not aware of anyone making this available, and the Google Maps APIs have restrictions described in Terms of Service agreements. I don't believe a result is available outside of javascript and for purposes of displaying a map. (AFAIK, there is no legal HTTP interface.) For driving distances, you should closely review the The Google Distance Matrix API. There might be "business" contracts or agreements that you can make with Google to purchase access to their data.
.
If you want to do it in RPG (or any server programming language), you'll need a database of roads and distances. You might be able to adapt The National Map databases from the USGS or related federal databases somehow. It is not a trivial task, though there might be libraries of functions that you can purchase. I'm not aware of open-source projects.
Check out MileMaker from Rand McNally. This will do exactly what you want on your IBM i. We have used it for over five years. Works great. In fact, an updated version of MileMaker was just released which lets you know the product is alive and well.
Discuss This Question: 3  Replies