Skip to content

Conversation

mjjbell
Copy link
Member

@mjjbell mjjbell commented Jul 17, 2023

Issue

A couple of minor issues spotted whilst working on optional data loading.

  • Correct HTTP docs to reflect summary output dependency on steps parameter.
    There is no summary parameter.

  • Ensure required file check in osrm-routed is correctly enforced.
    The storage module has a stricter check. This keeps the IOConfig check in sync.

Tasklist

".osrm.nbg_nodes",
".osrm.timestamp",
".osrm.tls",
".osrm.tld",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::vector<std::pair<bool, boost::filesystem::path>> files = {
{IS_OPTIONAL, config.GetPath(".osrm.cells")},
{IS_OPTIONAL, config.GetPath(".osrm.partition")},
{IS_REQUIRED, config.GetPath(".osrm.icd")},
{IS_REQUIRED, config.GetPath(".osrm.properties")},
{IS_REQUIRED, config.GetPath(".osrm.nbg_nodes")},
{IS_REQUIRED, config.GetPath(".osrm.ebg_nodes")},
{IS_REQUIRED, config.GetPath(".osrm.tls")},
{IS_REQUIRED, config.GetPath(".osrm.tld")},
{IS_REQUIRED, config.GetPath(".osrm.timestamp")},
{IS_REQUIRED, config.GetPath(".osrm.maneuver_overrides")},
{IS_REQUIRED, config.GetPath(".osrm.edges")},
{IS_REQUIRED, config.GetPath(".osrm.names")},
{IS_REQUIRED, config.GetPath(".osrm.ramIndex")}};
for (const auto &file : files)
{
if (file.first == IS_REQUIRED && !boost::filesystem::exists(file.second))
{
throw util::exception("Could not find required file(s): " + std::get<1>(file).string());
}
}
return files;
}
std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetUpdatableFiles()
{
constexpr bool IS_REQUIRED = true;
constexpr bool IS_OPTIONAL = false;
std::vector<std::pair<bool, boost::filesystem::path>> files = {
{IS_OPTIONAL, config.GetPath(".osrm.mldgr")},
{IS_OPTIONAL, config.GetPath(".osrm.cell_metrics")},
{IS_OPTIONAL, config.GetPath(".osrm.hsgr")},
{IS_REQUIRED, config.GetPath(".osrm.datasource_names")},
{IS_REQUIRED, config.GetPath(".osrm.geometry")},
{IS_REQUIRED, config.GetPath(".osrm.turn_weight_penalties")},
{IS_REQUIRED, config.GetPath(".osrm.turn_duration_penalties")}};

| true | Names of the two major roads used. Can be empty if the route is too short.|
| false | empty `string` |
| steps | |
|-------|-----------------------------------------------------------------------|
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (parameters.steps)
{
leg.summary = guidance::assembleSummary(
facade, path_data, phantoms.target_phantom, reversed_target);

mjjbell added 2 commits July 17, 2023 23:06
The storage module had a stricter check. This keeps the IOConfig
check in sync.
@mjjbell mjjbell force-pushed the mbell/minor_fixes branch from d8bf708 to 07b2337 Compare July 17, 2023 22:06
".osrm.icd",
".osrm.maneuver_overrides"},
{".osrm.hsgr", ".osrm.cells", ".osrm.cell_metrics", ".osrm.mldgr", ".osrm.partition"},
{})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::vector<std::pair<bool, boost::filesystem::path>> files = {
{IS_OPTIONAL, config.GetPath(".osrm.cells")},
{IS_OPTIONAL, config.GetPath(".osrm.partition")},
{IS_REQUIRED, config.GetPath(".osrm.icd")},
{IS_REQUIRED, config.GetPath(".osrm.properties")},
{IS_REQUIRED, config.GetPath(".osrm.nbg_nodes")},
{IS_REQUIRED, config.GetPath(".osrm.ebg_nodes")},
{IS_REQUIRED, config.GetPath(".osrm.tls")},
{IS_REQUIRED, config.GetPath(".osrm.tld")},
{IS_REQUIRED, config.GetPath(".osrm.timestamp")},
{IS_REQUIRED, config.GetPath(".osrm.maneuver_overrides")},
{IS_REQUIRED, config.GetPath(".osrm.edges")},
{IS_REQUIRED, config.GetPath(".osrm.names")},
{IS_REQUIRED, config.GetPath(".osrm.ramIndex")}};
for (const auto &file : files)
{
if (file.first == IS_REQUIRED && !boost::filesystem::exists(file.second))
{
throw util::exception("Could not find required file(s): " + std::get<1>(file).string());
}
}
return files;
}
std::vector<std::pair<bool, boost::filesystem::path>> Storage::GetUpdatableFiles()
{
constexpr bool IS_REQUIRED = true;
constexpr bool IS_OPTIONAL = false;
std::vector<std::pair<bool, boost::filesystem::path>> files = {
{IS_OPTIONAL, config.GetPath(".osrm.mldgr")},
{IS_OPTIONAL, config.GetPath(".osrm.cell_metrics")},
{IS_OPTIONAL, config.GetPath(".osrm.hsgr")},
{IS_REQUIRED, config.GetPath(".osrm.datasource_names")},
{IS_REQUIRED, config.GetPath(".osrm.geometry")},
{IS_REQUIRED, config.GetPath(".osrm.turn_weight_penalties")},
{IS_REQUIRED, config.GetPath(".osrm.turn_duration_penalties")}};

@mjjbell mjjbell merged commit 3bb82ce into master Jul 18, 2023
@mjjbell mjjbell deleted the mbell/minor_fixes branch July 18, 2023 19:23
eliseier pushed a commit to wanderlog/osrm-backend that referenced this pull request Mar 25, 2025
* Ensure required file check in osrm-routed is correctly enforced.

The storage module had a stricter check. This keeps the IOConfig
check in sync.

* Correct HTTP docs to reflect summary output dependency on steps parameter.

There is no summary parameter.

* npm audit fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants