[Liblas-devel] Throwing out_of_range exceptions on read
Howard Butler
hobu.inc at gmail.com
Mon Apr 28 14:24:18 EDT 2008
Here is what I propose for a LASPoint::Validate() method:
bool LASPoint::Validate() const
{
if (eScanAngleRankMin > this->GetScanAngleRank() || this-
>GetScanAngleRank() > eScanAngleRankMax)
throw std::out_of_range("scan angle rank out of range");
if (this->GetFlightLineEdge() > 0x01)
throw std::out_of_range("edge of flight line out of range");
if (this->GetScanDirection() > 0x01)
throw std::out_of_range("scan direction flag out of range");
if (this->GetNumberOfReturns() > 0x07)
throw std::out_of_range("number of returns out of range");
if (this->GetReturnNumber() > 0x07)
throw std::out_of_range("return number out of range");
if (this->GetTime() < 0.0)
throw std::out_of_range("time value is < 0 ");
if (this->GetClassification() > 31)
throw std::out_of_range("classification value is > 31");
return true;
}
On Apr 28, 2008, at 6:32 AM, M S wrote:
>
> Great application! Very fast. I put the las* commands in a simple
> perl script, and it cranks right through 23 tiles (5K x 5K ft).
> Scanning, file, eliminating codes and creating bare earth .txt files
> for GRASS input. the las files are ~150MB in size, and it just
> blazes through them.
Thanks. Glad it is working out well for you.
More information about the Liblas-devel
mailing list