Closed daniel-j-h closed 7 years ago
This is a must validator to have. Based on my knowledge - we use OSM-QA tiles and tile-reduce for most of the linters scripts to detect tagging and connectivity errors. But I don't think OSM-QA tiles have turn-restriction in it.
@Rub21 how can we build this validator?
cc @daniel-j-h
Thats right osm-qa tiles do not have turn restrictions.
@ramyaragupathy have we ever made a global tileset of turn restrictions?
Also here's an interesting web QA tool for TR: http://restrictions.morbz.de/#15/37.78645/-122.40611
Nope, but this can be done with osmlazer @planemad
Flagging: there is also an edge case with no_entry
and no_exit
which we stumbled upon lately
https://github.com/Project-OSRM/osrm-backend/issues/4241
and our routing engine does not handle it yet. It's on our feature list to implement.
What's interesting in the context of validators is @mokob sampled the OpenStreetMap data for no_entry
and no_exit
and found quite a few issues with how they're getting used and simple mis-uses. At the moment there are only a couple hundreds no_entry
s and no_exit
s in the dataset - it could make sense to check them, too.
@daniel-j-h , I thought this could be possible using the Multipolygon mbtiles that have been in the test(this contain some relations) but not, it does not contain the TR relations.
@ramyaragupathy could we get TR data from osmlazer as geojson? @daniel-j-h , Maybe do you know other ways to get these TR data as geojson?
if it so, we could use the geojson to combine with the osm-qa-tiles to do the analysis and detect those invalid TR.
could we get TR data from osmlazer as geojson?
Nope, only the count works @Rub21
Worked w/ @planemad to expand on earlier work of grouping relations. Script here regroups relations by their ID & append member geometries to each relation in a GeometryCollection.
We ran it against TRs in SF & got the geojson formatted to represent relations as Geometry Collection. Contents are shared in dropbox.
SFTR_Input.geojson
SFTR_reorganised.geojson
& output.mbtiles
Sample file of a TR as GeometryCollection.
All relation related properties at feature level:
"properties": {
"type": "restriction",
"restriction:type": "no_left_turn",
"restriction:id": 6191617,
"members": [
{
"label": "from"
},
{
"label": "via"
},
{
"label": "to"
}
]
}
members
array within properties
store info on each role that constitutes a TR.
Order within the member array matches the geometry order within geometries
array of a feature.
cc @Rub21 @daniel-j-h @srividyacb @maning
@ramyaragupathy This is nice!! the mbtiles works fine!! , I am doing some analysis to detect invalid TR, but I could not find to any of this in SF, could you create a mbtiles for US?
@ramyaragupathy nice work! the output.mbtiles you posted above doesn't seem to have any GeometryCollections. Is that right?
@Rub21 @ramyaragupathy @planemad - just want to flag that Tile Reduce does not support GeometryCollections, unfortunately, which means OSMLint may not work. We have tried this before.
Looks like tippecanoe just treats each geometry within the GeometryCollection
as a separate feature, instead of treating all the geometries as an unit @geohacker @planemad @Rub21
Thinking of osmium here. For relations, though it does not return the geometry data, it contains details that can be used to generate geometries:
{ restriction: 'only_right_turn', type: 'restriction' }
[ { type: 'w', ref: 478760157, role: 'from' },
{ type: 'n', ref: 176581223, role: 'via' },
{ type: 'w', ref: 61840757, role: 'to' } ]
From the id, geometries can be obtained and then linters could be run in the same script for validation.
geometries can be obtained and then linters could be run in the same script for validation.
This is not the pattern we follow in OSMLint, so this validator will have to be outside of this repository.
yeah the workflow will be different from the existing ones @geohacker
Because mbtiles does not support relation, we created another report to detect invalid relations https://github.com/osmlab/osmlint-osmium/tree/master/validators
Close this ticket here!!
(I haven't found a validator for this - if we already have one in place feel free to close this)
For turn restrictions of the form
(fromWayId, viaNodeId, toWayId)
theviaNodeId
needs to connect the wayfromWayId
to the waytoWayId
. Turn restrictions where the via node is not shared across the two ways are invalid.Our routing engine filters via-node turn restrictions that are invalid and discards them. We should have a validator in place since this type of error should be easy to detect and fixing it is of high value for routing.
Related to that - turn restrictions have a well-defined format:
http://wiki.openstreetmap.org/wiki/Relation:restriction#Members
the relation members have to be:
from
- of typeway
, exactly 1 way, except can be multiple ways only whenno_entry
restriction!to
- of typeway
, exactly 1 way, except can be multiple ways only whenno_exit
restriction!via
- either a singlenode
or multipleways
We should have a validator in place for checking all turn restrictions making sure they conform to this schema.
cc @srividyacb @Rub21