mbasa / graphhopper-reader-postgis

Read data from PostGIS tables into GraphHopper
GNU Lesser General Public License v3.0
6 stars 6 forks source link

graphhopper-reader-postgis

Creating a GraphHopper Graph from a PostGIS Table

  ##### PostGIS Connection Parameters #####

  db.host: localhost
  db.port: 5432
  db.database: pgr
  db.table: graphhopper
  db.schema: public
  db.user: mbasa
  db.passwd: passwd
  db.tags_to_copy:
osm_id, maxspeed, oneway, fclass, name, geom 

For example:

 create view graphhopper 
   (osm_id,maxspeed,oneway,fclass,name,geom ) 
   as select id,0,'B'::text,'tertiary'::text,name,geom from phil;

Turn Restrictions

 no_left_turn
 no_right_turn
 no_straight_on
 no_u_turn
 no_entry
 only_right_turn
 only_left_turn
 only_straight_on

Conditionals

...
db.tags_to_copy: access_conditional,oneway_conditional

Starting the GraphHopper Server

java -jar web/target/graphhopper-web-5.3.jar server config.yml

Reference

For more information refer to this blog on the postgis-reader.