diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index f6d46820b..9a5e7655f 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -108,12 +108,16 @@ jobs: rm -rf "${PWD}/berlin-latest.osrm" docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest - docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest & + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osm.pbf + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osm.pbf + docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osm.pbf & curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" docker stop osrm-container + # check that we accept base file path(without `.osm.pbf` extension) + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest + build-test-publish: needs: format-taginfo-docs strategy: diff --git a/README.md b/README.md index 13366dd13..8b4c7095e 100644 --- a/README.md +++ b/README.md @@ -62,12 +62,12 @@ Pre-process the extract with the car profile and start a routing engine HTTP ser The flag `-v "${PWD}:/data"` creates the directory `/data` inside the docker container and makes the current working directory `"${PWD}"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `"${PWD}/berlin-latest.osm.pbf"` on the host. - docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest - docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest + docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osm.pbf + docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osm.pbf -Note that `berlin-latest` has no file extension. +Note that only `osrm-extract` actually uses input `.osm.pbf`. All other tools work on top of `osrm-extract` output and when `.osm.pbf` is passed to the tool it is only needed to determine "base" path and find output of `osrm-extract`, i.e. these tools will also work if just pass "base" file path(e.g. `osrm-partition /data/berlin-latest`). - docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest + docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osm.pbf Make requests against the HTTP server diff --git a/include/extractor/extraction_containers.hpp b/include/extractor/extraction_containers.hpp index 9aaa27c0d..6f643aed0 100644 --- a/include/extractor/extraction_containers.hpp +++ b/include/extractor/extraction_containers.hpp @@ -72,7 +72,7 @@ class ExtractionContainers std::vector external_traffic_signals; TrafficSignals internal_traffic_signals; - std::vector normal_edges; + std::vector used_edges; // List of restrictions (conditional and unconditional) before we transform them into the // output types. Input containers reference OSMNodeIDs. We can only transform them to the @@ -83,8 +83,8 @@ class ExtractionContainers std::vector external_maneuver_overrides_list; std::vector internal_maneuver_overrides; - std::unordered_set internal_barrier_nodes; - NodeVector internal_nodes; + std::unordered_set used_barrier_nodes; + NodeVector used_nodes; ExtractionContainers(); diff --git a/include/extractor/node_based_graph_factory.hpp b/include/extractor/node_based_graph_factory.hpp index 9d6f669c9..7c0a70f2e 100644 --- a/include/extractor/node_based_graph_factory.hpp +++ b/include/extractor/node_based_graph_factory.hpp @@ -34,7 +34,7 @@ namespace extractor class NodeBasedGraphFactory { public: - // The node-based graph factory loads the *.osrm file and transforms the data within into the + // The node-based graph factory transforms the graph data into the // node-based graph to represent the OSM network. This includes geometry compression, annotation // data optimisation and many other aspects. After this step, the edge-based graph factory can // turn the graph into the routing graph to be used with the navigation algorithms. diff --git a/src/extractor/extraction_containers.cpp b/src/extractor/extraction_containers.cpp index 2e76a64d4..1f938c17b 100644 --- a/src/extractor/extraction_containers.cpp +++ b/src/extractor/extraction_containers.cpp @@ -542,7 +542,7 @@ void ExtractionContainers::PrepareNodes() ++node_id_iterator; - internal_nodes.emplace_back(*node_iterator++); + used_nodes.emplace_back(*node_iterator++); } TIMER_STOP(write_nodes); @@ -559,7 +559,7 @@ void ExtractionContainers::PrepareNodes() used_node_id_list.begin(), used_node_id_list.end(), osm_id); if (node_id != SPECIAL_NODEID) { - internal_barrier_nodes.emplace(node_id); + used_barrier_nodes.emplace(node_id); } } log << "ok, after " << TIMER_SEC(write_nodes) << "s"; @@ -852,10 +852,10 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm } } - all_nodes_list.clear(); // free all_nodes_list before allocation of normal_edges + all_nodes_list.clear(); // free all_nodes_list before allocation of used_edges all_nodes_list.shrink_to_fit(); - normal_edges.reserve(all_edges_list.size()); + used_edges.reserve(all_edges_list.size()); { util::UnbufferedLog log; log << "Writing used edges ... " << std::flush; @@ -871,17 +871,17 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm // IMPORTANT: here, we're using slicing to only write the data from the base // class of NodeBasedEdgeWithOSM - normal_edges.push_back(edge.result); + used_edges.push_back(edge.result); } - if (normal_edges.size() > std::numeric_limits::max()) + if (used_edges.size() > std::numeric_limits::max()) { throw util::exception("There are too many edges, OSRM only supports 2^32" + SOURCE_REF); } TIMER_STOP(write_edges); log << "ok, after " << TIMER_SEC(write_edges) << "s"; - log << " -- Processed " << normal_edges.size() << " edges"; + log << " -- Processed " << used_edges.size() << " edges"; } } diff --git a/src/extractor/extractor.cpp b/src/extractor/extractor.cpp index fd1a472b5..f87e34102 100644 --- a/src/extractor/extractor.cpp +++ b/src/extractor/extractor.cpp @@ -627,11 +627,11 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(ScriptingEnvironment &scripting std::vector osm_coordinates; extractor::PackedOSMIDs osm_node_ids; - osm_coordinates.resize(extraction_containers.internal_nodes.size()); - osm_node_ids.reserve(extraction_containers.internal_nodes.size()); - for (size_t index = 0; index < extraction_containers.internal_nodes.size(); ++index) + osm_coordinates.resize(extraction_containers.used_nodes.size()); + osm_node_ids.reserve(extraction_containers.used_nodes.size()); + for (size_t index = 0; index < extraction_containers.used_nodes.size(); ++index) { - const auto ¤t_node = extraction_containers.internal_nodes[index]; + const auto ¤t_node = extraction_containers.used_nodes[index]; osm_coordinates[index].lon = current_node.lon; osm_coordinates[index].lat = current_node.lat; osm_node_ids.push_back(current_node.node_id); @@ -642,19 +642,19 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(ScriptingEnvironment &scripting storage::tar::FileWriter writer(config.GetPath(".osrm").string(), storage::tar::FileWriter::GenerateFingerprint); storage::serialization::write( - writer, "/extractor/nodes", extraction_containers.internal_nodes); + writer, "/extractor/nodes", extraction_containers.used_nodes); storage::serialization::write( - writer, "/extractor/edges", extraction_containers.normal_edges); + writer, "/extractor/edges", extraction_containers.used_edges); } return ParsedOSMData{std::move(turn_lane_map), std::move(extraction_containers.turn_restrictions), std::move(extraction_containers.internal_maneuver_overrides), std::move(extraction_containers.internal_traffic_signals), - std::move(extraction_containers.internal_barrier_nodes), + std::move(extraction_containers.used_barrier_nodes), std::move(osm_coordinates), std::move(osm_node_ids), - std::move(extraction_containers.normal_edges), + std::move(extraction_containers.used_edges), std::move(extraction_containers.all_edges_annotation_data_list)}; } diff --git a/src/tools/customize.cpp b/src/tools/customize.cpp index 3a63eb3b3..c80696a5a 100644 --- a/src/tools/customize.cpp +++ b/src/tools/customize.cpp @@ -77,7 +77,7 @@ return_code parseArguments(int argc, hidden_options.add_options()( "input,i", boost::program_options::value(&customization_config.base_path), - "Input file in .osrm format"); + "Input base file path"); // positional option boost::program_options::positional_options_description positional_options; @@ -89,7 +89,7 @@ return_code parseArguments(int argc, const auto *executable = argv[0]; boost::program_options::options_description visible_options( - boost::filesystem::path(executable).filename().string() + " [options]"); + boost::filesystem::path(executable).filename().string() + " [options]"); visible_options.add(generic_options).add(config_options); // parse command line options diff --git a/src/tools/partition.cpp b/src/tools/partition.cpp index bbc8f10ad..861e03938 100644 --- a/src/tools/partition.cpp +++ b/src/tools/partition.cpp @@ -119,7 +119,7 @@ return_code parseArguments(int argc, hidden_options.add_options()( "input,i", boost::program_options::value(&config.base_path), - "Input file in .osrm format"); + "Input base file path"); // positional option boost::program_options::positional_options_description positional_options; @@ -131,7 +131,7 @@ return_code parseArguments(int argc, const auto *executable = argv[0]; boost::program_options::options_description visible_options( - boost::filesystem::path(executable).filename().string() + " [options]"); + boost::filesystem::path(executable).filename().string() + " [options]"); visible_options.add(generic_options).add(config_options); // parse command line options