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() );
                                }

> 

_______________________________________________
Liblas-devel mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/liblas-devel

Reply via email to