Is there any Java or Maven tutorial for Graphhopper?

I’m a bit lost in this API. I’m currently using a maven project trying to understand the Java framework, and there’s barely documentation about this.
I am trying to, at least understand what is a PMap and what are the differences between a Profile, a CHProfile and a LMProfile.

If you have problems setting up your Java/Maven build environment take a look at the documentation here:

But feel free to ask further questions in case something is hard to understand. Maybe you have suggestions how to improve the documentation as well.

To understand GraphHopper’s Java API it is best to take a look at the self-contained examples in the examples module.

GraphHopper profiles are explained here: and the Profile java simply reflects these profiles in code. CH/LMProfile are just used to setup CH/LM pre-processing, which is used to make GraphHopper calculate routes faster.

Thanks easbar.
I’ve read the maven Java/Maven buid documentation, I have no problems with that. And I will take a look at the examples module.
I have another question. Is there any other way to create a new profile with other kind of vehicle apart from foot, hike, wheelchair, racing bike, etc.?

Not sure if I understand your question, which vehicle are you looking for? The recommended way to tune GraphHopper’s routes to specifics of your vehicle is using custom models:
With this you can choose a ‘base’ vehicle (like car) and adjust it to your needs, e.g. use a lower speed for certain areas, road types etc.

If i can create a profile using vehicles such as public transport, subways, railway, etc.

Public transport (including subways, trains etc. depending on your dataset) is not supported via profiles, but you need the public transport module:
Note that this is rather different than the road routing and needs a different data source as well (GTFS not OSM). The main difference is that these types of transport do not happen continuously, but one has to use a time-table / schedule to consider public transport.

Hi Ferru,

I’m currently going through the process of setting up profiles in a maven project of mine.
I recently asked some questions around the new method of custom profiles in 3.2.

Happy to help out where I can if you get stuck with anything.

Thanks both easbar and Gregws. I really appreciate your help!

Powered by Discourse