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

Relation:restriction is invalid #6322

Closed
GitBenjamin opened this issue Aug 22, 2022 · 15 comments
Closed

Relation:restriction is invalid #6322

GitBenjamin opened this issue Aug 22, 2022 · 15 comments
Labels

Comments

@GitBenjamin
Copy link
Contributor

GitBenjamin commented Aug 22, 2022

#Hello, Everyone! I have a question.
@danpat @mjjbell @daniel-j-h

Through OpenStreetMap wiki, I learned that I could use Relation:restriction to solve some turning problems.
https://wiki.openstreetmap.org/wiki/Relation:restriction
For example,
image

<relation id="1" changeset="1" timestamp="2022-08-22T06:58:29Z" user="zhou" uid="4437318">
 <member type="way" ref="a" role="from"/>
 <member type="way" ref="b" role="via"/>
 <member type="way" ref="c" role="to"/>
 <tag k="restriction" v="no_right_turn"/>
 <tag k="type" v="restriction"/>
</relation>

but, the.OSM file that i compiled with this format does not solve the turning problem.

Is it because OSRM doesn't support it yet?

Historically, this “way-vias” (fromWayId, viaWayId, toWayId) has been tried to handle

#2681

@mjjbell
Copy link
Member

mjjbell commented Aug 22, 2022

Restrictions are supported by OSRM.

Can you share an OSM link to the junction in question, or a link to the OSM file you are using?

@GitBenjamin
Copy link
Contributor Author

Restrictions are supported by OSRM.

Can you share an OSM link to the junction in question, or a link to the OSM file you are using?

Have “way-vias” (fromWayId, viaWayId, toWayId) and “node-vias” (fromWayId, viaNodeId toWayId) been supported?
Is it because CH supports it, but MLD still doesn't?

I'm using SHP files to convert to OSM files, so the output file is huge. I can upload part of the file, could you please help to analyze it? The content format of the files is basically the same.

@mjjbell
Copy link
Member

mjjbell commented Aug 22, 2022

Have “way-vias” (fromWayId, viaWayId, toWayId) and “node-vias” (fromWayId, viaNodeId toWayId) been supported?

Yes, it supports both

Is it because CH supports it, but MLD still doesn't?

Processing of restrictions happens prior to algorithm specific processing. It is supported by both.

I'm using SHP files to convert to OSM files, so the output file is huge. I can upload part of the file, could you please help to analyze it? The content format of the files is basically the same.

It will be hard to reproduce correctly if the whole file is not available. Given that you're converting from another data source, I suspect the problem is somewhere in the conversion logic.

@GitBenjamin
Copy link
Contributor Author

GitBenjamin commented Aug 22, 2022

Maybe I'm using an older version? It's Version 5.23.0

Unreleased

This is part of the OSM file.
test.osm

@nilsnolde
Copy link
Contributor

having done this kind of exercise quite often, I also suspect connectivity problems for the relation. you can check that somewhat with osmium, e.g. osmium getid --add-referenced <osm_file> <turn_restriction_id> which should output the right ways, i.e. find the ways by id and their node id's & coordinates. visualizing in josm also helps a lot if you break it down to a small area (josm gets really slow for larger extracts than a few MB).

@GitBenjamin
Copy link
Contributor Author

Well, thank you very much for your suggestion. I'll try it out.

@GitBenjamin
Copy link
Contributor Author

Maybe I'm using an older version? It's Version 5.23.0

Unreleased

This is part of the OSM file. test.osm

@mjjbell I wonder if this file will give us any clues.

#5907
Does the latest master branch already contain the change? If so, can I try it with the latest master?

@mjjbell
Copy link
Member

mjjbell commented Aug 22, 2022

@mjjbell I wonder if this file will give us any clues.

Yes, the relations refer to ways and nodes that don't exist in the file. You'll need to figure out why that's happening.

@GitBenjamin
Copy link
Contributor Author

@mjjbell I wonder if this file will give us any clues.

Yes, the relations refer to ways and nodes that don't exist in the file. You'll need to figure out why that's happening.

The original data in the file contains these nodes and ways, because some nodes and ways are deleted randomly.
The point is, is there a problem with the format?
Thank you very much for your answer. I will make some attempts according to your answer.

Please do not close the issue yet.

@nilsnolde
Copy link
Contributor

nilsnolde commented Aug 22, 2022

The original data in the file contains these nodes and ways, because some nodes and ways are deleted randomly.

Can you use “osmium extract” for the extraction? By default it will complete ways, ie pull in all nodes of all ways which appear spatially in the bbox you’re extracting with. We need the full topology extracted from your OSM file for your relation: all way and node objects it’s referencing (recursively) in case they all even exist.

@GitBenjamin
Copy link
Contributor Author

Maybe I'm using an older version? It's Version 5.23.0

Unreleased

This is part of the OSM file. test.osm

@mjjbell I suspect the 5.23.0 branch does not support via-ways.

i made a try, i routed it using the branch 5.23.0 and my test.osm data, and the result was wrong. But, when i routed with the branch 5.26.0 and the same test data, the results were correct.

@mjjbell
Copy link
Member

mjjbell commented Sep 8, 2022

I see. Single via-ways are supported in 5.23.0 and multiple via-ways were added in 5.24.0, so I suspect that's the change that made the difference.

@GitBenjamin
Copy link
Contributor Author

GitBenjamin commented Sep 9, 2022

the test data does not contain multiple via-ways. you can verify the problems that with 5.23.0 and 5.24.0 on via-ways.

@GitBenjamin
Copy link
Contributor Author

osmium getid --add-referenced <osm_file> <turn_restriction_id>

I'm learning how to use osmium. Also, are there any tools to visualize the .osm data?

Copy link

github-actions bot commented Jul 8, 2024

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jul 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants