liblas georeference las file and update header

المشرف العام

Administrator
طاقم الإدارة
I am just starting yo use liblas and I had a small issue and I am hoping that you can help me.

I have next code to generate a las file with geo-referenced points:

std::eek:fstream ofs; liblas::Header header; liblas::SpatialReference srs; srs.SetFromUserInput("EPSG:4326"); header.SetSRS(srs); header.SetPointRecordsCount(1); ofs.open("H:\\temp\\test2.las", std::ios::eek:ut | std::ios::binary); liblas::Writer writer(ofs, header); liblas::point point(&header); point.SetCoordinates(1.0, 2.0, 3.0); writer.WritePoint(point); point.SetCoordinates(5, 5, 5); writer.WritePoint(point); point.SetCoordinates(-1, -1, -1); writer.WritePoint(point); header.SetPointRecordsCount(3); writer.SetHeader(header); writer.WriteHeader(); ofs.Close(); When I run lasinfo over this file I get: (It says that I have 3 points, but my spatial reference is none) enter image description here


Same code above, but if I comment this line:

//writer.SetHeader(header); (I can see the spatial reference, but the number of points is 1) enter image description here


Am I doing something wrong?

Thank you!



أكثر...
 
أعلى