MCPcopy Create free account
hub / github.com/LAStools/LAStools / load

Method load

src/lascopcindex.cpp:535–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533 }
534
535 void load()
536 {
537 if (point_buffer) laserror("internal error load() has been called twice. Please report.");
538
539 reactivate("r+b");
540
541 size_t size = (size_t)point_count * (size_t)point_size;
542 point_buffer = (U8*)malloc_las(size);
543
544 if (point_buffer != nullptr)
545 {
546 fseek_las(fp, 0, SEEK_SET);
547 if (fread(point_buffer, point_size, point_count, fp) != (size_t)point_count) {
548 laserror("Error reading file: %s", strerror(errno));
549 }
550 } else {
551 laserror("Memory allocation failed: requested %zu bytes for %d points: %s", size, point_count, strerror(errno));
552 }
553
554 close();
555 };
556
557 void clean()
558 {

Callers

nothing calls this directly

Calls 3

laserrorFunction · 0.85
malloc_lasFunction · 0.85
fseek_lasFunction · 0.85

Tested by

no test coverage detected