Add Latvia living_street default speed mapping (LV:living_street → 20 km/h) for car profile and taginfo#7386
Merged
DennisOSRM merged 3 commits intomasterfrom Mar 1, 2026
Conversation
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add max speed exception for living zones in Latvia
Add Latvia Mar 1, 2026
living_street default speed mapping (LV:living_street → 20 km/h) for car profile
Collaborator
|
@copilot add lv:living_street to tag info json |
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Add Latvia
Add Latvia Mar 1, 2026
living_street default speed mapping (LV:living_street → 20 km/h) for car profileliving_street default speed mapping (LV:living_street → 20 km/h) for car profile and taginfo
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Latvia-specific handling for maxspeed=LV:living_street in the car profile so living streets resolve to 20 km/h (and thus route at the expected reduced speed), with accompanying cucumber coverage and taginfo metadata.
Changes:
- Added
lv:living_street = 20to the car profile’smaxspeed_tablefor symbolic maxspeed resolution. - Added a cucumber scenario asserting the expected routed speed (
16 km/h +-1) forLV:living_streetonhighway=living_street. - Updated
taginfo.jsonto document support formaxspeed=LV:living_street.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| taginfo.json | Documents LV:living_street as a supported maxspeed value in taginfo output. |
| profiles/car.lua | Adds Latvia-specific symbolic maxspeed mapping for living streets (20 km/h). |
| features/car/maxspeed.feature | Adds cucumber coverage to lock in Latvia living_street symbolic maxspeed behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 updates car profile handling for Latvian living zones, where
living_streetshould resolve to 20 km/h instead of the generic fallback behavior. It also adds focused cucumber coverage to lock in the country-specific interpretation and updates taginfo metadata accordingly.Profile change: Latvia-specific symbolic maxspeed
lv:living_street = 20toprofiles/car.luamaxspeed_table.Behavioral coverage: cucumber scenario
features/car/maxspeed.featureforhighway=living_streetwithmaxspeed=LV:living_street.16 km/h +-1(profile speed reduction applied, with rounding tolerance for short segments).Taginfo metadata update
{"key": "maxspeed", "value": "LV:living_street"}totaginfo.jsonso the supported symbolic maxspeed value is documented in taginfo output.Original prompt
<issue_description>Hello!
Please add an exception to https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/car.lua#L270 for Latvia for
living_street, which is always20kmh. I suppose it would be["lv:living_street"] = 20.The relevant Latvia Road Law is at point 101. at https://likumi.lv/ta/en/en/id/274865. These always have a living zone entry/exit sign.
Per Latvian tagging guidelines https://wiki.openstreetmap.org/wiki/Lv:Latvian_tagging_guidelines#Mazāki_ceļi, living zones are tagged as
living_streetand other streets are not.Thanks.
P.S. I don't know about your specifics of routing penalties, but these should likely be penalized as well for various practical reasons, but that's a separate issue.
P.S.S. I would note that some other countries have living zones too with specific max speeds, especially post-Soviet countries. Someone probably might like to do the same for others.</issue_description>
<agent_instructions>Implement the speed limit for living streets in Latvia as 20kmh as listed in this issue. Verify the implementation by adding a cucumber test. Note that on short segments there can be rounding errors when going from time and distance to speed. Use +-1 as approximation.
if possible verify the tagging rules and the mentions Latvia road law.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@SiarheiFedartsou Btw it looks like there are a lot of cities where it should be 20 kmh(but not 10kmh which we use as default as I can see) https://wiki.openstreetmap.org/wiki/Default_speed_limitsOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.