[Liblas-devel] Updating header information when writing a .laz file

James Hargrave jhargrave at photomodeler.com
Thu Oct 27 12:24:34 EDT 2011


I'm a total liblas newbie, so I could be way off base here (wouldn't be
anything new :) ).  But I found that when I updated the header with bounding
box information etc.  I needed to re-set the header on the writer like this:

	header.SetMin( min.X(), min.Y(), min.Z() );
	header.SetMax( max.X(), max.Y(), max.Z() );

	writer->SetHeader(header);
	writer->WriteHeader();

If I didn't do that it wouldn't work.

Cheers,
- James


> -----Original Message-----
> From: liblas-devel-bounces at lists.osgeo.org [mailto:liblas-devel-
> bounces at lists.osgeo.org] On Behalf Of Peder Axensten
> Sent: October-27-11 7:05 AM
> To: liblas-devel at lists.osgeo.org
> Subject: [Liblas-devel] Updating header information when writing a .laz
> file
> 
> Maybe I've missed something, but liblas doesn't seem to update the header
> information when closing a file it has been writing to.
> 
> So I have created a class that handles this in its destructor. The problem
> is that although it works on uncompressed (.las) files, this corrupts
> compressed (.laz) files. I guess that supplying a header with the correct
> information already when creating the file would work, but usually the
> info (e.g. bounding box, number of points by return) is not available
then.
> 
> Are there any plans to make liblas update the header information
> 'automagically'?
> Is the issue with corrupt .laz files known?
> 
> I've tried it on 1.7.0b2 and on the latest (this morning) from git.
> 
> Best regards,
> 
> Peder Axensten
> Research engineer
> 
> Swedish University of Agricultural Sciences
> Dept. of Forest Resource Management
> Forest Remote Sensing
> _______________________________________________
> Liblas-devel mailing list
> Liblas-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/liblas-devel




More information about the Liblas-devel mailing list