Skip to content

Commit b742818

Browse files
authored
Merge pull request #943 from GIScience/bugfix#940-discard_maxspeed=0
Use OSM maxspeed tag only if its value >0
2 parents 14d6f6f + 19b4883 commit b742818

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ RELEASING:
3838
- Time-dependent core-based routing algorithms
3939
- Option to disable edge-based routing in core for a single weighting ([#928](https://github.com/GIScience/openrouteservice/issues/928))
4040
### Fixed
41+
- Do not consider ill-defined "maxspeed = 0" OSM tags ([#940](https://github.com/GIScience/openrouteservice/issues/940))
4142
- Config file parameter to set the number of active landmarks for core routing ([#930](https://github.com/GIScience/openrouteservice/issues/930))
4243
- Make sure A* with beeline approximation is used as default fallback algorithm ([#926](https://github.com/GIScience/openrouteservice/issues/926))
4344
- Prioritize graph build date over data date in routing request ([#925](https://github.com/GIScience/openrouteservice/issues/925))

openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/flagencoders/VehicleFlagEncoder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ protected double getSpeed(ReaderWay way) {
368368
return speed;
369369
}
370370

371+
@Override
372+
protected double applyMaxSpeed(ReaderWay way, double speed) {
373+
double maxSpeed = this.getMaxSpeed(way);
374+
return maxSpeed > 0.0D ? maxSpeed * 0.9D : speed;
375+
}
376+
371377
/**
372378
* @param way: needed to retrieve tags
373379
* @param speed: speed guessed e.g. from the road type or other tags

openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/flagencoders/bike/CommonBikeFlagEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public long handleRelationTags(long oldRelationFlags, ReaderRelation relation) {
395395
@Override
396396
protected double applyMaxSpeed(ReaderWay way, double speed) {
397397
double maxSpeed = getMaxSpeed(way);
398-
if (maxSpeed >= 0 && maxSpeed < speed) {
398+
if (maxSpeed > 0 && maxSpeed < speed) {
399399
return maxSpeed;
400400
}
401401
return speed;

0 commit comments

Comments
 (0)