[GraphHopper] What is in nodes file?

John Zhao johnthu at gmail.com
Thu May 21 20:46:51 UTC 2015


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> 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)
> [image: Inline image 1]
>
>  So, it's a little weird.
> what is that after the #nodes?
>
>  Thanks!
>
>
> _______________________________________________
> GraphHopper mailing listGraphHopper at openstreetmap.orghttps://lists.openstreetmap.org/listinfo/graphhopper
>
>
>
> _______________________________________________
> 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/20150521/d9abaa70/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/20150521/d9abaa70/attachment.png>


More information about the GraphHopper mailing list