[GraphHopper] What is in nodes file?

Peter graphhopper at gmx.de
Fri May 22 09:51:53 UTC 2015


Yes, but again the real problem is that we do not throw an exception
when accessing larger indices which we should

Peter

On 21.05.2015 22:46, John Zhao wrote:
> So, you mean the problem is below code:
>
>         // move nodes into deleted nodes
>
>         for (int i = 0; i < itemsToMove; i++) {
>
>             int oldI = oldToNewMap.keyAt(i);
>
>             int newI = oldToNewMap.valueAt(i);
>
>             long newOffset = (long)newI * nodeEntryBytes;
>
>             long oldOffset = (long)oldI * nodeEntryBytes;
>
>             for (long j = 0; j < nodeEntryBytes; j += 4) {
>
>                 nodes.setInt(newOffset + j, nodes.getInt(oldOffset + j));
>
>             }
>
>         }
>
>
> When you set newOffset, you don't clear the oldOffset?
>
>
> *Best Regards,*
> *ZhiQiang ZHAO*
>
> On Thu, May 21, 2015 at 12:30 AM, Peter <graphhopper at gmx.de
> <mailto:graphhopper at gmx.de>> wrote:
>
>     Hi John,
>
>     > I just found that it's not null
>
>     null is not possible here and 0 is a valid latitude value so an
>     exception would be the best. That is indeed a bit ugly, we should
>     add a check in the nodeAccess to avoid this. Would you mind to
>     create an issue?
>
>     The problem why you can still access the indices even after
>     max.nodes is that graphhopper uses segments of 1MB and very likely
>     there is still space after the last node. And now that you get
>     even reasonable values for a latitude is probably because
>     graphhopper creates the graph, detects islands and then marks
>     certain nodes to be deleted and moves the last nodes into those
>     gaps. It reduces the node count of course but without explicitly
>     clearing the last values.
>
>     Kind Regards,
>     Peter
>
>
>     On 19.05.2015 08:37, John Zhao wrote:
>>     Hi,
>>     I feel nodes should store all the tower nodes.
>>     I just found that it's not null for:
>>     nodeAccess.getLatitude(graph.getNodes()+10001)
>>     Inline image 1
>>
>>     So, it's a little weird.
>>     what is that after the #nodes?
>>
>>     Thanks!
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150522/ee6ebf3c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 18218 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150522/ee6ebf3c/attachment.png>


More information about the GraphHopper mailing list