Do not show multiple vehicle in local host webapp in graphhoper expect car and foot

See the config.properties file. The default is only car, you can add more if you want. There is an upper limit, depending on which vehicles you choose, so I would advise you not to add too many.

1 Like

how?
graph.flag_encoders=car,foot

can not see there?

Yes, exactly.

You will get an exception. Just try to add 10, this won’t work. I think 4-5 might work, depending on the vehicles, some vehicles need more storage space than others.

1 Like

I am not able to find the limit in code base.Please

 And  Yes I getting error

Exception in thread "main" java.lang.IllegalStateException: Encoding does not match:
Graphhopper config: 

car|speed_factor=5.0|speed_bits=5|turn_costs=false|version=1,foot|speed_factor=1.0|speed_bits=4|turn_costs=false|version=3,bike|speed_factor=2.0|speed_bits=4|turn_costs=false|version=2
Graph: car|speed_factor=5.0|speed_bits=5|turn_costs=false|version=1, dir:/home/jsroyal/Documents/india-latest.osm-gh/

at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:235)
at com.graphhopper.GraphHopper.load(GraphHopper.java:760)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:617)
at com.graphhopper.http.GraphHopperModule$3.start(GraphHopperModule.java:182)
at com.graphhopper.http.GHServer.start(GHServer.java:123)
at com.graphhopper.http.GHServer.start(GHServer.java:63)
at com.graphhopper.http.GHServer.main(GHServer.java:58)

Well, it’s a bit hidden, it’s just the amount of flags.

If you change the properties file you have to delete the graph folder and reimport it. rm -r /home/jsroyal/Documents/india-latest.osm-gh/

2 Likes

@boldtrn one more issue with that not able to build a graph for another type of vehicles except car and foot.

 Possible options: car,foot,bike,bike2,mtb,racingbike,motorcycle (comma separated)
 bike2 takes elevation data into account (like up-hill is slower than down-hill) and requires enabling graph.elevation.provider below

graph.flag_encoders=foot|car|motorcycle

I get only the map of car and foot.
please can you help :sunny:

@jsroyal, you essentially answered your own question. Please read your own question, especially the “code part”, especially the parts in “()” and compare it to your own configuration.

1 Like

@boldtrn There was one mistake I get it.There was two config files and I was updating another file.
Can you help me to turn restriction of a truck or big vehicle?
I go through one pull request but do not get much about.

The truck profiles are not (yet) part of the open source solution, but you could try the DataFlagEncoder that supports height, width and weight restrictions. The turn restrictions can be enabled e.g. via graph.flag_encoders=car|turn_costs=true

Thanks @karussell I did implement truck profile and [quote=“karussell, post:10, topic:2054”]
graph.flag_encoders=car|turn_costs=true
[/quote]

Enable these but does not work for u-turn.