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

add matrix to gurka #3793

Merged
merged 5 commits into from
Oct 14, 2022
Merged

add matrix to gurka #3793

merged 5 commits into from
Oct 14, 2022

Conversation

nilsnolde
Copy link
Member

fixes #3776

I think it'll be useful when dealing with adding time info to matrix.

Comment on lines +65 to +66
std::string build_valhalla_request(const std::vector<std::string>& location_types,
const std::vector<std::vector<midgard::PointLL>>& waypoints,
Copy link
Member Author

Choose a reason for hiding this comment

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

these are now vectors of their previous types as to not have to overload this internal function

test/gurka/gurka.cc Outdated Show resolved Hide resolved
Comment on lines +706 to +714
valhalla::Api do_action(const valhalla::Options::Action& action,
const map& map,
const std::vector<std::string>& sources,
const std::vector<std::string>& targets,
const std::string& costing,
const std::unordered_map<std::string, std::string>& options,
std::shared_ptr<valhalla::baldr::GraphReader> reader,
std::string* response,
std::string* request_json) {
Copy link
Member Author

Choose a reason for hiding this comment

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

another overload, unfortunately. I could've changed the signature of the do_action but it's public so I'd have to change every gurka test almost.

Comment on lines 7 to 16
TEST(MatrixTest, MatrixSimple) {
constexpr double gridsize = 100;

// the grid below is 50 x 100 meters at 36 km/h, i.e. 10 m/s
const std::string ascii_map = R"(
A----B
| |
| |
C----D
)";
Copy link
Member Author

Choose a reason for hiding this comment

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

Just a small dumb test to show it works. Unfortunately, there's nothing relevant inside the Api object that gets returned from do_action as we don't track stuff in PBF for matrix. We can only predict the distance but that could be fair enough with the right map

kevinkreiser
kevinkreiser previously approved these changes Oct 14, 2022
test/gurka/gurka.cc Outdated Show resolved Hide resolved
Co-authored-by: Kevin Kreiser <kevinkreiser@gmail.com>
@nilsnolde nilsnolde merged commit 8017634 into master Oct 14, 2022
@nilsnolde nilsnolde deleted the nn-add-timeinfo-matrix branch October 14, 2022 14:10
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.

Add matrix action to gurka
2 participants