Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #6655

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
- CHANGED: Replace boost::string_ref with std::string_view [#6433](https://github.com/Project-OSRM/osrm-backend/pull/6433)
- ADDED: Print tracebacks for Lua runtime errors [#6564](https://github.com/Project-OSRM/osrm-backend/pull/6564)
- FIXED: Added a variable to preprocessor guard in file osrm-backend/include/util/range_table.hpp to solve build error. [#6596](https://github.com/Project-OSRM/osrm-backend/pull/6596)
- FIXED: Ensure required file check in osrm-routed is correctly enforced. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
- FIXED: Correct HTTP docs to reflect summary output dependency on steps parameter. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
- Routing:
- FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419)
# 5.27.1
Expand Down
10 changes: 5 additions & 5 deletions docs/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,12 @@ Represents a route between two waypoints.
- `distance`: The distance traveled by this route leg, in `float` meters.
- `duration`: The estimated travel time, in `float` number of seconds.
- `weight`: The calculated weight of the route leg.
- `summary`: Summary of the route taken as `string`. Depends on the `summary` parameter:
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:

| summary | |
|--------------|-----------------------------------------------------------------------|
| 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);

| true | Names of the two major roads used. Can be empty if the route is too short.|
| false | empty `string` |

- `steps`: Depends on the `steps` parameter.

Expand Down
41 changes: 19 additions & 22 deletions include/storage/storage_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,25 @@ struct StorageConfig final : IOConfig
}

StorageConfig()
: IOConfig({".osrm.ramIndex",
".osrm.fileIndex",
".osrm.edges",
".osrm.geometry",
".osrm.turn_weight_penalties",
".osrm.turn_duration_penalties",
".osrm.datasource_names",
".osrm.names",
".osrm.timestamp",
".osrm.properties",
".osrm.icd",
".osrm.maneuver_overrides"},
{".osrm.hsgr",
".osrm.nbg_nodes",
".osrm.ebg_nodes",
".osrm.cells",
".osrm.cell_metrics",
".osrm.mldgr",
".osrm.tld",
".osrm.tls",
".osrm.partition"},
{})
: IOConfig(
{".osrm.ramIndex",
".osrm.fileIndex",
".osrm.edges",
".osrm.geometry",
".osrm.turn_weight_penalties",
".osrm.turn_duration_penalties",
".osrm.datasource_names",
".osrm.ebg_nodes",
".osrm.names",
".osrm.nbg_nodes",
".osrm.timestamp",
".osrm.tls",
".osrm.tld",
".osrm.properties",
".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")}};

{
}
};
Expand Down