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

Allow pedestrian routing through highway=via_ferrata #4732

Open
zstadler opened this issue May 14, 2024 · 6 comments
Open

Allow pedestrian routing through highway=via_ferrata #4732

zstadler opened this issue May 14, 2024 · 6 comments

Comments

@zstadler
Copy link

It looks like pedestrian routing through highway=via_ferrata is not possible.

For example, routing through hiking route 438 is not possible because one of its members is highway=via_ferrata.

If a highway=via_ferrata does not have a sac_scale tag, it can be assumed to require max_hiking_difficulty=6.

@Jay-Kishn
Copy link

Hey @nilsnolde, could you assign me the issue and let me know where to start looking?

@kevinkreiser
Copy link
Member

@Jay-Kishn you'll probably want to start by looking at graph.lua. in there you should be able to single out via_ferrata by giving it pedestrian access (and no other accesses). you can do that by adding it to the highway map at the top. you can then check if it doesnt have a sac_scale and in the case that it doesn't add it and set it to difficult_alpine_hiking.

that should be enough to get it working but it would be best if you make a gurka test to prove that it works. let me know when you get to that point and i can give you an example. thanks for volunteering!

@Jay-Kishn
Copy link

Jay-Kishn commented Jun 5, 2024

I spent some time trying to write the test but it fails everytime the tag is defined as pedestrian or path. I wanted to work directly with via_ferrata but decided to make sure the path tag works. This is one of the examples that did not work for me. Am I going about it the right way?

#include <gtest/gtest.h>
#include "gurka.h"

using namespace valhalla;

class Example : public ::testing::Test {
protected:
  static gurka::map map;

  static void SetUpTestSuite() {
    const std::string ascii_map = R"(
        A----B---C---D
    )";

    const gurka::nodes nodes;
    const gurka::ways ways = {
      {"AB", {{"highway", "pedestrian"}}},
      {"BC", {{"highway", "pedestrian"}}},
      {"CD", {{"highway", "pedestrian"}}}
    };

    auto layout = gurka::detail::map_to_coordinates(ascii_map, 100);
    map = gurka::buildtiles(layout, ways, nodes, {}, "test/data/example", {});
  }
};

gurka::map Example::map = {};

TEST_F(Example, CheckExample) {
  auto result = gurka::do_action(valhalla::Options::route, map, {"B", "C"}, "pedestrian");
  gurka::assert::raw::expect_path(result, {"BC"});
}

The error that I get is:
image

@nilsnolde
Copy link
Member

hm, how exactly are you running the test and where? what if you cd into the build directory and run the test from there? it rings a pretty loud bell..

@nilsnolde
Copy link
Member

and please format your text properly so it's easier to read. and for future reference: pls copy/paste text from terminals, pics of text is exhausting to look at and pointless.

@Jay-Kishn
Copy link

Jay-Kishn commented Jun 6, 2024

hm, how exactly are you running the test and where? what if you cd into the build directory and run the test from there? it rings a pretty loud bell..

I'm running it through make run-gurka_testname followed by a ./gurka_testname . I am doing this by cd-ing into the build directory.

and please format your text properly so it's easier to read. and for future reference: pls copy/paste text from terminals, pics of text is exhausting to look at and pointless.

alright i'll keep that in mind

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

No branches or pull requests

5 participants