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

Function read_points_seek

LASzip/example/laszippertest.cpp:493–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491//---------------------------------------------------------------------------
492
493static void read_points_seek(LASunzipper* unzipper, PointData& data)
494{
495 if (unzipper==NULL)
496 return;
497
498 unsigned char c;
499 unsigned int i,j;
500 unsigned int num_errors, num_seeks;
501 double start_time, end_time;
502
503 start_time = taketime();
504 num_errors = 0;
505 num_seeks = 0;
506
507 if (settings->use_random)
508 {
509 for (i = 0; i < settings->num_points; i++)
510 {
511 if (i%1000 == 0)
512 {
513 if (num_seeks > 100) break;
514 int s = (rand()*rand())%settings->num_points;
515 fprintf(stderr, "at position %d seeking to %d\n", i, s);
516 unzipper->seek(s);
517 num_seeks++;
518 i = s;
519 }
520 unzipper->read(data.point);
521 srand(i);
522 c = rand() % 256;
523 for (j = 0; j < data.point_size; j++)
524 {
525 if (data.point_data[j] != c)
526 {
527 log("%d %d %d != %d\n", i, j, data.point_data[j], c);
528 num_errors++;
529 if (num_errors > 20) break;
530 }
531 c = rand() % 256;
532 }
533 if (num_errors > 20) break;
534 }
535 }
536 else
537 {
538 for (i = 0; i < settings->num_points; i++)
539 {
540 if (i%1000 == 0)
541 {
542 if (num_seeks > 100) break;
543 int s = (rand()*rand())%settings->num_points;
544 fprintf(stderr, "at position %d seeking to %d\n", i, s);
545 unzipper->seek(s);
546 num_seeks++;
547 i = s;
548 }
549 unzipper->read(data.point);
550 c = (unsigned char)i;

Callers 1

run_testFunction · 0.85

Calls 6

logFunction · 0.85
taketimeFunction · 0.70
seekMethod · 0.45
readMethod · 0.45
closeMethod · 0.45
get_errorMethod · 0.45

Tested by

no test coverage detected