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

Identify start and end nodes of a Way{Int64} #54

Open
fbanning opened this issue Dec 10, 2021 · 2 comments
Open

Identify start and end nodes of a Way{Int64} #54

fbanning opened this issue Dec 10, 2021 · 2 comments

Comments

@fbanning
Copy link
Contributor

Say I want to look at a specific w::Way{Int64}. I can access w.nodes and get a vector of nodes that the way is made up of.
I wonder if there is a way to identify the start and end node of a given Way{Int64}?

@hs-ye
Copy link
Contributor

hs-ye commented Dec 11, 2021

The w.nodes are in order (as they appear in the original .osm data), so you can just access the start and end of the way using w.nodes[1] and w.node[end]

@mmiller-max
Copy link
Contributor

I think it's not quite as straight forward as that for determining the start and end though.

For a two-way way then yes you can just take the order of way.nodes and the reverse order to get the two lists of nodes. For a one-way there I think you need to check a tag to know which is the start - sorry I'm away from the computer so can't check this at the moment.

Perhaps we could provide an API for getting the start and end mode of a one way way?

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

3 participants