Hi Robert,

Sorry I missed the last posts.


I tried the sample you tested and it is pretty weird. It seems that the
number of points declared in the header (
reader.GetHeader().GetPointRecordsCount() ) is wrong.

The header returns *3837973 *as the number of points, but the reader
crashes after *3813697*. As the numbers do not match, the
*ReadResult::ERROR_IN_READING_FILE* exception is raised.

I hacked the code to stop when the point number *3813697 *is reached, and
the file loads fine. Of course, I can not see what happens to the ghost
points (from *3813697* till *3837973*).

I will try to check with other loaders if the file is badly formatted or
not, and additionally, adding some "validity control" to the OSG loader*.*


Here the console output (verbose) using the following hacked code (a mere
break when the crash is expected)..



            // now we do a second pass substracting the mid point to each
point
            reader.Reset();
            uint32_t i = 0;
            while (reader.ReadNextPoint())
            {
*                if ( i == 3813697 ) break; // hacked for
"LAS12_Sample_withRGB_Quick_Terrain_Modeler.las"*
                liblas::Point const& p = reader.GetPoint();




File name: LAS12_Sample_withRGB_Quick_Terrain_Mo
Signature: LASF
Format   : 2
Project  : 00000000-0000-0000-0000-000000000000
Points count: *3837973*
VLRecords count: 3
Points by return: 3837973 0 0 0 0 0 0
Min Max calculation. Elapsed Time: 1669.29

X: (728262.803178, 728998.135178)
Y: (4676439.019454, 4677014.685454)
Z: (292.647965, 327.077965)

Read points: *3813697 *Elapsed Time: 1366.333353









On Mon, Dec 22, 2014 at 12:39 PM, Robert Osfield <[email protected]>
wrote:

> Hi Rafa and Aitor,
>
> On 19 December 2014 at 00:04, Rafa Gaitan <[email protected]> wrote:
>
>> Hi Robert,
>>
>> Here you can find some samples for LAS files:
>> http://www.liblas.org/samples/
>>
>> If you have liblas built with laszip support, then .LAZ files can be also
>> opened.
>>
>
> Thanks for the link.  For .laz files we'd need to add in an alias for that
> extension to the plugin and Registry.cpp.
>
> I have just tried a couple of .las files, one loaded but another caused a
> crash:
>
> $ osgviewer LAS12_Sample_withRGB_Quick_Terrain_Modeler.las
> terminate called after throwing an instance of 'std::invalid_argument'
>   what():  invalid file signature
> Aborted (core dumped)
>
> I downloaded the above LAS file from the http://www.liblas.org/samples/
> directory.
>
> I haven't done any further investigation yet.
>
> Robert.
>
>
>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>


-- 
Aitor Moreno
   aitormoreno [@] gmail.com
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to