[Liblas-devel] Throwing out_of_range exceptions on read

Mateusz Loskot mateusz at loskot.net
Sun Apr 27 18:52:23 EDT 2008


Howard Butler wrote:
> Mateusz,
> 
> Mark in Florida has some 1.1 LAS files that have points with Scan
> Angle Ranks that are outside the -90/90 range that the specification
> says.

Hobu,

Seems, Mark's file does not follow the LAS specification.
Is that possible?
If yes, then I think it would be worth to know what's the generator of
such file and provide appropriate warning/comment in libLAS FAQ.

> I just commented out the check for now:
> 
> http://liblas.org/browser/trunk/src/laspoint.cpp#L113

OK

> This begs the question, what do we do for reading invalid input?

I would prefer to keep validating it.

> Scan angle doesn't really mean too much, so for this case, following
> the spec exactly isn't going to be a deal, especially if there are
> other writers out there who aren't following. But for other items,
> especially the flags attributes, this is a big deal.

Your suggestion sounds reasonable to me. However, I'd like to propose 
some modifications (below) :-)

> Any ideas on a reasonable tact to take?  Liberal in what we read and
> strict in what we write?

1. The ASPRS LAS format is suppose to be a data exchange format,
so we always must [sic] write in strict mode. IMHO, if LAS writers are 
very  relaxed, then interoperability - a very principle of ASPRS LAS 
format - will be on paper only.

2. I'd vote for libLAS reading in semi-relaxed mode by default, what 
actually you are suggesting above, but in strict mode on request (a 
configuration setting, a program parameter, etc.).

3. While reading LAS file in semi-relaxed, the library should always 
print a warning to stdout.

How do you like it?

A general comment:
Hobu, as you've seen, when talking about standards, I always vote for 
100% of strictness :-) However, I understand some aspects of standards 
have different relevance, so less important things can be relaxed.

Greetings
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Liblas-devel mailing list