<div dir="ltr">So, you mean the problem is below code:<div><br></div><div>







<p class=""><span class="">        </span>// move nodes into deleted nodes</p>
<p class="">        <span class="">for</span> (<span class="">int</span> <span class="">i</span> = 0; <span class="">i</span> < <span class="">itemsToMove</span>; <span class="">i</span>++) {</p>
<p class="">            <span class="">int</span> <span class="">oldI</span> = <span class="">oldToNewMap</span>.keyAt(<span class="">i</span>);</p>
<p class="">            <span class="">int</span> <span class="">newI</span> = <span class="">oldToNewMap</span>.valueAt(<span class="">i</span>);</p>
<p class="">            <span class="">long</span> <span class="">newOffset</span> = (<span class="">long</span>)<span class="">newI</span> * <span class="">nodeEntryBytes</span>;</p>
<p class="">            <span class="">long</span> <span class="">oldOffset</span> = (<span class="">long</span>)<span class="">oldI</span> * <span class="">nodeEntryBytes</span>;</p>
<p class="">            <span class="">for</span> (<span class="">long</span> <span class="">j</span> = 0; <span class="">j</span> < <span class="">nodeEntryBytes</span>; <span class="">j</span> += 4) {</p>
<p class="">                <span class="">nodes</span>.setInt(<span class="">newOffset</span> + <span class="">j</span>, <span class="">nodes</span>.getInt(<span class="">oldOffset</span> + <span class="">j</span>));</p>
<p class="">            }</p>
<p class="">        }</p><p class=""><br></p><p class="">When you set newOffset, you don't clear the oldOffset?</p></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><b>Best Regards,</b><div><b>ZhiQiang ZHAO</b></div></div></div>
<br><div class="gmail_quote">On Thu, May 21, 2015 at 12:30 AM, Peter <span dir="ltr"><<a href="mailto:graphhopper@gmx.de" target="_blank">graphhopper@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hi John,<span class=""><br>
      <br>
      > I just found that it's not null<br>
      <br></span>
      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?<br>
      <br>
      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.<br>
      <br>
      Kind Regards,<br>
      Peter<div><div class="h5"><br>
      <br>
      On 19.05.2015 08:37, John Zhao wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hi,
        <div>I feel nodes should store all the tower nodes.</div>
        <div>
          <div style="font-size:12.8000001907349px">I just found that
            it's not null for:</div>
          <div style="font-size:12.8000001907349px">nodeAccess.getLatitude(graph.getNodes()+10001)</div>
          <div style="font-size:12.8000001907349px"><img src="cid:part1.09070209.03000800@gmx.de" alt="Inline image
              1" height="85" width="405"><br>
          </div>
          <div style="font-size:12.8000001907349px"><br>
          </div>
          <div style="font-size:12.8000001907349px">So, it's a little
            weird.</div>
          <div style="font-size:12.8000001907349px">what is that after
            the #nodes?</div>
          <div style="font-size:12.8000001907349px"><br>
          </div>
          <div style="font-size:12.8000001907349px">Thanks!</div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
GraphHopper mailing list
<a href="mailto:GraphHopper@openstreetmap.org" target="_blank">GraphHopper@openstreetmap.org</a>
<a href="https://lists.openstreetmap.org/listinfo/graphhopper" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
GraphHopper mailing list<br>
<a href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/graphhopper" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><br>
<br></blockquote></div><br></div>