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

Support modification of speed limit extraction #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jongiddy
Copy link
Contributor

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:

  • supports speed limits with no space between the number and "mph"
  • replaces the hard-wired path in one test with a generated path
  • adds an __init__.py file to allow testing to be run using python -m unittest discover from the tools directory
  • cleans up some minor PEP8 style issues

The 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).

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

Successfully merging this pull request may close these issues.

1 participant