[GraphHopper] Using Shapefile as primary data for routing

Nicolas Gillet nicolas.gillet at market-ip.com
Wed Feb 12 15:27:08 UTC 2014


The basic idea is to transform shape files into a graphhopper's graph files.
So you have 2 steps

-          Read the source shape files

-          Create and write the graph files
To read shape files in Java there are several libraries like GeoTools
To create and write the graph, you will have to use GraphHopper's API.

If you're not comfortable with Java programing, this can be a hard time though.

There are lots of samples showing how to read shape files with geotools, a quick search in google should give you dozens of example.
For the GraphHopper API the OsmReader class was a perfect sample to work on in order to create my own.

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 : Muhammad Iqnaul Haq [mailto:iqnaulhaq at gmail.com]
Envoyé : mercredi 12 février 2014 15:25
À : GraphHopper Java routing engine; Nicolas Gillet
Objet : Re: [GraphHopper] Using Shapefile as primary data for routing

Hi Nicholas

I'm afraid I still not get it because my background is not computer science, do you have a refered link like tutorial or example to do this?

On Wed, Feb 12, 2014 at 8:38 PM, Nicolas Gillet <nicolas.gillet at market-ip.com<mailto:nicolas.gillet at market-ip.com>> wrote:
Hi,

It's totally possible, I did myself.
You will have to write your own reader for your shape files and create the graph out of the data you read.
If you're working with shape files in Java, you might already know the GeoTools library. It's a good start to read shape files.
Check the existing GraphHopper's OsmReader to have hints on how to create and populate the graph, the rest depends on your data structure.
Once the graph is created you can use it as any other GH graph.

Regards,

Nicolas GILLET


Market-IP - Creating Mobile Intelligence
Phone : +32 81 33 11 11<tel:%2B32%2081%2033%2011%2011>
Fax : +32 81 33 11 10<tel:%2B32%2081%2033%2011%2010>
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 : Muhammad Iqnaul Haq [mailto:iqnaulhaq at gmail.com<mailto:iqnaulhaq at gmail.com>]
Envoyé : mercredi 12 février 2014 09:33
À : graphhopper at openstreetmap.org<mailto:graphhopper at openstreetmap.org>
Objet : [GraphHopper] Using Shapefile as primary data for routing

Hi all! I'm a new user of graphhopper. I'm working on my final academic research right now, the aim of the research is knowing how to make a route to avoid traffic-jam.
At first I'm working with pgrouting, geoserver, and openlayers but I got stucked because my route did not showed up. I found the graphhopper and interested on it.

But I've a problem, I want to use my own data (it is in shapefile .shp) format. Because in Indonesia the road network data from openstreetmap is not completed yet I thought. How can I use the data so that it can be used to graphhopper?
I want to add restricted access to each road that has a traffic jam on it, can I able to do this using graphhopper?

Need all assistance from you guys :)

regards

_______________________________________________
GraphHopper mailing list
GraphHopper at openstreetmap.org<mailto:GraphHopper at openstreetmap.org>
https://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140212/b46adffc/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/20140212/b46adffc/attachment.png>


More information about the GraphHopper mailing list