Use smaller range for U-turn angles in map-matching
This commit is contained in:
		
							parent
							
								
									33021d37a1
								
							
						
					
					
						commit
						c048a36a4c
					
				| @ -1,12 +1,14 @@ | |||||||
| # UNRELEASED | # UNRELEASED | ||||||
|   - Changes from 5.16.0: |   - Changes from 5.16.0: | ||||||
|     - Bugfixes: fix deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909) |     - Bugfixes: | ||||||
|  |       - fix deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909) | ||||||
|  |       - FIXED #4920: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920) | ||||||
|     - Tools: |     - Tools: | ||||||
|       - `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. |       - `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. | ||||||
|     - NodeJS: |     - NodeJS: | ||||||
|       - `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. |       - `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. | ||||||
|     - Internals  |     - Internals | ||||||
|       - CHANGED #4845: Updated segregated intersection identification   |       - CHANGED #4845: Updated segregated intersection identification | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # 5.16.0 | # 5.16.0 | ||||||
|  | |||||||
| @ -74,7 +74,7 @@ module.exports = function () { | |||||||
| 
 | 
 | ||||||
|                         if (headers.has('turns')) { |                         if (headers.has('turns')) { | ||||||
|                             if (json.matchings.length != 1) throw new Error('*** Checking turns only supported for matchings with one subtrace'); |                             if (json.matchings.length != 1) throw new Error('*** Checking turns only supported for matchings with one subtrace'); | ||||||
|                             turns = this.turnList(json.matchings[0].instructions); |                             turns = this.turnList(json.matchings[0]); | ||||||
|                         } |                         } | ||||||
| 
 | 
 | ||||||
|                         if (headers.has('route')) { |                         if (headers.has('route')) { | ||||||
|  | |||||||
| @ -684,3 +684,34 @@ Feature: Basic Map Matching | |||||||
|         When I match I should get |         When I match I should get | ||||||
|           | trace | geometry                                      | code | |           | trace | geometry                                      | code | | ||||||
|           | bgkj  | 1.000135,1,1.000135,0.99964,1.000387,0.999137 | Ok   | |           | bgkj  | 1.000135,1,1.000135,0.99964,1.000387,0.999137 | Ok   | | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @match @testbot | ||||||
|  |     Scenario: Regression test - waypoints trimming too much geometry | ||||||
|  |         Given the profile "testbot" | ||||||
|  |         Given a grid size of 10 meters | ||||||
|  |         Given the query options | ||||||
|  |           | geometries | geojson | | ||||||
|  |         Given the node map | ||||||
|  |           """ | ||||||
|  |                 e | ||||||
|  |                 ; | ||||||
|  |                 ; | ||||||
|  |           a-----b-----c | ||||||
|  |                 ; | ||||||
|  |                 ; | ||||||
|  |                 d | ||||||
|  |           """ | ||||||
|  |         And the ways | ||||||
|  |           | nodes | | ||||||
|  |           | abc   | | ||||||
|  |           | bde   | | ||||||
|  |         Given the query options | ||||||
|  |           | waypoints | 0;2  | | ||||||
|  |           | overview  | full | | ||||||
|  |           | steps     | true | | ||||||
|  |         When I match I should get | ||||||
|  |           | trace | geometry                                   | turns                    | code | | ||||||
|  |           | abc   | 1,0.99973,1.00027,0.99973,1.000539,0.99973 | depart,arrive            | Ok   | | ||||||
|  |           | abd   | 1,0.99973,1.00027,0.99973,1.00027,0.999461 | depart,turn right,arrive | Ok   | | ||||||
|  |           | abe   | 1,0.99973,1.00027,0.99973,1.00027,1        | depart,turn left,arrive  | Ok   | | ||||||
|  | |||||||
| @ -80,7 +80,9 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade, | |||||||
|         prev_coordinate = coordinate; |         prev_coordinate = coordinate; | ||||||
| 
 | 
 | ||||||
|         const auto osm_node_id = facade.GetOSMNodeIDOfNode(path_point.turn_via_node); |         const auto osm_node_id = facade.GetOSMNodeIDOfNode(path_point.turn_via_node); | ||||||
|         if (osm_node_id != geometry.osm_node_ids.back()) | 
 | ||||||
|  |         if (osm_node_id != geometry.osm_node_ids.back() || | ||||||
|  |             path_point.turn_instruction.type != osrm::guidance::TurnType::NoTurn) | ||||||
|         { |         { | ||||||
|             geometry.annotations.emplace_back(LegGeometry::Annotation{ |             geometry.annotations.emplace_back(LegGeometry::Annotation{ | ||||||
|                 current_distance, |                 current_distance, | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ void filterCandidates(const std::vector<util::Coordinate> &coordinates, | |||||||
|                                                            coordinates[current_coordinate + 1]); |                                                            coordinates[current_coordinate + 1]); | ||||||
| 
 | 
 | ||||||
|             // sharp turns indicate a possible uturn
 |             // sharp turns indicate a possible uturn
 | ||||||
|             if (turn_angle <= 90.0 || turn_angle >= 270.0) |             if (turn_angle <= 45.0 || turn_angle >= 315.0) | ||||||
|             { |             { | ||||||
|                 allow_uturn = true; |                 allow_uturn = true; | ||||||
|             } |             } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user