OSM way ids are not in the path details

Hi

I am kind of lost… Can someone please help me with how I can get the OSM way ids?
Previously I retrieved the osm-way-ids from the path details (after adding to the encoded values in config)…

**hopper.setEncodedValuesString("osm_way_id");**
    hopper.getCHPreparationHandler().setCHProfiles(new CHProfile("car"));
    hopper.importOrLoad();
    return hopper;
}

public static void routing(GraphHopper hopper) {
    GHRequest req = new GHRequest(38.97283745, -77.06720901,38.94379886, -77.06623885).  
            setProfile("car").
                    setPathDetails(Arrays.asList("osm_way_id")). 
                    setLocale(Locale.US);
    
    GHResponse rsp = hopper.route(req);
     // handle errors
            if (rsp.hasErrors())
                throw new RuntimeException(rsp.getErrors().toString());
            ResponsePath path = rsp.getBest();

            Map<String, List<PathDetail>> details = path.getPathDetails();

But Now it says it cannot find the osm-way-ids in path details. Where did the osm-way-ids go? How can I retrive those now?

What do you mean you it worked previously? Maybe you ran a new import and forgot to add the osm_way_id this time? Or you are using another -gh folder now?

Previously it worked. But now, after I delete the gh folder and ran it again (with osm-way-id in encoded values), it gives me this error. Don’t understand why… in the config file, osm-way-id is there

But in the docs why it does not show it?

The configuration you are showing here is all commented out.

Oh… i just copied that from online. here is my config. Also, I put 0 for distance influence, that means it should only take fastest route right?


image

You need

graph.encoded_values: osm_way_id

not

graph:
  encoded_values: osm_way_id

Yes

Oh thank you. Silly me. However, another thing just happened. If I add more attributes with/wo space after comma, it gives me same error.

image

without the space it should work

I tried without space. However, I basically need the osm-ids for now, so it is fine.

I have another question here How the speed is calculated during routing. I am trying to understand the purpose of CarAverageSpeedParser. Could you please help me with the question? The speed map in CarAverageSpeedParser are the speeds that calculate the weights of links for calculating a route?

Thank you so much

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.