Alex
Alex

Reputation: 3

Problems with Graphhopper application

I am trying to make an map with Graphhopper but after I choose and load the map completely on the screen, there are some problems, you can see in the pictures below:

When the map loaded

screensho1

When I hold tap on the screen for routing screenshot2

Why did this happen? and how to fix it?

Upvotes: 0

Views: 432

Answers (1)

jav974
jav974

Reputation: 1042

Hard to figure out without logs, but i encountered a similar problem recently.

If you're in the same situation as i was :

This means that your berlin-gh folder does not contain the data relative to the EncodingManager your are trying to use.

First it is important to know which kind of EncodingManager you are using, they can be either of the following : "foot","car","bike","bike2",etc...

Now let's say you want to get the foot path from one point to another on your map, then you must be building somewhere in your code your graph request :

GHRequest yourRequest(latitudeStart, longitudeStart, latitudeEnd, longitudeEnd); yourRequest.setVehicle(EncodingManager.FOOT); // or .CAR, .LOL (lol)

These data are constructed by the graphhopper.sh script when you import the map of your choice :

  • edit the config.properties file inside the graphhopper folder
Vehicles #####

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.flagEncoders=foot

               ^ Put here your comma separated list of vehicle you want to support
  • now delete any folder created by graphhopper with previous attempts of import (otherwise the command below will fail)

  • then launch graphhopper.sh import "your map path"

At this point it should have created the (let's say) berlin-gh folder with the support for the vehicle you chose.

Put this folder in your application (wherever you load it) and now you can configure your graphrequest to load paths for the encodingmanager of your choice.

Hope i'm clear enough.

Upvotes: 1

Related Questions