[Liblas-devel] Bug?: problem copying file with offset
Howard Butler
hobu.inc at gmail.com
Tue Mar 22 12:38:00 EDT 2011
On Mar 20, 2011, at 10:57 AM, Peder Axensten wrote:
> I have a las-file with non-zero offsets (attached below).
>
> If I used the code below to copy this file to a las-file I "lose" the offset.
This is a bug. The points being read need to be rescaled before you write them. I suspect in the compressed case, this is magically done for you.
Here's an inelegant stop gap. Please file a bug and I will try to have the writer know when the data should be rescaled.
liblas::HeaderPtr hdr = liblas::HeaderPtr(new liblas::Header());
hdr->SetCompressed(compressed);
liblas::Writer writer( ofs, *hdr );
...
while( reader.ReadNextPoint() ) {
liblas::Point p = reader.GetPoint();
p.SetHeaderPtr(hdr);
++count;
writer.WritePoint( reader.GetPoint() );
}
>
More information about the Liblas-devel
mailing list