<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Andreas,<br>
<br>
to store some edge or node information somewhere you can just use an
array with the edgeId or nodeId as index. To make this the
"graphhopper way" you can use one of the DataAccess implementations.
The disadvantage is a bit more complex handling, but the advantages
are that these integer or byte 'arrays' increase segment by segment
(important for large arrays), that you can store this to disc or
switch on demand to be used in-memory or memory mapped (important
for mobile usage). <br>
<br>
To store multiple values of different length per edge it gets a bit
more complicated when you need to be memory efficient (large areas)
and want to avoid Object[], then you need two DataAccess objects,
one emulates the pointer access and the other stores the different
sized information. E.g. we do this for wayGeometry in
GraphHopperStorage.<br>
<br>
<br>
> I also did not find a way to get the direction of travel<br>
<br>
Every EdgeIteratorState is already in the correct direction, where
baseNode is the 'from' and adjNode is the 'to'. Now look into
AbstractFlagEncoder.reverseFlags where we swap flags that are
dependent of the direction like the access bits. In your case
probably just use an array of size=edgeIds*2 and
GHUtility.createEdgeKey.<br>
<br>
<br>
> My only problem now is that I did not find a way to store node
properties without a custom storage extension.<br>
<br>
Yes, currently only one storage extension is possible, there was a
pull request but obviously we lost the submitter's energy:<br>
<a class="moz-txt-link-freetext" href="https://github.com/graphhopper/graphhopper/pull/278">https://github.com/graphhopper/graphhopper/pull/278</a><br>
<br>
Regards,<br>
Peter<br>
<br>
On 15.05.2015 11:54, Andreas Wolf wrote:<br>
<blockquote type="cite">Hi,<br>
<br>
I need to store information about some nodes (pillar and tower) in
the<br>
graph. More specifically, I’m interested in traffic lights and
some<br>
traffic signs.<br>
I don’t need to have this used during routing, as I will only use
the<br>
route calculated by Graphhopper as a base for further calculations
–<br>
so as long as it is not totally off limits, it is good enough for
my<br>
purpose, even if the travel times are sometimes much too low. But<br>
probably we can improve that with my work…<br>
<br>
My first approach, based on the work by Jan Soelter, was to store
the<br>
count of traffic lights for each edge, using two flags for traffic<br>
lights at the start and end of the edge, plus a counter for the<br>
intermediate traffic lights.<br>
This works in general, but has several flaws. One is that it is<br>
impossible to get the exact location of the light, which would be
a<br>
problem on longer roads (imagine a pedestrian crossing on longer
roads<br>
within a city).<br>
I also did not find a way to get the direction of travel, which
makes<br>
the start/end flags kind of not-so-useful.<br>
<br>
My current idea is to store the additional data with the nodes,
which<br>
would remove the above mentioned flaws and would enable me to get
a<br>
detailed list of road segments with the traffic signs and lights
along<br>
them. That is basically what I need in the end.<br>
<br>
My only problem now is that I did not find a way to store node<br>
properties without a custom storage extension.<br>
Is there a kind of "node flags" like there is for edges and I just<br>
overlooked it?<br>
Or is a storage extension (which would make using turn costs<br>
impossible) the only viable solution? If yes, would it be an
option to<br>
integrate node flags into the graph storage?<br>
<br>
<br>
Regards<br>
Andreas<br>
</blockquote>
<span style="white-space: pre;">><br>
> _______________________________________________<br>
> GraphHopper mailing list<br>
> <a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><br>
> <a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a></span><br>
<br>
<br>
</body>
</html>