Encoder for car not found. Existing: foot|

I described my problem with matching with vehicle different than car as the issue with newest versions: Encoder for car not found. Existing: foot| · Issue #160 · graphhopper/map-matching · GitHub

I have problem with version 1.0:
java -jar matching-web/target/graphhopper-map-matching-web-1.0-SNAPSHOT.jar import –vehicle=foot xxx.pbf

than I cannot do any:
java -jar matching-web/target/graphhopper-map-matching-web-1.0-SNAPSHOT.jar match yyy.gpx

got an error:
loading graph from cache java.lang.IllegalArgumentException: Encoder for car not found. Existing: foot|speed_factor=1.0|speed_bits=4|turn_costs=false|version=5 at com.graphhopper.routing.util.EncodingManager.getEncoder(EncodingManager.java:394) at com.graphhopper.routing.util.EncodingManager.getEncoder(EncodingManager.java:385) at com.graphhopper.matching.MapMatching.<init>(MapMatching.java:104) at com.graphhopper.matching.cli.MatchCommand.run(MatchCommand.java:83) at io.dropwizard.cli.Cli.run(Cli.java:78) at io.dropwizard.Application.run(Application.java:93) at com.graphhopper.matching.http.MapMatchingApplication.main(MapMatchingApplication.java:16)

version 0.13 works perfetcly

and was redirected here to discuss.

I haven’t understood @karussell 's answer:

Did you recreate the graph?
–vehicle=foot
This won’t work anymore. You should put this in the config file instead.

import command with option --vehicle=foot still works in newest versions

in older version match command just used vehicle type which was imported into cache, newest versions always looks for car

It seems for me, that match and import command doesn’t look to config.yml, I set graph.flag_encoders: hike or foot, but it still looks for car in cache.

what I did wrong? which config file I should use?

Ups, you are right: the vehicle parameter should still work. Please remove the created graph-cache folder and do the import again (you have to do this everytime the version changes)

doesn’t look to config.yml, I set graph.flag_encoders

Yes, sorry. The command line will overwrite the values set in config.yml

The problem still there.
Importing works in 1.0pre4 (and older) but “matching” after 1.0pre2 (vehicle= foot) always shows the same error:

java -jar matching-web/target/graphhopper-map-matching-web-1.0-SNAPSHOT.jar match cf.gpx --gps_accuracy 10 --max_visited_nodes 10000

loading graph from cache

java.lang.IllegalArgumentException: Encoder for car not found. Existing: foot|speed_factor=1.0|speed_bits=4|turn_costs=false|version=5

at com.graphhopper.routing.util.EncodingManager.getEncoder(EncodingManager.java:394)

at com.graphhopper.routing.util.EncodingManager.getEncoder(EncodingManager.java:385)

at com.graphhopper.matching.MapMatching.(MapMatching.java:104)

at com.graphhopper.matching.cli.MatchCommand.run(MatchCommand.java:83)

at io.dropwizard.cli.Cli.run(Cli.java:78)

at io.dropwizard.Application.run(Application.java:93)

at com.graphhopper.matching.http.MapMatchingApplication.main(MapMatchingApplication.java:16)

exactly the same for me.
I’m able to import any vehicle type, but matching looks like fixed for car. When you imported car it works, but when any other vehicle than car is imported matching command looks always for car type.

@braito4 just downloaded tag map-matching-1.0-pre2 and confirm, that this is newest working version.

@karussell can you verify that we are doing everything ok?

C:\Users\michal\Desktop\map-matching-1.0-pre2>java -jar matching-web\target\graphhopper-map-matching-web-1.0-SNAPSHOT.jar import --vehicle=hike \m\maps\malopolskie-latest.osm.pbf
C:\Users\michal\Desktop\map-matching-1.0-pre2>java -jar matching-web\target\graphhopper-map-matching-web-1.0-SNAPSHOT.jar match \m\data\gps\activities_filtered_by_regions\tatry\2010-07-10_13-24-51.gpx
loading graph from cache
\m\data\gps\activities_filtered_by_regions\tatry\2010-07-10_13-24-51.gpx
matches: 83, gps entries:10594
gpx length: 25176.574 vs 22476.8
export results to:C:\m\data\gps\activities_filtered_by_regions\tatry\2010-07-10_13-24-51.gpx.res.gpx
gps import took:0.22606899s, match took: 0.1866135

This is a bug that will be fixed soonish. See: https://github.com/graphhopper/map-matching/issues/160