Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to calculate the distances between each node? #23

Closed
kyungeuuun opened this issue Feb 26, 2019 · 4 comments
Closed

How to calculate the distances between each node? #23

kyungeuuun opened this issue Feb 26, 2019 · 4 comments

Comments

@kyungeuuun
Copy link

Hello, Li.
I wonder how to calculate the distances between each node.
(According to README.md (Graph Construction), this part is being added, but it is not provided yet.)

I calculated some distances using Google map,
however, my results were different from yours.
For example, for the case of 773906 > 767471,
my result was 13.0km, and the value from your data was 10419.9m.

Could you please explain how to calculate node-to-node distance,
or provide the data for this process?

@liyaguang
Copy link
Owner

Hi kyungeuuun,

The distance between two locations/nodes are calculated using A* search on the road network. A map is needed for this calculation.
Besides, the discrepancy of the distance may because of the following two aspects:

  • The provided is based on a map is pretty old (e.g., 2012), thus there might be road closure.
  • The error in mapmatching, i.e., mapping a point to a node/edge on the road network.

You may the Euclidean distance between two nodes as a starting point.

@sshleifer
Copy link

sshleifer commented Oct 17, 2019

Imagine we have one sensor on a northbound highway i and one on a southbound highway j at roughly the same exit. Would the "road network distance" for i,j be how long it takes to get off the highway, get back on the highway and drive south to the other sensor (in meters)?

@liyaguang
Copy link
Owner

Hi @sshleifer , the road network distance is shortest distance the vehicle has to travel from the source to the destination under the constraint imposed by the network. If

get off the highway, get back on the highway and drive south to the other sensor

is the shortest distance, it will be the case.

@liyaguang liyaguang pinned this issue Jan 13, 2020
@ThomasAFink
Copy link

Here's how I created my own distance matrix: https://github.com/ThomasAFink/osmnx_adjacency_matrix_for_graph_convolutional_networks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants