<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Re: [Liblas-devel] St9bad_alloc (3) from method LASReader_Create</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Howard<BR>
&nbsp; Merrick. Yes, they have egregeous numbers of VLRs. They are composed of pointers to blocks of point records, to enable their proprietary software, MARS, to be fast on LAS input. Your remove_extra_header option comes in handy. Does it make sense?&nbsp; Probably to Merrick. The rest of us just have to work around it.<BR>
Rory Sutton<BR>
904-334-8373 (cell)<BR>
<BR>
----- Original Message -----<BR>
From: Howard Butler &lt;hobu.inc@gmail.com&gt;<BR>
To: Sutton, Rory J SAJ<BR>
Cc: liblas-devel@mail.hobu.net &lt;liblas-devel@mail.hobu.net&gt;; Holt, Paul R SAJ Contractor; Vogler, Dan SAJ Contractor<BR>
Sent: Fri Aug 15 13:53:33 2008<BR>
Subject: Re: [Liblas-devel] St9bad_alloc (3) from method LASReader_Create<BR>
<BR>
Rory,<BR>
<BR>
I have duplicated your findings, and I have an idea what might be&nbsp;<BR>
going on, but I have a question about the file.&nbsp; Do you know what&nbsp;<BR>
software created them?&nbsp; The problem is in the header reading code, and&nbsp;<BR>
it is seeing that there are 390 Variable Length Header records in the&nbsp;<BR>
file.&nbsp; VLRs are used by LAS softwares to store application-specific&nbsp;<BR>
stuff.&nbsp; Does it make sense that this file would have so many of these&nbsp;<BR>
records?<BR>
<BR>
Howard<BR>
<BR>
On Aug 15, 2008, at 11:51 AM, Sutton, Rory J SAJ wrote:<BR>
<BR>
&gt; We have just taken delivery on literally thousands of lidar files in&nbsp;<BR>
&gt; LAS 1.1<BR>
&gt; format.&nbsp; A few of these trigger something in lasinfo (and las2las)&nbsp;<BR>
&gt; that<BR>
&gt; results in the following:<BR>
&gt; -----------------------------------------------------------------------------<BR>
&gt; ---------<BR>
&gt; Could not open file : St9bad_alloc (3) from method LASReader_Create<BR>
&gt; -----------------------------------------------------------------------------<BR>
&gt; ---------<BR>
&gt; I'm seeing this on 64-bit linux and Windows XP (separate machines)&nbsp;<BR>
&gt; for those<BR>
&gt; few files that have this property.&nbsp; I'm a rank amateur at this but a&nbsp;<BR>
&gt; trace in<BR>
&gt; DDD/GDB on linux seems to indicate the exception is being thrown at&nbsp;<BR>
&gt; the<BR>
&gt; Init() below, from lasreader.cpp.&nbsp; A file that triggers this (at&nbsp;<BR>
&gt; least in my<BR>
&gt; environment) and one that doesn't, have been posted to<BR>
&gt; <A HREF="ftp://ftp.usace.army.mil/pub/saj/las">ftp://ftp.usace.army.mil/pub/saj/las</A> .&nbsp; I've got lots of RAM on both&nbsp;<BR>
&gt; Windows<BR>
&gt; and Linux.&nbsp; Any clues would be appreciated.<BR>
&gt;<BR>
&gt; |$Id: lasreader.cpp 813 2008-07-25 21:53:52Z mloskot $ |<BR>
&gt; -----------------------------------------------------------------------------<BR>
&gt; ---------<BR>
&gt; #include &lt;liblas/lasreader.hpp&gt;<BR>
&gt; #include &lt;liblas/detail/reader.hpp&gt;<BR>
&gt; // std<BR>
&gt; #include &lt;stdexcept&gt;<BR>
&gt; #include &lt;fstream&gt;<BR>
&gt; #include &lt;string&gt;<BR>
&gt; #include &lt;cstring&gt; // std::memset<BR>
&gt; #include &lt;cassert&gt;<BR>
&gt;<BR>
&gt; namespace liblas<BR>
&gt; {<BR>
&gt;<BR>
&gt; LASReader::LASReader(std::istream&amp; ifs) :<BR>
&gt;&nbsp;&nbsp;&nbsp; m_pimpl(detail::ReaderFactory::Create(ifs))<BR>
&gt; {<BR>
&gt;&nbsp;&nbsp;&nbsp; Init();<BR>
&gt; }<BR>
&gt; -----------------------------------------------------------------------------<BR>
&gt; ---------<BR>
&gt; _______________________________________________<BR>
&gt; Liblas-devel mailing list<BR>
&gt; Liblas-devel@mail.hobu.net<BR>
&gt; <A HREF="http://mail.hobu.net/mailman/listinfo/liblas-devel">http://mail.hobu.net/mailman/listinfo/liblas-devel</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>