[Liblas-devel] SetDataFormatId conflicts with SetCompressed

Oleg Alexandrov oleg.alexandrov at gmail.com
Wed May 8 09:47:11 PDT 2013


I have the following very simple code using libLAS-1.7.0:

#include <liblas/liblas.hpp>#include <fstream>  //
std::ifstream#include <iostream> // std::cout

int main(){
  std::ofstream ofs;
  ofs.open("file.las", std::ios::out | std::ios::binary);

  liblas::Header header;
  header.SetCompressed(true);
  header.SetDataFormatId(liblas::ePointFormat1);

  liblas::Writer writer(ofs, header);

  liblas::Point point;
  point.SetCoordinates(10, 20, 30);
  writer.WritePoint(point);
}

It gives me the error:

libLAS-1.7.0/src/detail/writer/zipwriter.cpp:124: virtual void
liblas::detail::ZipWriterImpl::WritePoint(const liblas::Point&): Assertion
`data->size() == m_zipPoint->m_lz_point_size' failed.

Removing the line:

  header.SetDataFormatId(liblas::ePointFormat1);

makes it work.

Can this be fixed, or perhaps made it more clear what is going on? Thank
you.

Oleg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/liblas-devel/attachments/20130508/f3a79292/attachment.html>


More information about the Liblas-devel mailing list