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

Make distance_table consistent regarding different phantom nodes #1447

Closed
chaupow opened this issue Apr 22, 2015 · 3 comments
Closed

Make distance_table consistent regarding different phantom nodes #1447

chaupow opened this issue Apr 22, 2015 · 3 comments
Assignees
Milestone

Comments

@chaupow
Copy link
Member

chaupow commented Apr 22, 2015

Currently the distance table is getting a list of locations that might have more than one phantom node per input coordinate.
Distance table should be changes such that

  1. when computing the distance table, for every location the same phantom node is used
  2. when returning output, there should not only be the information about the distances but also which phantom node was used in the process
@TheMarex
Copy link
Member

TheMarex commented Dec 1, 2015

More background here:

The main problem is this part of the code. The for every location the phantom_node_vector that is returned by StaticRTree is inserted. This vector usually contains up to 2 phantom nodes, one from a big and one from a small component.

Example: We have two locations loc1: {a, b} and loc2: {c, d}. The result of the query should be a table of size 2x2. First step is to initialize the backward heap and run the backward search for each location. For loc1 that would mean we insert a and b in the heap and run the backward search. All nodes that are found by the backward search are marked with the distance to a or b, depending on which one is shorter. But we don't save from which node the distance actually is.

Possible fixes:

  • Retain the information for each node. When we do the backward search we retain information about the "original parent" in the heap data. This would mean modifying this line and this line to set the parent not to node but to parent of node. For all nodes found in the backward search in the example above that would yield nodes either marked a or b.
  • Decide on exactly one phantom node. This would need similar logic as in viaroute. Running this on the list of coordinates would discard all the small components if they are not from the same small component.

@danpat
Copy link
Member

danpat commented Dec 1, 2015

So, to clarify the behaviour we're going for here:

  • If all nodes snap to a big component, we simply route those
  • If some components snap to small components and have nearby big components, and everything snaps to a big component, snap to to the big components (i.e. city parks < 1100m from a big components).
  • If all components snap to the same small component, use that.
  • If some components snap only to a small component, use that (i.e. islands more than 1100m from a big component).

@TheMarex
Copy link
Member

This was implemented to be consistent with viaroute. It uses the same snapping behavior.

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

No branches or pull requests

3 participants