[GraphHopper] Surface of a routing section?

Peter graphhopper at gmx.de
Mon Nov 10 20:15:47 UTC 2014


Hi Achim,

currently only unpaved or paved (unpavedBit) and road, pushing section,
cycleway or other small way is stored (wayTypeEncoder) is stored for
later access (see BikeCommonFlagEncoder) but you should be able to
extend the bike encoders to your needs and store any kind of information
e.g. introduce a new 'EncodedValue surfaceEncoder'

To get that data you can override the GraphHopper.getPaths method where
you get raw access to the edges via Paths.calcEdges. Then with the
encoder do

encoder.isBool(edge.getFlags(), BikeCommonFlagEncoder.UNPAVED) 

or

encoder.getLong(edge.getFlags(), YourClass.SURFACE_CODE) // returns a long which you can convert to the strings


or like it is done for wayTypeEncoder:

encoder.getAnnotation(edge.getFlags(), tanslation )


Regards,
Peter.

On 10.11.2014 20:57, Achim Augenstein wrote:
> Hi
>
> i use the cycle routing of Graphhopper. How can i get the  length AND
> the surface of a routing section from the standalone API (getter
> function?)?
>
> Thanks
> Achim
>
>
> _______________________________________________
> GraphHopper mailing list
> 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/20141110/eaeb3c4c/attachment.html>


More information about the GraphHopper mailing list