parent
							
								
									d6c6fbfe03
								
							
						
					
					
						commit
						05b939760c
					
				| @ -32,7 +32,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include "HilbertValue.h" | #include "HilbertValue.h" | ||||||
| #include "PhantomNodes.h" | #include "PhantomNodes.h" | ||||||
| #include "QueryNode.h" | #include "QueryNode.h" | ||||||
| #include "Range.h" |  | ||||||
| #include "SharedMemoryFactory.h" | #include "SharedMemoryFactory.h" | ||||||
| #include "SharedMemoryVectorWrapper.h" | #include "SharedMemoryVectorWrapper.h" | ||||||
| 
 | 
 | ||||||
| @ -82,7 +81,7 @@ class StaticRTree | |||||||
|                                           const uint32_t element_count, |                                           const uint32_t element_count, | ||||||
|                                           const std::vector<NodeInfo> &coordinate_list) |                                           const std::vector<NodeInfo> &coordinate_list) | ||||||
|         { |         { | ||||||
|             for (const auto i : osrm::irange<uint32_t>(0, element_count)) |             for (uint32_t i = 0; i < element_count; ++i) | ||||||
|             { |             { | ||||||
|                 min_lon = std::min(min_lon, |                 min_lon = std::min(min_lon, | ||||||
|                                    std::min(coordinate_list.at(objects[i].u).lon, |                                    std::min(coordinate_list.at(objects[i].u).lon, | ||||||
| @ -145,7 +144,7 @@ class StaticRTree | |||||||
|                 return 0.; |                 return 0.; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             enum class Direction : unsigned char |             enum Direction | ||||||
|             { |             { | ||||||
|                 INVALID    = 0, |                 INVALID    = 0, | ||||||
|                 NORTH      = 1, |                 NORTH      = 1, | ||||||
| @ -158,57 +157,51 @@ class StaticRTree | |||||||
|                 SOUTH_WEST = 10 |                 SOUTH_WEST = 10 | ||||||
|             }; |             }; | ||||||
| 
 | 
 | ||||||
|             Direction d { Direction::INVALID }; |             Direction d = INVALID; | ||||||
|             if (location.lat > max_lat) |             if (location.lat > max_lat) | ||||||
|             { |                 d = (Direction) (d | NORTH); | ||||||
|                 d = (Direction::NORTH); |  | ||||||
|             } |  | ||||||
|             else if (location.lat < min_lat) |             else if (location.lat < min_lat) | ||||||
|             { |                 d = (Direction) (d | SOUTH); | ||||||
|                 d = (Direction::SOUTH); |             if (location.lon > max_lon) | ||||||
|             } |                 d = (Direction) (d | EAST); | ||||||
|             if (location.lon > max_lon && d != Direction::INVALID) |             else if (location.lon < min_lon) | ||||||
|             { |                 d = (Direction) (d | WEST); | ||||||
|                 d = (Direction::EAST); |  | ||||||
|             } |  | ||||||
|             else if (location.lon < min_lon && d != Direction::INVALID) |  | ||||||
|             { |  | ||||||
|                 d = (Direction::WEST); |  | ||||||
|             } |  | ||||||
| 
 | 
 | ||||||
|             BOOST_ASSERT(d != Direction::INVALID); |             BOOST_ASSERT(d != INVALID); | ||||||
| 
 | 
 | ||||||
|             float min_dist = std::numeric_limits<float>::max(); |             float min_dist = std::numeric_limits<float>::max(); | ||||||
|             switch (d) |             switch (d) | ||||||
|             { |             { | ||||||
|                 case Direction::NORTH: |                 case NORTH: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(max_lat, location.lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(max_lat, location.lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::SOUTH: |                 case SOUTH: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(min_lat, location.lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(min_lat, location.lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::WEST: |                 case WEST: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(location.lat, min_lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(location.lat, min_lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::EAST: |                 case EAST: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(location.lat, max_lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(location.lat, max_lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::NORTH_EAST: |                 case NORTH_EAST: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(max_lat, max_lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(max_lat, max_lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::NORTH_WEST: |                 case NORTH_WEST: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(max_lat, min_lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(max_lat, min_lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::SOUTH_EAST: |                 case SOUTH_EAST: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(min_lat, max_lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(min_lat, max_lon)); | ||||||
|                     break; |                     break; | ||||||
|                 case Direction::SOUTH_WEST: |                 case SOUTH_WEST: | ||||||
|                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(min_lat, min_lon)); |                     min_dist = FixedPointCoordinate::ApproximateEuclideanDistance(location, FixedPointCoordinate(min_lat, min_lon)); | ||||||
|                     break; |                     break; | ||||||
|                 default: |                 default: | ||||||
|                     break; |                     break; | ||||||
|             } |             } | ||||||
|  | 
 | ||||||
|             BOOST_ASSERT(min_dist != std::numeric_limits<float>::max()); |             BOOST_ASSERT(min_dist != std::numeric_limits<float>::max()); | ||||||
|  | 
 | ||||||
|             return min_dist; |             return min_dist; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -404,12 +397,11 @@ class StaticRTree | |||||||
|             TreeNode current_node; |             TreeNode current_node; | ||||||
|             // SimpleLogger().Write() << "reading " << tree_size << " tree nodes in " <<
 |             // SimpleLogger().Write() << "reading " << tree_size << " tree nodes in " <<
 | ||||||
|             // (sizeof(TreeNode)*tree_size) << " bytes";
 |             // (sizeof(TreeNode)*tree_size) << " bytes";
 | ||||||
|             for (const auto current_element_index : osrm::irange<uint32_t>(0, LEAF_NODE_SIZE)) |             for (uint32_t current_element_index = 0; LEAF_NODE_SIZE > current_element_index; | ||||||
|  |                  ++current_element_index) | ||||||
|             { |             { | ||||||
|                 if (m_element_count <= (processed_objects_count + current_element_index)) |                 if (m_element_count > (processed_objects_count + current_element_index)) | ||||||
|                 { |                 { | ||||||
|                     continue; |  | ||||||
|                 } |  | ||||||
|                     uint32_t index_of_next_object = |                     uint32_t index_of_next_object = | ||||||
|                         input_wrapper_vector[processed_objects_count + current_element_index] |                         input_wrapper_vector[processed_objects_count + current_element_index] | ||||||
|                             .m_array_index; |                             .m_array_index; | ||||||
| @ -417,6 +409,7 @@ class StaticRTree | |||||||
|                         input_data_vector[index_of_next_object]; |                         input_data_vector[index_of_next_object]; | ||||||
|                     ++current_leaf.object_count; |                     ++current_leaf.object_count; | ||||||
|                 } |                 } | ||||||
|  |             } | ||||||
| 
 | 
 | ||||||
|             // generate tree node that resemble the objects in leaf and store it for next level
 |             // generate tree node that resemble the objects in leaf and store it for next level
 | ||||||
|             current_node.minimum_bounding_rectangle.InitializeMBRectangle( |             current_node.minimum_bounding_rectangle.InitializeMBRectangle( | ||||||
| @ -442,12 +435,12 @@ class StaticRTree | |||||||
|             { |             { | ||||||
|                 TreeNode parent_node; |                 TreeNode parent_node; | ||||||
|                 // pack BRANCHING_FACTOR elements into tree_nodes each
 |                 // pack BRANCHING_FACTOR elements into tree_nodes each
 | ||||||
|                 for (const auto current_child_node_index : osrm::irange<uint32_t>(0, BRANCHING_FACTOR)) |                 for (uint32_t current_child_node_index = 0; | ||||||
|  |                      BRANCHING_FACTOR > current_child_node_index; | ||||||
|  |                      ++current_child_node_index) | ||||||
|                 { |                 { | ||||||
|                     if (processed_tree_nodes_in_level >= tree_nodes_in_level.size()) |                     if (processed_tree_nodes_in_level < tree_nodes_in_level.size()) | ||||||
|                     { |                     { | ||||||
|                         continue; |  | ||||||
|                     } |  | ||||||
|                         TreeNode ¤t_child_node = |                         TreeNode ¤t_child_node = | ||||||
|                             tree_nodes_in_level[processed_tree_nodes_in_level]; |                             tree_nodes_in_level[processed_tree_nodes_in_level]; | ||||||
|                         // add tree node to parent entry
 |                         // add tree node to parent entry
 | ||||||
| @ -460,6 +453,7 @@ class StaticRTree | |||||||
|                         ++parent_node.child_count; |                         ++parent_node.child_count; | ||||||
|                         ++processed_tree_nodes_in_level; |                         ++processed_tree_nodes_in_level; | ||||||
|                     } |                     } | ||||||
|  |                 } | ||||||
|                 tree_nodes_in_next_level.emplace_back(parent_node); |                 tree_nodes_in_next_level.emplace_back(parent_node); | ||||||
|             } |             } | ||||||
|             tree_nodes_in_level.swap(tree_nodes_in_next_level); |             tree_nodes_in_level.swap(tree_nodes_in_next_level); | ||||||
| @ -479,7 +473,7 @@ class StaticRTree | |||||||
|             for (uint32_t i = range.begin(); i != range.end(); ++i) |             for (uint32_t i = range.begin(); i != range.end(); ++i) | ||||||
|             { |             { | ||||||
|                 TreeNode ¤t_tree_node = this->m_search_tree[i]; |                 TreeNode ¤t_tree_node = this->m_search_tree[i]; | ||||||
|                 for (const auto j : osrm::irange<uint32_t>(0, current_tree_node.child_count)) |                 for (uint32_t j = 0; j < current_tree_node.child_count; ++j) | ||||||
|                 { |                 { | ||||||
|                     const uint32_t old_id = current_tree_node.children[j]; |                     const uint32_t old_id = current_tree_node.children[j]; | ||||||
|                     const uint32_t new_id = search_tree_size - old_id - 1; |                     const uint32_t new_id = search_tree_size - old_id - 1; | ||||||
| @ -577,7 +571,7 @@ class StaticRTree | |||||||
|                                             FixedPointCoordinate &result_coordinate, |                                             FixedPointCoordinate &result_coordinate, | ||||||
|                                             const unsigned zoom_level) |                                             const unsigned zoom_level) | ||||||
|     { |     { | ||||||
|         const bool ignore_tiny_components = (zoom_level <= 14); |         bool ignore_tiny_components = (zoom_level <= 14); | ||||||
| 
 | 
 | ||||||
|         float min_dist = std::numeric_limits<float>::max(); |         float min_dist = std::numeric_limits<float>::max(); | ||||||
|         float min_max_dist = std::numeric_limits<float>::max(); |         float min_max_dist = std::numeric_limits<float>::max(); | ||||||
| @ -600,7 +594,7 @@ class StaticRTree | |||||||
|                 { |                 { | ||||||
|                     LeafNode current_leaf_node; |                     LeafNode current_leaf_node; | ||||||
|                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); |                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); | ||||||
|                     for (const auto i : osrm::irange<uint32_t>(0, current_leaf_node.object_count)) |                     for (uint32_t i = 0; i < current_leaf_node.object_count; ++i) | ||||||
|                     { |                     { | ||||||
|                         EdgeDataT const ¤t_edge = current_leaf_node.objects[i]; |                         EdgeDataT const ¤t_edge = current_leaf_node.objects[i]; | ||||||
|                         if (ignore_tiny_components && current_edge.is_in_tiny_cc) |                         if (ignore_tiny_components && current_edge.is_in_tiny_cc) | ||||||
| @ -706,7 +700,7 @@ class StaticRTree | |||||||
|                     LeafNode current_leaf_node; |                     LeafNode current_leaf_node; | ||||||
|                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); |                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); | ||||||
|                     // Add all objects from leaf into queue
 |                     // Add all objects from leaf into queue
 | ||||||
|                     for (const auto i : osrm::irange<uint32_t>(0, current_leaf_node.object_count)) |                     for (uint32_t i = 0; i < current_leaf_node.object_count; ++i) | ||||||
|                     { |                     { | ||||||
|                         const auto ¤t_edge = current_leaf_node.objects[i]; |                         const auto ¤t_edge = current_leaf_node.objects[i]; | ||||||
|                         const float current_perpendicular_distance = |                         const float current_perpendicular_distance = | ||||||
| @ -739,7 +733,7 @@ class StaticRTree | |||||||
|                     //     current_tree_node.minimum_bounding_rectangle.max_lon/COORDINATE_PRECISION << "," << "]";
 |                     //     current_tree_node.minimum_bounding_rectangle.max_lon/COORDINATE_PRECISION << "," << "]";
 | ||||||
| 
 | 
 | ||||||
|                     // for each child mbr
 |                     // for each child mbr
 | ||||||
|                     for (const auto i : osrm::irange<uint32_t>(0, current_tree_node.child_count)) |                     for (uint32_t i = 0; i < current_tree_node.child_count; ++i) | ||||||
|                     { |                     { | ||||||
|                         const int32_t child_id = current_tree_node.children[i]; |                         const int32_t child_id = current_tree_node.children[i]; | ||||||
|                         const TreeNode &child_tree_node = m_search_tree[child_id]; |                         const TreeNode &child_tree_node = m_search_tree[child_id]; | ||||||
| @ -900,7 +894,7 @@ class StaticRTree | |||||||
|                     LeafNode current_leaf_node; |                     LeafNode current_leaf_node; | ||||||
|                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); |                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); | ||||||
|                     // Add all objects from leaf into queue
 |                     // Add all objects from leaf into queue
 | ||||||
|                     for (const auto i : osrm::irange<uint32_t>(0, current_leaf_node.object_count)) |                     for (uint32_t i = 0; i < current_leaf_node.object_count; ++i) | ||||||
|                     { |                     { | ||||||
|                         const auto ¤t_edge = current_leaf_node.objects[i]; |                         const auto ¤t_edge = current_leaf_node.objects[i]; | ||||||
|                         const float current_perpendicular_distance = |                         const float current_perpendicular_distance = | ||||||
| @ -920,7 +914,7 @@ class StaticRTree | |||||||
|                 else |                 else | ||||||
|                 { |                 { | ||||||
|                     // for each child mbr
 |                     // for each child mbr
 | ||||||
|                     for (const auto i : osrm::irange<uint32_t>(0, current_tree_node.child_count)) |                     for (uint32_t i = 0; i < current_tree_node.child_count; ++i) | ||||||
|                     { |                     { | ||||||
|                         const int32_t child_id = current_tree_node.children[i]; |                         const int32_t child_id = current_tree_node.children[i]; | ||||||
|                         const TreeNode &child_tree_node = m_search_tree[child_id]; |                         const TreeNode &child_tree_node = m_search_tree[child_id]; | ||||||
| @ -1050,7 +1044,7 @@ class StaticRTree | |||||||
|                 { |                 { | ||||||
|                     LeafNode current_leaf_node; |                     LeafNode current_leaf_node; | ||||||
|                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); |                     LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node); | ||||||
|                     for (const auto i : osrm::irange<uint32_t>(0, current_leaf_node.object_count)) |                     for (uint32_t i = 0; i < current_leaf_node.object_count; ++i) | ||||||
|                     { |                     { | ||||||
|                         const EdgeDataT ¤t_edge = current_leaf_node.objects[i]; |                         const EdgeDataT ¤t_edge = current_leaf_node.objects[i]; | ||||||
|                         if (ignore_tiny_components && current_edge.is_in_tiny_cc) |                         if (ignore_tiny_components && current_edge.is_in_tiny_cc) | ||||||
| @ -1123,11 +1117,11 @@ class StaticRTree | |||||||
| 
 | 
 | ||||||
|         if (SPECIAL_NODEID != result_phantom_node.forward_node_id) |         if (SPECIAL_NODEID != result_phantom_node.forward_node_id) | ||||||
|         { |         { | ||||||
|             result_phantom_node.forward_weight *= static_cast<decltype(result_phantom_node.forward_weight)>(ratio); |             result_phantom_node.forward_weight *= ratio; | ||||||
|         } |         } | ||||||
|         if (SPECIAL_NODEID != result_phantom_node.reverse_node_id) |         if (SPECIAL_NODEID != result_phantom_node.reverse_node_id) | ||||||
|         { |         { | ||||||
|             result_phantom_node.reverse_weight *= static_cast<decltype(result_phantom_node.reverse_weight)>(1.f - ratio); |             result_phantom_node.reverse_weight *= (1.f - ratio); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -1154,7 +1148,7 @@ class StaticRTree | |||||||
|     { |     { | ||||||
|         float new_min_max_dist = min_max_dist; |         float new_min_max_dist = min_max_dist; | ||||||
|         // traverse children, prune if global mindist is smaller than local one
 |         // traverse children, prune if global mindist is smaller than local one
 | ||||||
|         for (const auto i : osrm::irange(0u, parent.child_count)) |         for (uint32_t i = 0; i < parent.child_count; ++i) | ||||||
|         { |         { | ||||||
|             const int32_t child_id = parent.children[i]; |             const int32_t child_id = parent.children[i]; | ||||||
|             const TreeNode &child_tree_node = m_search_tree[child_id]; |             const TreeNode &child_tree_node = m_search_tree[child_id]; | ||||||
|  | |||||||
| @ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include "../Algorithms/DouglasPeucker.h" | #include "../Algorithms/DouglasPeucker.h" | ||||||
| #include "../Algorithms/PolylineCompressor.h" | #include "../Algorithms/PolylineCompressor.h" | ||||||
| #include "../DataStructures/PhantomNodes.h" | #include "../DataStructures/PhantomNodes.h" | ||||||
| #include "../DataStructures/Range.h" |  | ||||||
| #include "../DataStructures/SegmentInformation.h" | #include "../DataStructures/SegmentInformation.h" | ||||||
| #include "../DataStructures/TurnInstructions.h" | #include "../DataStructures/TurnInstructions.h" | ||||||
| #include "../typedefs.h" | #include "../typedefs.h" | ||||||
| @ -94,7 +93,7 @@ class DescriptionFactory | |||||||
| 
 | 
 | ||||||
|         /** starts at index 1 */ |         /** starts at index 1 */ | ||||||
|         path_description[0].length = 0; |         path_description[0].length = 0; | ||||||
|         for (const auto i : osrm::irange<std::size_t>(1, path_description.size())) |         for (unsigned i = 1; i < path_description.size(); ++i) | ||||||
|         { |         { | ||||||
|             // move down names by one, q&d hack
 |             // move down names by one, q&d hack
 | ||||||
|             path_description[i - 1].name_id = path_description[i].name_id; |             path_description[i - 1].name_id = path_description[i].name_id; | ||||||
| @ -149,7 +148,7 @@ class DescriptionFactory | |||||||
|         unsigned segment_duration = 0; |         unsigned segment_duration = 0; | ||||||
|         unsigned segment_start_index = 0; |         unsigned segment_start_index = 0; | ||||||
| 
 | 
 | ||||||
|         for (const auto i : osrm::irange<std::size_t>(1, path_description.size())) |         for (unsigned i = 1; i < path_description.size(); ++i) | ||||||
|         { |         { | ||||||
|             entireLength += path_description[i].length; |             entireLength += path_description[i].length; | ||||||
|             segment_length += path_description[i].length; |             segment_length += path_description[i].length; | ||||||
| @ -193,9 +192,7 @@ class DescriptionFactory | |||||||
| 
 | 
 | ||||||
|         // fix what needs to be fixed else
 |         // fix what needs to be fixed else
 | ||||||
|         unsigned necessary_pieces = 0; // a running index that counts the necessary pieces
 |         unsigned necessary_pieces = 0; // a running index that counts the necessary pieces
 | ||||||
|         if (path_description.size() >= 2) |         for (unsigned i = 0; i < path_description.size() - 1 && path_description.size() >= 2; ++i) | ||||||
|         { |  | ||||||
|             for (const auto i : osrm::irange<std::size_t>(0, path_description.size() - 1)) |  | ||||||
|         { |         { | ||||||
|             if (path_description[i].necessary) |             if (path_description[i].necessary) | ||||||
|             { |             { | ||||||
| @ -208,7 +205,6 @@ class DescriptionFactory | |||||||
|                 path_description[i].bearing = static_cast<unsigned>(angle * 10); |                 path_description[i].bearing = static_cast<unsigned>(angle * 10); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         } |  | ||||||
|         via_indices.push_back(necessary_pieces+1); |         via_indices.push_back(necessary_pieces+1); | ||||||
|         BOOST_ASSERT(via_indices.size() >= 2); |         BOOST_ASSERT(via_indices.size() >= 2); | ||||||
|         // BOOST_ASSERT(0 != necessary_pieces || path_description.empty());
 |         // BOOST_ASSERT(0 != necessary_pieces || path_description.empty());
 | ||||||
|  | |||||||
| @ -33,7 +33,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include "../Algorithms/ObjectToBase64.h" | #include "../Algorithms/ObjectToBase64.h" | ||||||
| #include "../DataStructures/JSONContainer.h" | #include "../DataStructures/JSONContainer.h" | ||||||
| #include "../DataStructures/QueryEdge.h" | #include "../DataStructures/QueryEdge.h" | ||||||
| #include "../DataStructures/Range.h" |  | ||||||
| #include "../DataStructures/SearchEngine.h" | #include "../DataStructures/SearchEngine.h" | ||||||
| #include "../Descriptors/BaseDescriptor.h" | #include "../Descriptors/BaseDescriptor.h" | ||||||
| #include "../Util/SimpleLogger.h" | #include "../Util/SimpleLogger.h" | ||||||
| @ -92,10 +91,10 @@ template <class DataFacadeT> class DistanceTablePlugin : public BasePlugin | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         const bool checksum_OK = (route_parameters.check_sum == raw_route.check_sum); |         const bool checksum_OK = (route_parameters.check_sum == raw_route.check_sum); | ||||||
|         auto max_locations = |         unsigned max_locations = | ||||||
|             std::min((std::size_t)100u, raw_route.raw_via_node_coordinates.size()); |             std::min(100u, static_cast<unsigned>(raw_route.raw_via_node_coordinates.size())); | ||||||
|         PhantomNodeArray phantom_node_vector(max_locations); |         PhantomNodeArray phantom_node_vector(max_locations); | ||||||
|         for (const auto i : osrm::range<std::size_t>(0, max_locations)) |         for (unsigned i = 0; i < max_locations; ++i) | ||||||
|         { |         { | ||||||
|             if (checksum_OK && i < route_parameters.hints.size() && |             if (checksum_OK && i < route_parameters.hints.size() && | ||||||
|                 !route_parameters.hints[i].empty()) |                 !route_parameters.hints[i].empty()) | ||||||
| @ -128,8 +127,8 @@ template <class DataFacadeT> class DistanceTablePlugin : public BasePlugin | |||||||
|         } |         } | ||||||
|         JSON::Object json_object; |         JSON::Object json_object; | ||||||
|         JSON::Array json_array; |         JSON::Array json_array; | ||||||
|         const auto number_of_locations = phantom_node_vector.size(); |         const unsigned number_of_locations = static_cast<unsigned>(phantom_node_vector.size()); | ||||||
|         for (const auto row : osrm::irange<std::size_t>(0, number_of_locations)) |         for (unsigned row = 0; row < number_of_locations; ++row) | ||||||
|         { |         { | ||||||
|             JSON::Array json_row; |             JSON::Array json_row; | ||||||
|             auto row_begin_iterator = result_table->begin() + (row * number_of_locations); |             auto row_begin_iterator = result_table->begin() + (row * number_of_locations); | ||||||
|  | |||||||
| @ -33,7 +33,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include "../Algorithms/ObjectToBase64.h" | #include "../Algorithms/ObjectToBase64.h" | ||||||
| 
 | 
 | ||||||
| #include "../DataStructures/QueryEdge.h" | #include "../DataStructures/QueryEdge.h" | ||||||
| #include "../DataStructures/Range.h" |  | ||||||
| #include "../DataStructures/SearchEngine.h" | #include "../DataStructures/SearchEngine.h" | ||||||
| #include "../Descriptors/BaseDescriptor.h" | #include "../Descriptors/BaseDescriptor.h" | ||||||
| #include "../Descriptors/GPXDescriptor.h" | #include "../Descriptors/GPXDescriptor.h" | ||||||
| @ -95,7 +94,7 @@ template <class DataFacadeT> class ViaRoutePlugin : public BasePlugin | |||||||
|         std::vector<PhantomNode> phantom_node_vector(raw_route.raw_via_node_coordinates.size()); |         std::vector<PhantomNode> phantom_node_vector(raw_route.raw_via_node_coordinates.size()); | ||||||
|         const bool checksum_OK = (route_parameters.check_sum == raw_route.check_sum); |         const bool checksum_OK = (route_parameters.check_sum == raw_route.check_sum); | ||||||
| 
 | 
 | ||||||
|         for (const auto i : osrm::irange<std::size_t>(0, raw_route.raw_via_node_coordinates.size())) |         for (unsigned i = 0; i < raw_route.raw_via_node_coordinates.size(); ++i) | ||||||
|         { |         { | ||||||
|             if (checksum_OK && i < route_parameters.hints.size() && |             if (checksum_OK && i < route_parameters.hints.size() && | ||||||
|                 !route_parameters.hints[i].empty()) |                 !route_parameters.hints[i].empty()) | ||||||
| @ -112,7 +111,7 @@ template <class DataFacadeT> class ViaRoutePlugin : public BasePlugin | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         PhantomNodes current_phantom_node_pair; |         PhantomNodes current_phantom_node_pair; | ||||||
|         for (const auto i : osrm::irange<std::size_t>(0, phantom_node_vector.size() - 1)) |         for (unsigned i = 0; i < phantom_node_vector.size() - 1; ++i) | ||||||
|         { |         { | ||||||
|             current_phantom_node_pair.source_phantom = phantom_node_vector[i]; |             current_phantom_node_pair.source_phantom = phantom_node_vector[i]; | ||||||
|             current_phantom_node_pair.target_phantom = phantom_node_vector[i + 1]; |             current_phantom_node_pair.target_phantom = phantom_node_vector[i + 1]; | ||||||
|  | |||||||
| @ -35,7 +35,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include "../../DataStructures/OriginalEdgeData.h" | #include "../../DataStructures/OriginalEdgeData.h" | ||||||
| #include "../../DataStructures/QueryNode.h" | #include "../../DataStructures/QueryNode.h" | ||||||
| #include "../../DataStructures/QueryEdge.h" | #include "../../DataStructures/QueryEdge.h" | ||||||
| #include "../../DataStructures/Range.h" |  | ||||||
| #include "../../DataStructures/SharedMemoryVectorWrapper.h" | #include "../../DataStructures/SharedMemoryVectorWrapper.h" | ||||||
| #include "../../DataStructures/StaticGraph.h" | #include "../../DataStructures/StaticGraph.h" | ||||||
| #include "../../DataStructures/StaticRTree.h" | #include "../../DataStructures/StaticRTree.h" | ||||||
| @ -131,7 +130,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge | |||||||
|         nodes_input_stream.read((char *)&number_of_coordinates, sizeof(unsigned)); |         nodes_input_stream.read((char *)&number_of_coordinates, sizeof(unsigned)); | ||||||
|         m_coordinate_list = |         m_coordinate_list = | ||||||
|             std::make_shared<std::vector<FixedPointCoordinate>>(number_of_coordinates); |             std::make_shared<std::vector<FixedPointCoordinate>>(number_of_coordinates); | ||||||
|         for (const auto i : osrm::irange(0u, number_of_coordinates)) |         for (unsigned i = 0; i < number_of_coordinates; ++i) | ||||||
|         { |         { | ||||||
|             nodes_input_stream.read((char *)¤t_node, sizeof(NodeInfo)); |             nodes_input_stream.read((char *)¤t_node, sizeof(NodeInfo)); | ||||||
|             m_coordinate_list->at(i) = FixedPointCoordinate(current_node.lat, current_node.lon); |             m_coordinate_list->at(i) = FixedPointCoordinate(current_node.lat, current_node.lon); | ||||||
| @ -151,7 +150,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge | |||||||
|         unsigned compressed = 0; |         unsigned compressed = 0; | ||||||
| 
 | 
 | ||||||
|         OriginalEdgeData current_edge_data; |         OriginalEdgeData current_edge_data; | ||||||
|         for (const auto i : osrm::irange(0u, number_of_edges)) |         for (unsigned i = 0; i < number_of_edges; ++i) | ||||||
|         { |         { | ||||||
|             edges_input_stream.read((char *)&(current_edge_data), sizeof(OriginalEdgeData)); |             edges_input_stream.read((char *)&(current_edge_data), sizeof(OriginalEdgeData)); | ||||||
|             m_via_node_list[i] = current_edge_data.via_node; |             m_via_node_list[i] = current_edge_data.via_node; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user