Calculate Distance between cities using latitude and longitude

475 pts.
Tags:
AS/400
RPG Program
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.

Software/Hardware used:
RPG ILE CLLE

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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.
    .
    Other members might have better info.
    .
    Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    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.
    6,365 pointsBadges:
    report
  • TomLiotta
    A commercial product is the way to go, and MileMaker looks like a good start. WoodEngineer provides a good rescue for this thread. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following