Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is based on the branch osm-default-speeds, which could be merged to master in my opinion.
This PR includes:
ref~^I
andhighway~^motorway|motorway_link$
" (resulted inref~^Iandhighway~^motorway|motorway_link$
prior to the fix)The output schema is now
Reasons:
it is not helpful to have the road names/filters as a key in a map. They are not accessed by key.
the order of the speed limits has an important and semantic meaning, so the order from the table must not be changed:
we can not realistically assume that we have a (community approved) mapping of tags to road categories for all the roads in all the countries (initially). So let's have a data structure that accomodates for incomplete metadata. In the above data structure, a road category can have a name and optionally a filter. Of course a filter is necessary to actually do anything with the data OSM-wise, but it might not always be available
I think it is better if we bake all the maxspeed data into OSM tags (
maxspeed:goods=...
) instead of group them by category:I don't reckon a common use case where it makes sense to categorize the speed limits by vehicle type (
"goods": { ... }, "hgv": { ... }
).A router using OSM data will need to parse the full maxspeed schema anyway, so it is no extra effort to interpret data in that form while it might be extra effort in the current form.
Current schema is a source of error (based on misinterpretation), because one might assume that if I drive a hgv, only the rules specified under the "hgv" key apply to me. This is not the case because the rules for "goods" if any apply to me as well, plus also each the default rules IF the unconditional maxspeed is not overwritten:
There should be a way to output warnings / errors without completely exiting the parsing. So I thought the warnigs and errors could be included in the output json. Maybe there is a better method though. (Output warnings on the console while requiring the "real" output to be a filename?)