<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>Hello!</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">I have a strange problem.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">I'm reading "count" points from a LAS starting at a given position ("start"):</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family:
 HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span class="Apple-tab-span" style="white-space:pre">                                    </span>LASPointH lp = LASReader_GetPointAt(reader, start);</div><div><span class="Apple-tab-span" style="white-space:pre">                                  </span>for (int n = 0; n < count; ++n)</div><div><span class="Apple-tab-span" style="white-space:pre">                                   </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                            </span>double px = LASPoint_GetX(lp);</div><div><span style="background-color: transparent;">etc...</span><span class="Apple-tab-span" style="background-color: transparent; white-space: pre;">      </span><br></div><div><span class="Apple-tab-span" style="font-size: 12pt; white-space: pre;">                                                </span><span style="font-size: 12pt;">lp = LASReader_GetNextPoint(reader);</span><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue,
 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">      if (!lp) break;</span></div><div><span class="Apple-tab-span" style="font-size: 12pt; white-space: pre;">                                 </span><span style="font-size: 12pt;">}</span><br></div><div><br></div><div>Sometimes lp becomes NULL and then the loop ends.</div><div>But:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">                                      </span>LASPointH lp = LASReader_GetPointAt(reader, start);</div><div><span class="Apple-tab-span" style="white-space:pre">                                  </span>for (int n = 0; n < count; ++n)</div><div><span class="Apple-tab-span" style="white-space:pre">                                   </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                            </span>double px = LASPoint_GetX(lp);</div><div style="margin-top: 0.1em; margin-bottom: 0.1em;"><span style="background-color:
 transparent;">etc...</span><span class="Apple-tab-span" style="background-color: transparent; white-space: pre;">      </span><br></div><div><span class="Apple-tab-span" style="font-size: 12pt; white-space: pre;">                                                </span><span style="font-size: 12pt;">lp = LASReader_GetNextPoint(reader);</span><br></div><div><span class="Apple-tab-span" style="white-space:pre">                                           </span>if (!lp)</div><div><span class="Apple-tab-span" style="white-space:pre">                                             </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                                    </span>lp = LASReader_GetPointAt(reader, start + n + 1);</div><div><span class="Apple-tab-span" style="white-space:pre">                                                    </span>if (!lp) break;</div><div><span class="Apple-tab-span" style="white-space:pre">                                              </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                    </span>}</div><div><br></div><div>This code is able to continue reading. And I ask myself: how is it possible that <span
 style="font-size: 12pt;">LASReader_GetNextPoint() returns NULL, but </span><span style="font-size: 12pt;">LASReader_GetPointAt() finds the next point correctly? I must say that this happens at the middle of the LAS, far from the end of the file.</span></div><div><span style="font-size: 12pt;">Any suggestions?</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;">Best regards!</span></div></div><div></div><div> </div><div style="font-weight:bold;">José Antonio Carmena Flores</div><div><a rel="nofollow" target="_blank" href="http://www.aule3d.com/" style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px;">www.aule3d.com</a><br></div></div></body></html>