[Liblas-devel] Problem with LASReader_GetNextPoint()

José Antonio Carmena jcurru at yahoo.es
Thu Nov 28 01:13:26 PST 2013


Hello!

I have a strange problem.
I'm reading "count" points from a LAS starting at a given position ("start"):

LASPointH lp = LASReader_GetPointAt(reader, start);
for (int n = 0; n < count; ++n)
{
double px = LASPoint_GetX(lp);
etc...

lp = LASReader_GetNextPoint(reader);

      if (!lp) break;
}


Sometimes lp becomes NULL and then the loop ends.
But:

LASPointH lp = LASReader_GetPointAt(reader, start);
for (int n = 0; n < count; ++n)
{
double px = LASPoint_GetX(lp);
etc...

lp = LASReader_GetNextPoint(reader);

if (!lp)
{
lp = LASReader_GetPointAt(reader, start + n + 1);
if (!lp) break;
}
}

This code is able to continue reading. And I ask myself: how is it possible that LASReader_GetNextPoint() returns NULL, but 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.
Any suggestions?

Best regards!
 
José Antonio Carmena Flores
www.aule3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/liblas-devel/attachments/20131128/16b1ae01/attachment.html>


More information about the Liblas-devel mailing list