Support modification of speed limit extraction #40
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.
OSM maps for UK occassionally use integers for speed limits in MPH. Also, some roads have textual limits like "national". To handle these properly, it is useful to be able to simply modify the code that interprets the OSM maxspeed tags. For presentation purposes it can also be useful to allow represention of the speed limit in the database in MPH.
To simplify modification of the map ingest to support such modifications, this patch separates the interpretation of the speed limit string into a separate function
extract_speed_limit
.In addition, the patch:
__init__.py
file to allow testing to be run usingpython -m unittest discover
from thetools
directoryThe patch does not actually support the UK-specific cleanups or use of MPH. Those changes need to be added separately (and other national variations may exist).