[GraphHopper] adding node attribute at runtime
Peter
graphhopper at gmx.de
Wed Sep 16 07:41:00 UTC 2015
Hi Wesam
> What is the fastest/most effecient way to attach a new attribute to a
specific node in Graphhopper.
I assume you need a very fast way to fetch this information on the fly
while the algorithm is running (?)
Then still this depends on the data and the algorithm you use. I would
use a bitset, a (trove) HashMap/Set or an array. Or if persistence is
needed a DataAccess object. This depends on how sparse the data is, as a
primitive or Object array can be very large but e.g. a HashMap requires
storing the keys, potential resizing, has a bit slower access and has
roughly 30% or more empty space.
And also if you use A* then you access the node its lat,lon values
stored in the nodes DataAccess object, then it will be faster to expand
the internal 'nodes' array, as such closely stored values are better
cacheable from the CPU. You can store currently only one int value
there, but only if no turn restrictions are used (will be improved later
of course)
BTW: Please see here <https://discuss.graphhopper.com/> our new
discussion board (here
<https://discuss.graphhopper.com/t/moving-mailing-list-to-discuss-graphhopper-com/42>
is the reason). And I would like to ask you to create a new topic there
instead of replying here.
Kind Regards,
Peter
On 16.09.2015 09:08, wesam Herbawi wrote:
> What is the fastest/most effecient way to attach a new attribute to a
> specific node in Graphhopper. I was thinking of own nodes array or
> hashtable (as only subset of these nodes might be assigned the new
> attribute). I hope that there is another possibility provided by
> Graphhopper.
>
> Regards,
> Wesam
>
>
> _______________________________________________
> 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/20150916/85b2f223/attachment.html>
More information about the GraphHopper
mailing list