[GraphHopper] Drawing map and route

Nicolas Gillet nicolas.gillet at market-ip.com
Wed Jul 3 07:12:12 UTC 2013


Hi Dmitriy

GraphHopper only meant to compute routes between two points, displaying it on a map is a hole other story.
However, GraphHopper come with a nice web application that can create and display routes on a map. This is the graphhopper-web module.
Here is how to use it https://github.com/graphhopper/graphhopper/tree/master/web

For desktop application you have to create your own and the hardest part will probably be to display a map background.
This can be done by either getting this map from internet through a API’s like OSM, MapQuest, Google and some other or creating your own map from data with a map rendering tool like Mapnik, the latest requiring more effort.

Regards,

Nicolas GILLET


Market-IP – Creating Mobile Intelligence
Phone : +32 81 33 11 11
Fax : +32 81 33 11 10
www.market-ip.com<http://www.market-ip.com/> – www.telefleet.com<http://www.telefleet.com/> – www.geoplanning.net<http://www.geoplanning.net/> – www.drivexpert.net<http://www.drivexpert.net/>
[Description : cid:image003.png at 01CD5521.849F3340]<http://www.linkedin.com/groups/MarketIP-4289716?gid=4289716&trk=hb_side_g>

De : Дмитрий Пучков [mailto:d-puchkov at mail.ru]
Envoyé : mercredi 3 juillet 2013 08:09
À : GraphHopper at openstreetmap.org
Objet : [GraphHopper] Drawing map and route

Hello!
Tell me please, how to start desktop application with a rendered map?

I work at eclipse, and i have four projects imports from https://github.com/graphhopper/graphhopper:
1)graphhopper
2)graphhopper-parrent
3)graphhopper-tools
4)graphhopper-web

In my class I do next :

 GraphHopper gh;
 private static final String ghLoc = "/home/dmitriy/graphhopper/core/target";
 private static final String testOsm = "/home/dmitriy/graphhopper/russia-european-part-latest.osm.pbf";
 gh = new GraphHopper().setInMemory(true, false).setEncodingManager(
                new EncodingManager("CAR")).setCHShortcuts(true, true).setGraphHopperLocation(
                ghLoc).setOSMFile(testOsm);
        gh.importOrLoad();
        GHResponse ph = gh.route(new GHRequest(51.2492152, 9.4317166, 51.2, 9.4).setAlgorithm("dijkstrabi"));

It works fine, but I can not understand how to run a graphical map and draw a route on it.
Would you please explain to me?
I will be very grateful!
--
Dmitriy Puchkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130703/16d10ad7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1263 bytes
Desc: image001.png
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130703/16d10ad7/attachment.png>


More information about the GraphHopper mailing list