[Liblas-devel] Problem with LASReader_GetNextPoint()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Liblas-devel] Problem with LASReader_GetNextPoint()

jcurru
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

_______________________________________________
Liblas-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/liblas-devel
Loading...