Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osrm-profiles-car
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NAOS
Mapotempo
osrm-profiles-car
Commits
14e550f7
Commit
14e550f7
authored
6 years ago
by
Alain ANDRE
Committed by
Alain ANDRÉ
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Apply penalties after speed reduction
parent
0e9f2328
Branches
car-interurban
Branches containing commit
Tags
car-interurban-v5.21.0.2
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
car.lua
+1
-1
1 addition, 1 deletion
car.lua
lib/mapotempo.lua
+4
-2
4 additions, 2 deletions
lib/mapotempo.lua
with
5 additions
and
3 deletions
car.lua
+
1
−
1
View file @
14e550f7
...
...
@@ -434,7 +434,6 @@ function process_way(profile, way, result, relations)
WayHandlers
.
speed
,
WayHandlers
.
surface
,
WayHandlers
.
maxspeed
,
WayHandlers
.
penalties
,
-- compute class labels
WayHandlers
.
classes
,
...
...
@@ -442,6 +441,7 @@ function process_way(profile, way, result, relations)
-- set penalties after setting classes with urban density
Mapotempo
.
penalties
,
WayHandlers
.
penalties
,
-- handle turn lanes and road classification, used for guidance
WayHandlers
.
turn_lanes
,
...
...
This diff is collapsed.
Click to expand it.
lib/mapotempo.lua
+
4
−
2
View file @
14e550f7
...
...
@@ -68,10 +68,12 @@ function Mapotempo.penalties(profile,way,result,data)
-- decrease speed only some way types (unclassified, residential, living_street)
if
width
<=
3
or
(
lanes
<=
1
and
is_bidirectional
)
then
if
(
result
.
forward_classes
[
"w1"
]
==
false
and
result
.
forward_classes
[
"w2"
]
==
true
and
result
.
forward_classes
[
"w3"
]
==
true
)
then
if
result
.
forward_classes
[
"l1"
]
==
false
and
result
.
forward_classes
[
"l2"
]
==
false
and
(
result
.
forward_classes
[
"w1"
]
==
false
and
result
.
forward_classes
[
"w2"
]
==
true
and
result
.
forward_classes
[
"w3"
]
==
true
)
then
result
.
forward_speed
=
result
.
forward_speed
/
2
end
if
(
result
.
backward_classes
[
"w1"
]
==
false
and
result
.
backward_classes
[
"w2"
]
==
true
and
result
.
backward_classes
[
"w3"
]
==
true
)
then
if
result
.
backward_classes
[
"l1"
]
==
false
and
result
.
backward_classes
[
"l2"
]
==
false
and
(
result
.
backward_classes
[
"w1"
]
==
false
and
result
.
backward_classes
[
"w2"
]
==
true
and
result
.
backward_classes
[
"w3"
]
==
true
)
then
result
.
backward_speed
=
result
.
backward_speed
/
2
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment