Skip to content

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
copilot/add-latvia-living-zone-speed
Mar 1, 2026
Merged

Add Latvia living_street default speed mapping (LV:living_street → 20 km/h) for car profile and taginfo#7386
DennisOSRM merged 3 commits intomasterfrom
copilot/add-latvia-living-zone-speed

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

This updates car profile handling for Latvian living zones, where living_street should 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

    • Added lv:living_street = 20 to profiles/car.lua maxspeed_table.
    • Keeps change scoped to symbolic maxspeed resolution only.
  • Behavioral coverage: cucumber scenario

    • Added a dedicated scenario in features/car/maxspeed.feature for highway=living_street with maxspeed=LV:living_street.
    • Asserts routed forward/backward speed at 16 km/h +-1 (profile speed reduction applied, with rounding tolerance for short segments).
  • Taginfo metadata update

    • Added {"key": "maxspeed", "value": "LV:living_street"} to taginfo.json so the supported symbolic maxspeed value is documented in taginfo output.
-- profiles/car.lua
maxspeed_table = {
  ...
  ["lv:living_street"] = 20,
  ...
}

[!WARNING]

Original prompt

This section details on the original issue you should resolve

<filter_complete></filter_complete>

<issue_title>Living zone maxspeed=20 in Latvia</issue_title>
<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 always 20 kmh. 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_street and 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_limits
Original prompt

This section details on the original issue you should resolve

<issue_title>Living zone maxspeed=20 in Latvia</issue_title>
<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 always 20 kmh. 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_street and 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](https://github.com/Project-OSRM/osrm-backend/blob/e590dae5f6638a2165af997c2da2fc1d7d7ea676/profiles/car.lua#L155) which we use as default as I can see) https://wiki.openstreetmap.org/wiki/Default_speed_limits

🔒 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.

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 living_street default speed mapping (LV:living_street → 20 km/h) for car profile Mar 1, 2026
@DennisOSRM
Copy link
Copy Markdown
Collaborator

@copilot add lv:living_street to tag info json

Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 1, 2026

@copilot add lv:living_street to tag info json

Added in commit e5b71ab. taginfo.json now includes {"key": "maxspeed", "value": "LV:living_street"}.

Copilot AI changed the title Add Latvia living_street default speed mapping (LV:living_street → 20 km/h) for car profile Add Latvia living_street default speed mapping (LV:living_street → 20 km/h) for car profile and taginfo Mar 1, 2026
@DennisOSRM DennisOSRM marked this pull request as ready for review March 1, 2026 20:36
@DennisOSRM DennisOSRM requested a review from Copilot March 1, 2026 21:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = 20 to the car profile’s maxspeed_table for symbolic maxspeed resolution.
  • Added a cucumber scenario asserting the expected routed speed (16 km/h +-1) for LV:living_street on highway=living_street.
  • Updated taginfo.json to document support for maxspeed=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.

@DennisOSRM DennisOSRM merged commit e3ff540 into master Mar 1, 2026
27 checks passed
@DennisOSRM DennisOSRM deleted the copilot/add-latvia-living-zone-speed branch March 1, 2026 21:55
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.

Living zone maxspeed=20 in Latvia

3 participants