2016-03-10 06:43:36 -05:00
|
|
|
/*
|
|
|
|
|
2017-10-02 05:28:25 -04:00
|
|
|
Copyright (c) 2017, Project OSRM contributors
|
2016-03-10 06:43:36 -05:00
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
Redistributions of source code must retain the above copyright notice, this list
|
|
|
|
of conditions and the following disclaimer.
|
|
|
|
Redistributions in binary form must reproduce the above copyright notice, this
|
|
|
|
list of conditions and the following disclaimer in the documentation and/or
|
|
|
|
other materials provided with the distribution.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2014-11-28 09:00:48 -05:00
|
|
|
#ifndef EXTRACTOR_HPP
|
|
|
|
#define EXTRACTOR_HPP
|
2014-07-02 08:05:37 -04:00
|
|
|
|
2016-01-11 10:55:22 -05:00
|
|
|
#include "extractor/edge_based_edge.hpp"
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "extractor/edge_based_graph_factory.hpp"
|
2016-04-26 07:27:40 -04:00
|
|
|
#include "extractor/extractor_config.hpp"
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "extractor/graph_compressor.hpp"
|
2018-02-09 13:32:09 -05:00
|
|
|
#include "extractor/maneuver_override.hpp"
|
2017-09-25 09:37:11 -04:00
|
|
|
#include "extractor/packed_osm_ids.hpp"
|
2014-07-02 08:05:37 -04:00
|
|
|
|
2018-01-08 13:12:06 -05:00
|
|
|
#include "guidance/guidance_processing.hpp"
|
|
|
|
#include "guidance/turn_data_container.hpp"
|
|
|
|
|
2016-04-26 07:27:40 -04:00
|
|
|
#include "util/guidance/bearing_class.hpp"
|
|
|
|
#include "util/guidance/entry_class.hpp"
|
2016-06-30 03:31:08 -04:00
|
|
|
#include "util/guidance/turn_lanes.hpp"
|
2016-04-26 07:27:40 -04:00
|
|
|
|
2020-12-20 16:59:57 -05:00
|
|
|
#include "restriction_graph.hpp"
|
2016-01-07 04:33:47 -05:00
|
|
|
#include "util/typedefs.hpp"
|
|
|
|
|
2016-01-05 10:51:13 -05:00
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace extractor
|
|
|
|
{
|
|
|
|
|
2016-07-11 11:44:58 -04:00
|
|
|
class ScriptingEnvironment;
|
2016-03-22 16:23:25 -04:00
|
|
|
struct ProfileProperties;
|
2016-03-21 17:42:47 -04:00
|
|
|
|
2016-01-07 04:33:47 -05:00
|
|
|
class Extractor
|
2014-07-02 08:05:37 -04:00
|
|
|
{
|
2015-12-11 17:11:04 -05:00
|
|
|
public:
|
2016-01-07 04:33:47 -05:00
|
|
|
Extractor(ExtractorConfig extractor_config) : config(std::move(extractor_config)) {}
|
2016-07-11 11:44:58 -04:00
|
|
|
int run(ScriptingEnvironment &scripting_environment);
|
2015-12-11 17:11:04 -05:00
|
|
|
|
|
|
|
private:
|
2015-10-01 15:47:29 -04:00
|
|
|
ExtractorConfig config;
|
2016-01-07 04:33:47 -05:00
|
|
|
|
2018-01-05 08:33:53 -05:00
|
|
|
std::tuple<LaneDescriptionMap,
|
2017-08-01 11:18:12 -04:00
|
|
|
std::vector<TurnRestriction>,
|
2018-02-09 13:32:09 -05:00
|
|
|
std::vector<UnresolvedManeuverOverride>>
|
2017-06-16 08:35:04 -04:00
|
|
|
ParseOSMData(ScriptingEnvironment &scripting_environment, const unsigned number_of_threads);
|
2017-05-11 06:13:52 -04:00
|
|
|
|
2017-09-25 09:37:11 -04:00
|
|
|
EdgeID BuildEdgeExpandedGraph(
|
|
|
|
// input data
|
|
|
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
|
|
|
const std::vector<util::Coordinate> &coordinates,
|
|
|
|
const CompressedEdgeContainer &compressed_edge_container,
|
|
|
|
const std::unordered_set<NodeID> &barrier_nodes,
|
|
|
|
const std::unordered_set<NodeID> &traffic_lights,
|
2020-12-20 16:59:57 -05:00
|
|
|
const RestrictionGraph &restriction_graph,
|
2017-11-09 08:37:16 -05:00
|
|
|
const std::unordered_set<EdgeID> &segregated_edges,
|
2018-03-21 07:10:02 -04:00
|
|
|
const NameTable &name_table,
|
2018-02-09 13:32:09 -05:00
|
|
|
const std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
2018-01-08 13:12:06 -05:00
|
|
|
const LaneDescriptionMap &turn_lane_map,
|
2017-09-25 09:37:11 -04:00
|
|
|
// for calculating turn penalties
|
|
|
|
ScriptingEnvironment &scripting_environment,
|
|
|
|
// output data
|
|
|
|
EdgeBasedNodeDataContainer &edge_based_nodes_container,
|
|
|
|
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
|
|
|
std::vector<EdgeWeight> &edge_based_node_weights,
|
2018-04-22 14:05:11 -04:00
|
|
|
std::vector<EdgeDuration> &edge_based_node_durations,
|
2018-10-30 00:47:49 -04:00
|
|
|
std::vector<EdgeDistance> &edge_based_node_distances,
|
2018-02-01 10:00:15 -05:00
|
|
|
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
|
|
|
std::uint32_t &connectivity_checksum);
|
2017-09-25 09:37:11 -04:00
|
|
|
|
2015-12-11 17:11:04 -05:00
|
|
|
void FindComponents(unsigned max_edge_id,
|
2017-05-17 01:54:23 -04:00
|
|
|
const util::DeallocatingVector<EdgeBasedEdge> &input_edge_list,
|
|
|
|
const std::vector<EdgeBasedNodeSegment> &input_node_segments,
|
|
|
|
EdgeBasedNodeDataContainer &nodes_container) const;
|
2017-05-16 13:22:41 -04:00
|
|
|
void BuildRTree(std::vector<EdgeBasedNodeSegment> edge_based_node_segments,
|
2017-04-02 19:58:06 -04:00
|
|
|
const std::vector<util::Coordinate> &coordinates);
|
2015-10-01 15:47:29 -04:00
|
|
|
|
2020-12-20 16:59:57 -05:00
|
|
|
void ProcessGuidanceTurns(const util::NodeBasedDynamicGraph &node_based_graph,
|
|
|
|
const EdgeBasedNodeDataContainer &edge_based_node_container,
|
|
|
|
const std::vector<util::Coordinate> &node_coordinates,
|
|
|
|
const CompressedEdgeContainer &compressed_edge_container,
|
|
|
|
const std::unordered_set<NodeID> &barrier_nodes,
|
|
|
|
const RestrictionGraph &restriction_graph,
|
|
|
|
const NameTable &name_table,
|
|
|
|
LaneDescriptionMap lane_description_map,
|
|
|
|
ScriptingEnvironment &scripting_environment);
|
2014-07-02 08:05:37 -04:00
|
|
|
};
|
2020-11-26 10:21:39 -05:00
|
|
|
} // namespace extractor
|
|
|
|
} // namespace osrm
|
2016-01-05 10:51:13 -05:00
|
|
|
|
2014-11-28 09:00:48 -05:00
|
|
|
#endif /* EXTRACTOR_HPP */
|