I just wrote a PostGIS-reader that can create a GraphHopper graph directory directly from a PostGIS Table or View. This is just basically derived from the Shapefile-reader.
With this, we can:
use custom network data like the DRM ( http://www.drm.jp/english/drm/e_index.htm ) instead of just OSM.
add business logic to the route by having custom costs derived from the Views.
add special values to the attributes. In our application, we need the DRM IDs after a shortest path has been created, so the ID was placed in the OSM Name tag when creating a view, and we obtain the ID with a getName() after a path creation.
create semi-dynamic routes by just deleting the graph directory and restarting graphhopper at certain time intervals to create a new graph with newer cost values.
Again for the DRM, we created a view like the sample below, and then created directly a graph from it for GraphHopper.
create view drmview
as select id,0,‘B’::text,
when rdclasscd = ‘1’ then ‘motorway’
when rdclasscd = ‘2’ then ‘motorway’
when rdclasscd = ‘3’ then ‘trunk’
when rdclasscd = ‘4’ then ‘primary’
when rdclasscd = ‘5’ then ‘primary’
when rdclasscd = ‘6’ then ‘secondary’
when rdclasscd = ‘7’ then ‘tertiary’
when rdclasscd = ‘9’ then ‘road’
The source code is in my forked GraphHopper repository in GitHub under the postgis branch. I hope that this can be useful for somebody else as well.