-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Cleanup routing profile management #1790
Merged
Merged
Conversation
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
sfendrich
changed the title
refactor: Move compute method into SnappingRequest
refactor: Cleanup class RoutingProfile
May 14, 2024
sfendrich
changed the title
refactor: Cleanup class RoutingProfile
refactor: Cleanup crouting profile management
May 14, 2024
aoles
changed the title
refactor: Cleanup crouting profile management
refactor: Cleanup routing profile management
May 14, 2024
aoles
approved these changes
May 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Cheers! ❤️
The compute method was erroneuosly placed in class SnappingService. SnappingService is an API-level class and should not need to know anything about Graphhopper internals. A better place for computing results are the core-level request classes. Fixes #64.
The methods computeMatrix and its private submethods computeDijkstraMatrix, computeRPHASTMatrix and computeCoreMatrix have benn moved from class RoutingProfile into MatrixRequest. This is part of a larger refactoring aiming to move the compute methods out of RoutingProfile in order to enable better polymorphism for future developments.
As a part of cleaning up RoutingProfile the method computeExport is moved to a more appropriate place. This will enable better encapsulation and more Polymorphism later.
The request interfaces for Matrix, Snapping and Export differed in little details. This commit harmonizes the interfaces towards a common interface. The goal is to support polymorphism in the future.
RoutingProfile's unused field mUseCounter is removed together with the methods beginUseGH, endUseGH and isGHUsed and their unnecessary calls throughout the class.
RoutingProfile contains several static helper methods which do not really belong there. These methods are moved into a temporary util class until a better place is found.
In order to move the methods computeRoute and createPTRequest, we need some preparations: - replace direct access to fields mGraphHopper and config by calling the getters - make some of the called methods public - introduce new method parameter RoutingRequest rq and pass the routing request at the call site - introduce a public logger in RoutingRequest and use it instead of RoutingProfile's logger in computedRoute; the public logger will be made private after the move - temporarily provide getters for fields astar* to be used in `computeRoute`; appropriate places for these fields need to be found
As part of refactoring ROutingProfile the compute methods need to be moved into the appropriate request classes.
aoles
force-pushed
the
refactor/routing-profile
branch
from
May 15, 2024 20:30
5c19b87
to
56e4f73
Compare
Quality Gate passedIssues Measures |
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.
Pull Request Checklist
have been resolved.
[Unreleased] heading.
along with a short description of what it is for, and documented this in the Pull Request (below).
(at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
importer etc.), I have generated longer distance routes for the affected profiles with different options
(avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end
points generated from the current live ORS.
If there are differences then the reasoning for these MUST be documented in the pull request.
and why the change was needed.
Fixes # .
Information about the changes
Key functionality added:
computeResult
fromSnappingService
toSnappingRequest
computeMatrix
,computeDijkstraMatrix
,computeCoreMatrix
andcomputeRPHASTMatrix
fromRoutingProfile
toMatrixRequest
computeExport
fromRoutingProfile
toExportRequest
computeRoute
andcreatePTRequest
fromRoutingProfile
toRoutingRequest
Reason for change:
RoutingProfile
in order to permit future developments and to improve maintainability of the code base.Examples and reasons for differences between live ORS routes, and those generated from this pull request
Required changes to ors config (if applicable)