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

Function read_points

LASzip/example/laszippertest.cpp:365–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363//---------------------------------------------------------------------------
364
365static void read_points(LASunzipper* unzipper, PointData& data)
366{
367 if (unzipper==NULL)
368 return;
369
370 unsigned char c;
371 unsigned int i,j;
372 unsigned int num_errors;
373 double start_time, end_time;
374
375 start_time = taketime();
376 num_errors = 0;
377
378 if (settings->use_random)
379 {
380 srand(settings->seed);
381 c = rand() % 256;
382 for (i = 0; i < settings->num_points; i++)
383 {
384 unzipper->read(data.point);
385 for (j = 0; j < data.point_size; j++)
386 {
387 if (data.point_data[j] != c)
388 {
389 log("%d %d %d != %d\n", i, j, data.point_data[j], c);
390 num_errors++;
391 if (num_errors > 20) break;
392 }
393 c = rand() % 256;
394 }
395 if (num_errors > 20) break;
396 }
397 }
398 else
399 {
400 c = 0;
401 for (i = 0; i < settings->num_points; i++)
402 {
403 unzipper->read(data.point);
404 for (j = 0; j < data.point_size; j++)
405 {
406 if (data.point_data[j] != c)
407 {
408 log("%d %d %d != %d\n", i, j, data.point_data[j], c);
409 num_errors++;
410 if (num_errors > 20) break;
411 }
412 c++;
413 }
414 if (num_errors > 20) break;
415 }
416 }
417
418 if (!unzipper->close())
419 {
420 log("ERROR on unzipper->close(): %s\n", unzipper->get_error());
421 }
422 end_time = taketime();

Callers 1

run_testFunction · 0.85

Calls 5

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

Tested by

no test coverage detected