Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7521893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:21:40+00:00 2026-05-30T02:21:40+00:00

I need the ability to calculate walking distance between 2 points without calling an

  • 0

I need the ability to calculate walking distance between 2 points without calling an outside webservice like Google Maps. Google Maps provides an API called the Distance Matrix API, which is perfect for what I need to do, but it has limits and requires that I make a call to a web service. Fortunately, my longitude and latitude points will be limited to one city, so it is not as if I need to be able to query any 2 points in the world and calculate walking distance as Google Maps Distance Matrix API would provide.

I realize that this would probably require a lot of storage on the backend to maintain street routes and I don’t know if this is a totally crazy request, but if anyone knows of a way to do this or a library that provides similar functionality any help would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:21:41+00:00Added an answer on May 30, 2026 at 2:21 am

    You can get the data you’d need from http://www.openstreetmap.org in the form of .osm files.

    These are xml files that contains the road you’ll need. You can read more about osm and on their wiki page.

    If you only want distances and don’t care about the actual routes, that’ll make your task a lot easier.

    Write a script to parse the .osm file. Extract the nodes and edges that are relevant, no highways, rivers, or anything else that can’t be walked on. Then take this data and put into a graph data structure of some sort.

    From there, if you want the distance between two points, just run Dijkstra’s Algorithm. If you want to store all possible distances, just run Dijkstra once from each node in graph, storing the distances each time.

    <node id="111" lat="41" lon="-74" // more stuff here>  
        <tag k="x" v="y"/> ... // These are the various attributes of a node, optional
    </node>
    <node id='112' ..../>
    <way id='555'>
        <nd ref='111'/> // These are the nodes that make up the way
        <nd ref='112'/>
        <nd ref='543'/>
        ...
        <tag k='highway' v='primary'/>
        <tag k='name' v='E. 42nd Street/>
    </way>
    

    As you can see, a way can have more than 2 nodes within it. You’ll need to break up each way into sets of pairs of nodes, so this file would become something like this
    Frm, To, Weight
    111, 112, dist(111,112)
    112, 111, “
    112, 543, dist(112,543)
    543, 112, “
    …

    You’d also have to deal with one way streets, and other complicating factors. Not all ways are roads, so you’d have to check that.

    These files can also be very large, depending on the bounds of the region and how much stuff is in that particular region.

    You’re absolutely correct about having to write a ton of custom code to scrape the data. I’ve done it myself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need ability to display content in Hex View, like this from WinHex Offset
I need the ability to use custom locks at a session level (outside the
is it possible to use Paperclip without a model? I just need the ability
We need the ability to gracefully resize any photo/image to an exact width/height without
for a forum-like application I need the ability to show each user the unread
I need the ability to run an arbitrary command when I try and commit
i am working on a small project that i need the ability to let
I have an app using a SQLite db, and I need the ability for
I was in need of the ability to create a PDF Envelope, and hadn't
Any recommended crypto libraries for Java. What I need is the ability to parse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.