Trying to run the map matching example, after slightly adapting it to fit the new map matching constructor, I receive the following error:
Exception in thread “main” java.lang.NoClassDefFoundError: gnu/trove/TIntCollection
Caused by: java.lang.ClassNotFoundException: gnu.trove.TIntCollection
On the last line of the following code:
String algorithm = Parameters.Algorithms.DIJKSTRA_BI;
Weighting weighting = new FastestWeighting(encoder);
AlgorithmOptions algoOptions = new AlgorithmOptions(algorithm, weighting);
MapMatching mapMatching = new MapMatching(hopper, algoOptions);
Adding the following dependency seems to solve this problem but creates a new one:
(remove spaces after every <)
> < dependency>
< groupId>net.sf.trove4j < /groupId> < artifactId>trove4j < /artifactId> < version>3.0.3 < /version> < /dependency>
The new problem is then as follows, which might be caused by this new dependency:
Exception in thread “main” java.lang.NoSuchMethodError: com.graphhopper.storage.index.LocationIndexTree.findNetworkEntries(DDLgnu/trove/set/hash/TIntHashSet;I)Z
at com.graphhopper.matching.LocationIndexMatch.findNClosest(LocationIndexMatch.java:67)
at com.graphhopper.matching.MapMatching.createTimeSteps(MapMatching.java:214)
at com.graphhopper.matching.MapMatching.doWork(MapMatching.java:170)
Thank you for any help!