implement new restriction type interface in PrepareData
This commit is contained in:
		
							parent
							
								
									958350af82
								
							
						
					
					
						commit
						398e3bdf82
					
				| @ -111,39 +111,39 @@ void ExtractionContainers::PrepareData(const std::string &output_file_name, | |||||||
|         while (way_start_and_end_iterator != way_start_end_id_list.end() && |         while (way_start_and_end_iterator != way_start_end_id_list.end() && | ||||||
|                restrictions_iterator != restrictions_list.end()) |                restrictions_iterator != restrictions_list.end()) | ||||||
|         { |         { | ||||||
|             if (way_start_and_end_iterator->wayID < restrictions_iterator->fromWay) |             if (way_start_and_end_iterator->wayID < restrictions_iterator->restriction.from.way) | ||||||
|             { |             { | ||||||
|                 ++way_start_and_end_iterator; |                 ++way_start_and_end_iterator; | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (way_start_and_end_iterator->wayID > restrictions_iterator->fromWay) |             if (way_start_and_end_iterator->wayID > restrictions_iterator->restriction.from.way) | ||||||
|             { |             { | ||||||
|                 ++restrictions_iterator; |                 ++restrictions_iterator; | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             BOOST_ASSERT(way_start_and_end_iterator->wayID == restrictions_iterator->fromWay); |             BOOST_ASSERT(way_start_and_end_iterator->wayID == restrictions_iterator->restriction.from.way); | ||||||
|             const NodeID via_node_id = restrictions_iterator->restriction.viaNode; |             const NodeID via_node_id = restrictions_iterator->restriction.via.node; | ||||||
| 
 | 
 | ||||||
|             if (way_start_and_end_iterator->firstStart == via_node_id) |             if (way_start_and_end_iterator->firstStart == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.fromNode = |                 restrictions_iterator->restriction.from.node = | ||||||
|                     way_start_and_end_iterator->firstTarget; |                     way_start_and_end_iterator->firstTarget; | ||||||
|             } |             } | ||||||
|             else if (way_start_and_end_iterator->firstTarget == via_node_id) |             else if (way_start_and_end_iterator->firstTarget == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.fromNode = |                 restrictions_iterator->restriction.from.node = | ||||||
|                     way_start_and_end_iterator->firstStart; |                     way_start_and_end_iterator->firstStart; | ||||||
|             } |             } | ||||||
|             else if (way_start_and_end_iterator->lastStart == via_node_id) |             else if (way_start_and_end_iterator->lastStart == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.fromNode = |                 restrictions_iterator->restriction.from.node = | ||||||
|                     way_start_and_end_iterator->lastTarget; |                     way_start_and_end_iterator->lastTarget; | ||||||
|             } |             } | ||||||
|             else if (way_start_and_end_iterator->lastTarget == via_node_id) |             else if (way_start_and_end_iterator->lastTarget == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.fromNode = way_start_and_end_iterator->lastStart; |                 restrictions_iterator->restriction.from.node = way_start_and_end_iterator->lastStart; | ||||||
|             } |             } | ||||||
|             ++restrictions_iterator; |             ++restrictions_iterator; | ||||||
|         } |         } | ||||||
| @ -168,36 +168,36 @@ void ExtractionContainers::PrepareData(const std::string &output_file_name, | |||||||
|         while (way_start_and_end_iterator != way_start_end_id_list.end() && |         while (way_start_and_end_iterator != way_start_end_id_list.end() && | ||||||
|                restrictions_iterator != restrictions_list.end()) |                restrictions_iterator != restrictions_list.end()) | ||||||
|         { |         { | ||||||
|             if (way_start_and_end_iterator->wayID < restrictions_iterator->toWay) |             if (way_start_and_end_iterator->wayID < restrictions_iterator->restriction.to.way) | ||||||
|             { |             { | ||||||
|                 ++way_start_and_end_iterator; |                 ++way_start_and_end_iterator; | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|             if (way_start_and_end_iterator->wayID > restrictions_iterator->toWay) |             if (way_start_and_end_iterator->wayID > restrictions_iterator->restriction.to.way) | ||||||
|             { |             { | ||||||
|                 ++restrictions_iterator; |                 ++restrictions_iterator; | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|             NodeID via_node_id = restrictions_iterator->restriction.viaNode; |             NodeID via_node_id = restrictions_iterator->restriction.via.node; | ||||||
|             if (way_start_and_end_iterator->lastStart == via_node_id) |             if (way_start_and_end_iterator->lastStart == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.toNode = way_start_and_end_iterator->lastTarget; |                 restrictions_iterator->restriction.to.node = way_start_and_end_iterator->lastTarget; | ||||||
|             } |             } | ||||||
|             else if (way_start_and_end_iterator->lastTarget == via_node_id) |             else if (way_start_and_end_iterator->lastTarget == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.toNode = way_start_and_end_iterator->lastStart; |                 restrictions_iterator->restriction.to.node = way_start_and_end_iterator->lastStart; | ||||||
|             } |             } | ||||||
|             else if (way_start_and_end_iterator->firstStart == via_node_id) |             else if (way_start_and_end_iterator->firstStart == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.toNode = way_start_and_end_iterator->firstTarget; |                 restrictions_iterator->restriction.to.node = way_start_and_end_iterator->firstTarget; | ||||||
|             } |             } | ||||||
|             else if (way_start_and_end_iterator->firstTarget == via_node_id) |             else if (way_start_and_end_iterator->firstTarget == via_node_id) | ||||||
|             { |             { | ||||||
|                 restrictions_iterator->restriction.toNode = way_start_and_end_iterator->firstStart; |                 restrictions_iterator->restriction.to.node = way_start_and_end_iterator->firstStart; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (std::numeric_limits<unsigned>::max() != restrictions_iterator->restriction.fromNode && |             if (std::numeric_limits<unsigned>::max() != restrictions_iterator->restriction.from.node && | ||||||
|                 std::numeric_limits<unsigned>::max() != restrictions_iterator->restriction.toNode) |                 std::numeric_limits<unsigned>::max() != restrictions_iterator->restriction.to.node) | ||||||
|             { |             { | ||||||
|                 ++number_of_useable_restrictions; |                 ++number_of_useable_restrictions; | ||||||
|             } |             } | ||||||
| @ -215,8 +215,8 @@ void ExtractionContainers::PrepareData(const std::string &output_file_name, | |||||||
| 
 | 
 | ||||||
|         for(const auto & restriction_container : restrictions_list) |         for(const auto & restriction_container : restrictions_list) | ||||||
|         { |         { | ||||||
|             if (std::numeric_limits<unsigned>::max() != restriction_container.restriction.fromNode && |             if (std::numeric_limits<unsigned>::max() != restriction_container.restriction.from.node && | ||||||
|                 std::numeric_limits<unsigned>::max() != restriction_container.restriction.toNode) |                 std::numeric_limits<unsigned>::max() != restriction_container.restriction.to.node) | ||||||
|             { |             { | ||||||
|                 restrictions_out_stream.write((char *)&(restriction_container.restriction), |                 restrictions_out_stream.write((char *)&(restriction_container.restriction), | ||||||
|                                               sizeof(TurnRestriction)); |                                               sizeof(TurnRestriction)); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user