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 <[email protected]> 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 
> [email protected]https://lists.openstreetmap.org/listinfo/graphhopper
>
>
>
> _______________________________________________
> GraphHopper mailing list
> [email protected]
> https://lists.openstreetmap.org/listinfo/graphhopper
>
>
_______________________________________________
GraphHopper mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/graphhopper

Reply via email to