This repository has been archived by the owner on Mar 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 273
WIP: handling viterbi breaks as multiple sequences #87
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2c1a010
initial work for handling viterbi breaks as multiple sequences
kodonnell d979ffd
handle case where viterbi breaks immediately after initialization
kodonnell 6b856f1
merge U-turn work
kodonnell ade4037
refactoring sequences
kodonnell 4b24cbc
use MatchEntry internally instead of GPXEntry
kodonnell 5832623
debug and fix tests
kodonnell b6c3af4
rename timestep -> viterbimatchentry
kodonnell c0e5574
fix other tests
kodonnell 2d184a2
tidying calcpath and gpxfile/main
kodonnell 791e53c
web stuff ...
kodonnell eed78bf
giving up on that test ...
kodonnell ac105e7
woops, don't need that anymore ...
kodonnell d6bf213
refactor + tidy + all tests passing
kodonnell 4e217d0
contiguous sequences
kodonnell f629883
undo test change to fix test change
kodonnell 9e6cc60
add logging in again as per @stefanholder's request
kodonnell 9d6f84b
Merge branch 'master' into sequences
kodonnell 7f45557
note funny bug ...
kodonnell 4a7420a
some changes as per @stefanholder
kodonnell 13707e1
bringing back the missing readme
kodonnell efb7b57
a few more tidyups
kodonnell 956e7d0
more tidy-ups
kodonnell 1dd88e8
utilise LocationIndexTree.findWithinRadius
kodonnell 56df0ab
ugly hacky gui ...
kodonnell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
75 changes: 0 additions & 75 deletions
75
matching-core/src/main/java/com/graphhopper/matching/EdgeMatch.java
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
18 changes: 18 additions & 0 deletions
18
matching-core/src/main/java/com/graphhopper/matching/GPXMapping.java
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,18 @@ | ||
package com.graphhopper.matching; | ||
|
||
import com.graphhopper.util.GPXEntry; | ||
|
||
public class GPXMapping { | ||
public final GPXEntry originalGPXEntry; | ||
public final int matchEdgeIdx; | ||
public final boolean isNeighbor; | ||
public final int neighborIdx; | ||
public final MatchEntry matchEntry; | ||
public GPXMapping(GPXEntry originalGPXEntry, MatchEntry matchEntry, int matchEdgeIdx, boolean isNeighbor, int neighborIdx) { | ||
this.originalGPXEntry = originalGPXEntry; | ||
this.matchEdgeIdx = matchEdgeIdx; | ||
this.isNeighbor = isNeighbor; | ||
this.neighborIdx = neighborIdx; | ||
this.matchEntry = matchEntry; | ||
} | ||
} |
499 changes: 159 additions & 340 deletions
499
matching-core/src/main/java/com/graphhopper/matching/MapMatching.java
Large diffs are not rendered by default.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
matching-core/src/main/java/com/graphhopper/matching/MatchEdge.java
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,38 @@ | ||
/* | ||
* Licensed to GraphHopper GmbH under one or more contributor | ||
* license agreements. See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
* | ||
* GraphHopper GmbH licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except in | ||
* compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.graphhopper.matching; | ||
|
||
import com.graphhopper.util.EdgeIteratorState; | ||
|
||
/** | ||
* | ||
* @author kodonnell | ||
*/ | ||
public class MatchEdge { | ||
|
||
public final EdgeIteratorState edge; | ||
public final long fromTime; | ||
public final long toTime; | ||
|
||
public MatchEdge(EdgeIteratorState edge, long fromTime, long toTime) { | ||
assert edge != null : "edge should not be null"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a precondition of a public method is violated, an exception should rather be thrown (NullPointerException in this case). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks - may be a few more of those. Will look now. |
||
this.edge = edge; | ||
this.fromTime = fromTime; | ||
this.toTime = toTime; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
matching-core/src/main/java/com/graphhopper/matching/MatchEntry.java
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,30 @@ | ||
package com.graphhopper.matching; | ||
|
||
import java.util.List; | ||
|
||
import com.bmw.hmm.SequenceState; | ||
import com.graphhopper.matching.util.TimeStep; | ||
import com.graphhopper.routing.Path; | ||
import com.graphhopper.util.EdgeIteratorState; | ||
import com.graphhopper.util.GPXEntry; | ||
import com.graphhopper.util.shapes.GHPoint3D; | ||
|
||
public class MatchEntry { | ||
public final int sequenceIdx; | ||
public final GPXEntry gpxEntry; | ||
public final List<GPXEntry> neighboringGpxEntries; | ||
public final GHPoint3D point; | ||
public final EdgeIteratorState directedRealEdge; | ||
public final int sequenceMatchEdgeIdx; | ||
public final double distanceAlongRealEdge; | ||
public MatchEntry(int sequenceIdx, SequenceState<GPXExtension, GPXEntry, Path> matchStep, TimeStep timeStep, EdgeIteratorState directedRealEdge, int sequenceMatchEdgeIdx, double distanceAlongRealEdge) { | ||
this.sequenceIdx = sequenceIdx; | ||
this.gpxEntry = matchStep.observation; | ||
this.point = matchStep.state.getQueryResult().getSnappedPoint(); | ||
this.sequenceMatchEdgeIdx = sequenceMatchEdgeIdx; | ||
this.directedRealEdge = directedRealEdge; | ||
this.distanceAlongRealEdge = distanceAlongRealEdge; | ||
this.neighboringGpxEntries = timeStep.getNeighboringEntries(); | ||
} | ||
|
||
} |
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
Oops, something went wrong.
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.
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.
How about MatchedEdge instead of MatchEdge?
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.
I think I was trying to be consistent with (the original)
MatchResult
as opposed toMatchedResult
- happy to change all if you wish?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.
I don't think that consistency is needed here, so I would be happy with
MatchedEdge
(the matched edge) andMatchResult
(the result is not matched, so I think this is fine).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.
Done