Search code examples
c++crashliblas

LibLas crashes when setting spatial reference manually


I am trying to set the spatial reference manually, but it is crashing.

std::ofstream ofs;
liblas::Header header;
liblas::SpatialReference srs;
srs.SetFromUserInput("EPSG:4326"); // It crashes here
header.SetSRS(srs);
header.SetPointRecordsCount(1);
ofs.open("test.las", std::ios::out | std::ios::binary);
liblas::Writer writer(ofs, header);

Any ideas?


Solution

  • Problem has disappear after adding the environment variable.

    GDAL_DATA "C:\OSGeo4W64\share\epsg_csv"