本文整理汇总了C++中LASreader::read_point方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreader::read_point方法的具体用法?C++ LASreader::read_point怎么用?C++ LASreader::read_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LASreader
的用法示例。
在下文中一共展示了LASreader::read_point方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
//las testing tooo....
LASreadOpener lasreadopener;
LASreader * lasreader;
lasreadopener.set_file_name(las_path);
lasreader = lasreadopener.open();
if(!lasreader){
PyErr_SetString(PyExc_IOError, "Could not open lidar file.");
return NULL;
}
while(lasreader->read_point())
{
//printf("%u of %u\n", pcnt++, npts);
if(lasreader->point.classification != 1)
continue;
double x_coord = (lasreader->point.x * lasreader->point.quantizer->x_scale_factor) + lasreader->point.quantizer->x_offset;
double y_coord = (lasreader->point.y * lasreader->point.quantizer->y_scale_factor) + lasreader->point.quantizer->y_offset;
double z_coord = (lasreader->point.z * lasreader->point.quantizer->z_scale_factor) + lasreader->point.quantizer->z_offset;
printf("(%lf, %lf, %lf)(%lf, %lf, %lf)", x_coord, y_coord, z_coord,
lasreader->point.x, lasreader->point.quantizer->x_scale_factor,lasreader->point.quantizer->x_offset);
}
lasreader->close();
delete lasreader;
/*
int j;
for(j = 0; j < 10000; j++)
{
List *
float_list = initList();
int i;
for(i = 0; i < 100; i++)
{
float fdata = (float) i;
float * data = (float *) malloc(sizeof(float));
*data = fdata;
if(!addFront(float_list, data)){
printf("Error\n");
return 0;
}
}
freeList(float_list);
}
return 1;
*/
}
示例2: main
//.........这里部分代码省略.........
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (i == argc - 2 && !lasreadopener.active() && !laswriteopener.active())
{
lasreadopener.set_file_name(argv[i]);
}
else if (i == argc - 1 && !lasreadopener.active() && !laswriteopener.active())
{
lasreadopener.set_file_name(argv[i]);
}
else if (i == argc - 1 && lasreadopener.active() && !laswriteopener.active())
{
laswriteopener.set_file_name(argv[i]);
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage();
}
}
if (verbose) start_time = taketime();
// check input & output
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
usage(argc == 1);
}
if (!laswriteopener.active())
{
fprintf(stderr,"ERROR: no output specified\n");
usage(argc == 1);
}
// open lasreader
LASreader* lasreader = lasreadopener.open();
if (lasreader == 0)
{
fprintf(stderr, "ERROR: could not open lasreader\n");
byebye(argc==1);
}
// open laswriter
LASwriter* laswriter = laswriteopener.open(&lasreader->header);
if (laswriter == 0)
{
fprintf(stderr, "ERROR: could not open laswriter\n");
byebye(argc==1);
}
#ifdef _WIN32
if (verbose) fprintf(stderr, "reading %I64d points from '%s' and writing them modified to '%s'.\n", lasreader->npoints, lasreadopener.get_file_name(), laswriteopener.get_file_name());
#else
if (verbose) fprintf(stderr, "reading %lld points from '%s' and writing them modified to '%s'.\n", lasreader->npoints, lasreadopener.get_file_name(), laswriteopener.get_file_name());
#endif
// loop over points and modify them
// where there is a point to read
while (lasreader->read_point())
{
// modify the point
lasreader->point.set_point_source_ID(1020);
lasreader->point.set_user_data(42);
if (lasreader->point.get_classification() == 12) lasreader->point.set_classification(1);
lasreader->point.set_Z(lasreader->point.get_Z() + 10);
// write the modified point
laswriter->write_point(&lasreader->point);
// add it to the inventory
laswriter->update_inventory(&lasreader->point);
}
laswriter->update_header(&lasreader->header, TRUE);
I64 total_bytes = laswriter->close();
delete laswriter;
#ifdef _WIN32
if (verbose) fprintf(stderr,"total time: %g sec %I64d bytes for %I64d points\n", taketime()-start_time, total_bytes, lasreader->p_count);
#else
if (verbose) fprintf(stderr,"total time: %g sec %lld bytes for %lld points\n", taketime()-start_time, total_bytes, lasreader->p_count);
#endif
lasreader->close();
delete lasreader;
return 0;
}
示例3: main
//.........这里部分代码省略.........
if (report_y)
{
array_y = new int[array_max];
}
if (report_z)
{
array_z = new int[array_max];
}
double* array_gps = 0;
if (report_gps && lasreader->point.have_gps_time)
{
array_gps = new double[array_max];
}
short* array_r = 0;
short* array_g = 0;
short* array_b = 0;
if (report_rgb && lasreader->point.have_rgb)
{
array_r = new short[array_max];
array_g = new short[array_max];
array_b = new short[array_max];
}
// do the first pass
fprintf(stderr, "loading first %u of %u points\n", array_max, (U32)lasreader->npoints);
// loop over points
unsigned int array_count = 0;
while ((lasreader->read_point()) && (array_count < array_max))
{
if (report_x)
{
array_x[array_count] = lasreader->point.get_X();
}
if (report_y)
{
array_y[array_count] = lasreader->point.get_Y();
}
if (report_z)
{
array_z[array_count] = lasreader->point.get_Z();
}
if (report_gps && lasreader->point.have_gps_time)
{
array_gps[array_count] = lasreader->point.gps_time;
}
if (report_rgb && lasreader->point.have_rgb)
{
array_r[array_count] = lasreader->point.rgb[0];
array_g[array_count] = lasreader->point.rgb[1];
array_b[array_count] = lasreader->point.rgb[2];
}
array_count++;
}
array_max = array_count;
示例4: main
//.........这里部分代码省略.........
while (quadtree.has_intersected_cells())
{
F32 min[2],max[2];
quadtree.get_cell_bounding_box(quadtree.intersected_cell, min, max);
fprintf(stderr," checking tile %d with %g/%g %g/%g\n", quadtree.intersected_cell, min[0], min[1], max[0], max[1]);
}
*/
// possibly loop over multiple input files
if (verbose && lasreadopener.get_file_name_number() > 1)
{
total_start_time = taketime();
}
while (lasreadopener.active())
{
if (verbose) start_time = taketime();
// open lasreader
LASreader* lasreader = lasreadopener.open();
if (lasreader == 0)
{
fprintf(stderr, "ERROR: could not open lasreader\n");
byebye(true, argc==1);
}
// setup the quadtree
LASquadtree* lasquadtree = new LASquadtree;
if (tile_size == 0.0f)
{
F32 t;
if (((lasreader->header.max_x - lasreader->header.min_x) < 1000) && ((lasreader->header.max_y - lasreader->header.min_y) < 1000))
{
t = 10.0f;
}
else if (((lasreader->header.max_x - lasreader->header.min_x) < 10000) && ((lasreader->header.max_y - lasreader->header.min_y) < 10000))
{
t = 100.0f;
}
else if (((lasreader->header.max_x - lasreader->header.min_x) < 100000) && ((lasreader->header.max_y - lasreader->header.min_y) < 100000))
{
t = 1000.0f;
}
else if (((lasreader->header.max_x - lasreader->header.min_x) < 1000000) && ((lasreader->header.max_y - lasreader->header.min_y) < 1000000))
{
t = 10000.0f;
}
else
{
t = 100000.0f;
}
if (verbose) fprintf(stderr,"no tile size specified. setting it to %g ...\n", t);
lasquadtree->setup(lasreader->header.min_x, lasreader->header.max_x, lasreader->header.min_y, lasreader->header.max_y, t);
}
else
{
lasquadtree->setup(lasreader->header.min_x, lasreader->header.max_x, lasreader->header.min_y, lasreader->header.max_y, tile_size);
}
// create index and add points
LASindex lasindex;
lasindex.prepare(lasquadtree, threshold);
while (lasreader->read_point()) lasindex.add(lasreader->point.get_x(), lasreader->point.get_y(), (U32)(lasreader->p_count-1));
// delete the reader
lasreader->close();
delete lasreader;
// adaptive coarsening
lasindex.complete(minimum_points, maximum_intervals);
// write to file
if (append)
{
lasindex.append(lasreadopener.get_file_name());
}
else
{
lasindex.write(lasreadopener.get_file_name());
}
if (verbose) fprintf(stderr,"done with '%s'. took %g sec.\n", lasreadopener.get_file_name(), taketime()-start_time);
}
if (verbose && lasreadopener.get_file_name_number() > 1)
{
fprintf(stderr,"done with %u files. total time %g sec.\n", lasreadopener.get_file_name_number(), taketime()-total_start_time);
}
byebye(false, argc==1);
return 0;
}
示例5: main
//.........这里部分代码省略.........
start_time = taketime();
}
#endif
// prepare the header for the surviving points
strncpy(lasreader->header.system_identifier, "LAStools (c) by rapidlasso GmbH", 32);
lasreader->header.system_identifier[31] = '\0';
char temp[64];
sprintf(temp, "lasmerge (version %d)", LAS_TOOLS_VERSION);
strncpy(lasreader->header.generating_software, temp, 32);
lasreader->header.generating_software[31] = '\0';
if (projection_was_set)
{
lasreader->header.set_geo_keys(number_of_keys, (LASvlr_key_entry*)geo_keys);
free(geo_keys);
if (geo_double_params)
{
lasreader->header.set_geo_double_params(num_geo_double_params, geo_double_params);
free(geo_double_params);
}
else
{
lasreader->header.del_geo_double_params();
}
lasreader->header.del_geo_ascii_params();
}
if (chopchop)
{
I32 file_number = 0;
LASwriter* laswriter = 0;
// loop over the points
while (lasreader->read_point())
{
if (laswriter == 0)
{
// open the next writer
laswriteopener.make_file_name(0, file_number);
file_number++;
laswriter = laswriteopener.open(&lasreader->header);
}
laswriter->write_point(&lasreader->point);
laswriter->update_inventory(&lasreader->point);
if (laswriter->p_count == chopchop)
{
// close the current writer
laswriter->update_header(&lasreader->header, TRUE);
laswriter->close();
if (verbose) {
fprintf(stderr,"splitting file '%s' took %g sec.\n", laswriteopener.get_file_name(), taketime()-start_time);
start_time = taketime();
}
delete laswriter;
laswriter = 0;
}
}
if (laswriter && laswriter->p_count)
{
// close the current writer
laswriter->update_header(&lasreader->header, TRUE);
laswriter->close();
if (verbose) {
fprintf(stderr,"splitting file '%s' took %g sec.\n", laswriteopener.get_file_name(), taketime()-start_time);
start_time = taketime();
}
delete laswriter;
laswriter = 0;
}
}
else
{
// open the writer
LASwriter* laswriter = laswriteopener.open(&lasreader->header);
if (laswriter == 0)
{
fprintf(stderr, "ERROR: could not open laswriter\n");
byebye(true, argc==1);
}
// loop over the points
while (lasreader->read_point())
{
laswriter->write_point(&lasreader->point);
laswriter->update_inventory(&lasreader->point);
}
// close the writer
laswriter->update_header(&lasreader->header, TRUE);
laswriter->close();
if (verbose) fprintf(stderr,"merging files took %g sec.\n", taketime()-start_time);
delete laswriter;
}
lasreader->close();
delete lasreader;
byebye(false, argc==1);
return 0;
}
示例6: main
//.........这里部分代码省略.........
// loop over multiple input files
while (lasreadopener.active())
{
if (verbose) start_time = taketime();
// open lasreader
LASreader* lasreader = lasreadopener.open();
if (lasreader == 0)
{
fprintf(stderr, "ERROR: could not open lasreader\n");
byebye(true, argc==1);
}
// check output
if (!laswriteopener.active())
{
// create name from input name
laswriteopener.make_file_name(lasreadopener.get_file_name(), -2);
}
// if the output was piped we need to precompute the bounding box, etc ...
if (laswriteopener.is_piped())
{
// because the output goes to a pipe we have to precompute the header
// information with an additional pass.
if (verbose) { fprintf(stderr, "piped output. extra read pass over file '%s' ...\n", lasreadopener.get_file_name()); }
while (lasreader->read_point());
lasreader->close();
// output some stats
if (verbose)
{
#ifdef _WIN32
fprintf(stderr, "npoints %I64d min %g %g %g max %g %g %g\n", lasreader->npoints, lasreader->header.min_x, lasreader->header.min_y, lasreader->header.min_z, lasreader->header.max_x, lasreader->header.max_y, lasreader->header.max_z);
#else
fprintf(stderr, "npoints %lld min %g %g %g max %g %g %g\n", lasreader->npoints, lasreader->header.min_x, lasreader->header.min_y, lasreader->header.min_z, lasreader->header.max_x, lasreader->header.max_y, lasreader->header.max_z);
#endif
fprintf(stderr, "return histogram %d %d %d %d %d\n", lasreader->header.number_of_points_by_return[0], lasreader->header.number_of_points_by_return[1], lasreader->header.number_of_points_by_return[2], lasreader->header.number_of_points_by_return[3], lasreader->header.number_of_points_by_return[4]);
fprintf(stderr,"took %g sec.\n", taketime()-start_time); start_time = taketime();
}
// reopen lasreader for the second pass
if (!lasreadopener.reopen(lasreader))
{
fprintf(stderr, "ERROR: could not reopen '%s' for main pass\n", lasreadopener.get_file_name());
byebye(true, argc==1);
}
}
// populate header
for (i = 0; i < 32; i++)
{
lasreader->header.system_identifier[i] = '\0';
lasreader->header.generating_software[i] = '\0';
}
示例7: main
//.........这里部分代码省略.........
case '7':
case '8':
case '9':
if ((parse_string[i] - '0') >= lasreader->header.number_attributes)
{
fprintf(stderr, "WARNING: attribute '%d' does not exist.\n", (parse_string[i] - '0'));
parse_string[i] = 's';
}
else
{
attribute_starts[(parse_string[i] - '0')] = lasreader->header.get_attribute_start((parse_string[i] - '0'));
}
break;
default:
fprintf (stderr, "WARNING: requested unknown parse item '%c'\n", parse_string[i]);
}
i++;
}
// in case diff is requested
int last_XYZ[3] = {0,0,0};
unsigned short last_RGB[4] = {0,0,0};
double last_GPSTIME = 0;
// read and convert the points to ASCII
#ifdef _WIN32
if (verbose) fprintf(stderr,"processing %I64d points with '%s'.\n", lasreader->npoints, parse_string);
#else
if (verbose) fprintf(stderr,"processing %lld points with '%s'.\n", lasreader->npoints, parse_string);
#endif
while (lasreader->read_point())
{
i = 0;
while (true)
{
switch (parse_string[i])
{
case 'x': // the x coordinate
lidardouble2string(printstring, lasreader->point.get_x(), lasreader->header.x_scale_factor); fprintf(file_out, "%s", printstring);
break;
case 'y': // the y coordinate
lidardouble2string(printstring, lasreader->point.get_y(), lasreader->header.y_scale_factor); fprintf(file_out, "%s", printstring);
break;
case 'z': // the z coordinate
lidardouble2string(printstring, lasreader->point.get_z(), lasreader->header.z_scale_factor); fprintf(file_out, "%s", printstring);
break;
case 'X': // the unscaled raw integer X coordinate
fprintf(file_out, "%d", lasreader->point.get_X());
break;
case 'Y': // the unscaled raw integer Y coordinate
fprintf(file_out, "%d", lasreader->point.get_Y());
break;
case 'Z': // the unscaled raw integer Z coordinate
fprintf(file_out, "%d", lasreader->point.get_Z());
break;
case 't': // the gps-time
fprintf(file_out, "%.6f", lasreader->point.get_gps_time());
break;
case 'i': // the intensity
if (opts)
fprintf(file_out, "%d", -2048 + lasreader->point.get_intensity());
else if (optx)
{
示例8: main
//.........这里部分代码省略.........
if (verbose) { fprintf(stderr,"merging headers took %g sec. there are %lld points in total.\n", taketime()-start_time, lasreader->npoints); start_time = taketime(); }
#endif
// prepare the header for the surviving points
strncpy(lasreader->header.system_identifier, "LAStools (c) by rapidlasso GmbH", 32);
lasreader->header.system_identifier[31] = '\0';
char temp[64];
sprintf(temp, "lasmerge (version %d)", LAS_TOOLS_VERSION);
strncpy(lasreader->header.generating_software, temp, 32);
lasreader->header.generating_software[31] = '\0';
if (projection_was_set)
{
lasreader->header.set_geo_keys(number_of_keys, (LASvlr_key_entry*)geo_keys);
free(geo_keys);
if (geo_double_params)
{
lasreader->header.set_geo_double_params(num_geo_double_params, geo_double_params);
free(geo_double_params);
}
else
{
lasreader->header.del_geo_double_params();
}
lasreader->header.del_geo_ascii_params();
}
if (chopchop)
{
I32 file_number = 0;
LASwriter* laswriter = 0;
// loop over the points
while (lasreader->read_point())
{
if (laswriter == 0)
{
// open the next writer
laswriteopener.make_file_name(0, file_number);
file_number++;
laswriter = laswriteopener.open(&lasreader->header);
}
laswriter->write_point(&lasreader->point);
laswriter->update_inventory(&lasreader->point);
if (laswriter->p_count == chopchop)
{
// close the current writer
laswriter->update_header(&lasreader->header, TRUE);
laswriter->close();
if (verbose) { fprintf(stderr,"splitting file '%s' took %g sec.\n", laswriteopener.get_file_name(), taketime()-start_time); start_time = taketime(); }
delete laswriter;
laswriter = 0;
}
}
if (laswriter && laswriter->p_count)
{
// close the current writer
laswriter->update_header(&lasreader->header, TRUE);
laswriter->close();
if (verbose) { fprintf(stderr,"splitting file '%s' took %g sec.\n", laswriteopener.get_file_name(), taketime()-start_time); start_time = taketime(); }
delete laswriter;
laswriter = 0;
}
}
else
{
示例9: main
//.........这里部分代码省略.........
}
// loop over multiple input files
while (lasreadopener.active())
{
if (verbose) start_time = taketime();
// open lasreader
LASreader* lasreader = lasreadopener.open();
if (lasreader == 0)
{
fprintf(stderr, "ERROR: could not open lasreader\n");
usage(true, argc==1);
}
// switch
if (report_file_size)
{
// maybe only report uncompressed file size
I64 uncompressed_file_size = (I64)lasreader->header.number_of_point_records * (I64)lasreader->header.point_data_record_length + lasreader->header.offset_to_point_data;
if (uncompressed_file_size == (I64)((U32)uncompressed_file_size))
fprintf(stderr,"uncompressed file size is %u bytes or %.2f MB for '%s'\n", (U32)uncompressed_file_size, (F64)uncompressed_file_size/1024.0/1024.0, lasreadopener.get_file_name());
else
fprintf(stderr,"uncompressed file size is %.2f MB or %.2f GB for '%s'\n", (F64)uncompressed_file_size/1024.0/1024.0, (F64)uncompressed_file_size/1024.0/1024.0/1024.0, lasreadopener.get_file_name());
}
else if (dry)
{
// maybe only a dry read pass
start_time = taketime();
while (lasreader->read_point());
fprintf(stderr,"needed %g secs to read '%s'\n", taketime()-start_time, lasreadopener.get_file_name());
}
else
{
I64 start_of_waveform_data_packet_record = 0;
// create output file name if no output was specified
if (!laswriteopener.active())
{
if (lasreadopener.get_file_name() == 0)
{
fprintf(stderr,"ERROR: no output specified\n");
usage(true, argc==1);
}
laswriteopener.set_force(TRUE);
laswriteopener.make_file_name(lasreadopener.get_file_name(), -2);
if (!laswriteopener.format_was_specified())
{
char* file_name_out = strdup(laswriteopener.get_file_name());
int len = strlen(file_name_out);
if (lasreader->get_format() == LAS_TOOLS_FORMAT_LAZ)
{
file_name_out[len-3] = 'l';
file_name_out[len-2] = 'a';
file_name_out[len-1] = 's';
}
else
{
file_name_out[len-3] = 'l';
file_name_out[len-2] = 'a';
file_name_out[len-1] = 'z';
}
示例10: main
//.........这里部分代码省略.........
lasreader->header.set_geo_double_params(num_geo_double_params, geo_double_params);
free(geo_double_params);
}
else
{
lasreader->header.del_geo_double_params();
}
lasreader->header.del_geo_ascii_params();
}
}
// do we need an extra pass
BOOL extra_pass = laswriteopener.is_piped();
// for piped output we need an extra pass
if (extra_pass)
{
if (lasreadopener.is_piped())
{
fprintf(stderr, "ERROR: input and output cannot both be piped\n");
usage(true);
}
if (verbose) fprintf(stderr, "extra pass for piped output: reading %lld points ...\n", lasreader->npoints);
// maybe seek to start position
if (subsequence_start) lasreader->seek(subsequence_start);
while (lasreader->read_point())
{
if (lasreader->p_count > subsequence_stop) break;
if (clip_to_bounding_box)
{
if (!lasreader->point.inside_box(lasreader->header.min_x, lasreader->header.min_y, lasreader->header.min_z, lasreader->header.max_x, lasreader->header.max_y, lasreader->header.max_z))
{
continue;
}
}
if (reproject_quantizer)
{
lasreader->point.compute_coordinates();
geoprojectionconverter.to_target(lasreader->point.coordinates);
lasreader->point.compute_XYZ(reproject_quantizer);
}
lasinventory.add(&lasreader->point);
}
lasreader->close();
lasreader->header.number_of_point_records = lasinventory.number_of_point_records;
for (i = 0; i < 5; i++) lasreader->header.number_of_points_by_return[i] = lasinventory.number_of_points_by_return[i+1];
if (reproject_quantizer) lasreader->header = *reproject_quantizer;
lasreader->header.max_x = lasreader->header.get_x(lasinventory.max_X);
lasreader->header.min_x = lasreader->header.get_x(lasinventory.min_X);
lasreader->header.max_y = lasreader->header.get_y(lasinventory.max_Y);
lasreader->header.min_y = lasreader->header.get_y(lasinventory.min_Y);
lasreader->header.max_z = lasreader->header.get_z(lasinventory.max_Z);
lasreader->header.min_z = lasreader->header.get_z(lasinventory.min_Z);
示例11: main
//.........这里部分代码省略.........
}
else
{
lasreader->header.del_geo_double_params();
}
lasreader->header.del_geo_ascii_params();
}
}
// do we need an extra pass
BOOL extra_pass = laswriteopener.is_piped();
// for piped output we need an extra pass
if (extra_pass)
{
if (lasreadopener.is_piped())
{
fprintf(stderr, "ERROR: input and output cannot both be piped\n");
usage(true);
}
#ifdef _WIN32
if (verbose) fprintf(stderr, "extra pass for piped output: reading %I64d points ...\n", lasreader->npoints);
#else
if (verbose) fprintf(stderr, "extra pass for piped output: reading %lld points ...\n", lasreader->npoints);
#endif
// maybe seek to start position
if (subsequence_start) lasreader->seek(subsequence_start);
while (lasreader->read_point())
{
if (lasreader->p_count > subsequence_stop) break;
if (clip_to_bounding_box)
{
if (!lasreader->point.inside_box(lasreader->header.min_x, lasreader->header.min_y, lasreader->header.min_z, lasreader->header.max_x, lasreader->header.max_y, lasreader->header.max_z))
{
continue;
}
}
if (reproject_quantizer)
{
lasreader->point.compute_coordinates();
geoprojectionconverter.to_target(lasreader->point.coordinates);
lasreader->point.compute_xyz(reproject_quantizer);
}
lasinventory.add(&lasreader->point);
}
lasreader->close();
lasreader->header.number_of_point_records = lasinventory.number_of_point_records;
for (i = 0; i < 5; i++) lasreader->header.number_of_points_by_return[i] = lasinventory.number_of_points_by_return[i+1];
if (reproject_quantizer) lasreader->header = *reproject_quantizer;
lasreader->header.max_x = lasreader->header.get_x(lasinventory.raw_max_x);
lasreader->header.min_x = lasreader->header.get_x(lasinventory.raw_min_x);
lasreader->header.max_y = lasreader->header.get_y(lasinventory.raw_max_y);
lasreader->header.min_y = lasreader->header.get_y(lasinventory.raw_min_y);
lasreader->header.max_z = lasreader->header.get_z(lasinventory.raw_max_z);
lasreader->header.min_z = lasreader->header.get_z(lasinventory.raw_min_z);
if (verbose) { fprintf(stderr,"extra pass took %g sec.\n", taketime()-start_time); start_time = taketime(); }
示例12: main
//.........这里部分代码省略.........
}
free(current_xml_output_file);
}
// start a new report
xmlwriter.begin("report");
// report description of file
xmlwriter.beginsub("file");
xmlwriter.write("name", lasreadopener.get_file_name());
xmlwriter.write("path", lasreadopener.get_path());
CHAR temp[32];
sprintf(temp, "%d.%d", lasheader->version_major, lasheader->version_minor);
xmlwriter.write("version", temp);
strncpy(temp, lasheader->system_identifier, 32);
temp[31] = '\0';
xmlwriter.write("system_identifier", temp);
strncpy(temp, lasheader->generating_software, 32);
temp[31] = '\0';
xmlwriter.write("generating_software", temp);
xmlwriter.write("point_data_format", lasheader->point_data_format);
CHAR crsdescription[512];
strcpy(crsdescription, "not valid or not specified");
if (lasheader->fails == 0)
{
// header was loaded. now parse and check.
LAScheck lascheck(lasheader);
while (lasreader->read_point())
{
lascheck.parse(&lasreader->point);
}
// check header and points and get CRS description
lascheck.check(lasheader, crsdescription);
}
xmlwriter.write("CRS", crsdescription);
xmlwriter.endsub("file");
// report the verdict
U32 pass = (lasheader->fails ? VALIDATE_FAIL : VALIDATE_PASS);
if (lasheader->warnings) pass |= VALIDATE_WARNING;
xmlwriter.beginsub("summary");
xmlwriter.write((pass == VALIDATE_PASS ? "pass" : ((pass & VALIDATE_FAIL) ? "fail" : "warning")));
xmlwriter.endsub("summary");
// report details (if necessary)
if (pass != VALIDATE_PASS)
{
xmlwriter.beginsub("details");
for (i = 0; i < lasheader->fail_num; i+=2)
{
xmlwriter.write(lasheader->fails[i], "fail", lasheader->fails[i+1]);
}
for (i = 0; i < lasheader->warning_num; i+=2)
{