-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#368 improve structure analysis for roundabouts
- Loading branch information
Showing
8 changed files
with
99 additions
and
108 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
.../main/scala/kpn/server/analyzer/engine/analysis/route/analyzers/RouteOneWayAnalyzer.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package kpn.server.analyzer.engine.analysis.route.analyzers | ||
|
||
import kpn.server.analyzer.engine.analysis.route.domain.RouteDetailAnalysisContext | ||
|
||
object RouteOneWayAnalyzer extends RouteAnalyzer { | ||
def analyze(context: RouteDetailAnalysisContext): RouteDetailAnalysisContext = { | ||
new RouteOneWayAnalyzer(context).analyze | ||
} | ||
} | ||
|
||
class RouteOneWayAnalyzer(context: RouteDetailAnalysisContext) { | ||
|
||
def analyze: RouteDetailAnalysisContext = { | ||
|
||
val oneWayRouteForward = context.relation.hasTag("direction", "forward") | ||
val oneWayRouteBackward = context.relation.hasTag("direction", "backward") | ||
|
||
val oneWayRoute = context.relation.hasTag("oneway", "yes") || context.relation.hasTag("signed_direction", "yes") | ||
|
||
context.copy( | ||
_oneWayRouteForward = Some(oneWayRouteForward || oneWayRoute), | ||
_oneWayRouteBackward = Some(oneWayRouteBackward), | ||
) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
57 changes: 0 additions & 57 deletions
57
...t/scala/kpn/server/analyzer/engine/analysis/route/structure/test/Structure_N19_Test.scala
This file was deleted.
Oops, something went wrong.
This file contains 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