Skip to content

Commit

Permalink
Slim down matrix pbf response (valhalla#5066)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstnbwnkl authored Jan 27, 2025
1 parent d825888 commit 301c78a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* FIXED: More trivial cases in `CostMatrix` [#5001](https://github.com/valhalla/valhalla/pull/5001)
* FIXED: Tag smoothness=impassable breaks pedestrian routing [#5023](https://github.com/valhalla/valhalla/pull/5023)
* FIXED: Make isochrone geotiff serialization use "north up" geotransform [#5019](https://github.com/valhalla/valhalla/pull/5019)
* FIXED: Get CostMatrix allow second pass option from new location in config []()
* FIXED: Get CostMatrix allow second pass option from new location in config [#5055](https://github.com/valhalla/valhalla/pull/5055/)
* FIXED: Slim down Matrix PBF response [#5066](https://github.com/valhalla/valhalla/pull/5066)
* **Enhancement**
* ADDED: Consider smoothness in all profiles that use surface [#4949](https://github.com/valhalla/valhalla/pull/4949)
* ADDED: `admin_crossings` request parameter for `/route` [#4941](https://github.com/valhalla/valhalla/pull/4941)
Expand Down
4 changes: 2 additions & 2 deletions src/thor/costmatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ bool CostMatrix::SourceToTarget(Api& request,
time_infos[source_idx], invariant, shape_format);

float time = best_connection.cost.secs;
if (time < kMaxCost) {
if (time < kMaxCost && request.options().verbose()) {
auto dt_info =
DateTime::offset_date(source_location_list[source_idx].date_time(),
time_infos[source_idx].timezone_index,
Expand All @@ -277,7 +277,7 @@ bool CostMatrix::SourceToTarget(Api& request,
*matrix.mutable_date_times(connection_idx) = dt_info.date_time;
*matrix.mutable_time_zone_offsets(connection_idx) = dt_info.time_zone_offset;
*matrix.mutable_time_zone_names(connection_idx) = dt_info.time_zone_name;
} else {
} else if (time == kMaxCost) {
// let's try a second pass for this connection
matrix.mutable_second_pass()->Set(connection_idx, true);
connection_failed = true;
Expand Down

0 comments on commit 301c78a

Please sign in to comment.