本文整理汇总了C++中LASreadOpener::parse方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreadOpener::parse方法的具体用法?C++ LASreadOpener::parse怎么用?C++ LASreadOpener::parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LASreadOpener
的用法示例。
在下文中一共展示了LASreadOpener::parse方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
int i;
bool verbose = false;
double start_time = 0.0;
LASreadOpener lasreadopener;
LASwriteOpener laswriteopener;
if (argc == 1)
{
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
}
else
{
lasreadopener.parse(argc, argv);
laswriteopener.parse(argc, argv);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
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
//.........这里部分代码省略.........
示例2: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
#ifdef COMPILE_WITH_MULTI_CORE
I32 cores = 1;
#endif
bool verbose = false;
bool report_diff = true;
bool report_diff_diff = false;
bool report_x = true;
bool report_y = true;
bool report_z = true;
bool report_gps = false;
bool report_rgb = false;
bool output = false;
U32 report_lines = 20;
U32 array_max = 5000000;
bool projection_was_set = false;
double start_time = 0;
double full_start_time = 0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasprecision_gui(argc, argv, 0);
#else
fprintf(stderr,"lasprecision.exe is better run in the command line\n");
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
if (strcmp(argv[i],"-o") == 0 || strcmp(argv[i],"-olas") == 0 || strcmp(argv[i],"-olaz") == 0 || strcmp(argv[i],"-obin") == 0 || strcmp(argv[i],"-otxt") == 0 || strcmp(argv[i],"-reoffset") == 0 || strcmp(argv[i],"-rescale") == 0)
{
output = true;
break;
}
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-cores") == 0)
{
#ifdef COMPILE_WITH_MULTI_CORE
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number\n", argv[i]);
usage(true);
}
argv[i][0] = '\0';
i++;
cores = atoi(argv[i]);
argv[i][0] = '\0';
#else
//.........这里部分代码省略.........
示例3: run
/*
==================================
LoadWorker::run()
Starts the worker.
==================================
*/
void LoadWorker::run()
{
int num_files = filenames.size();
// Has a new quadtree been created?
bool newQuadtree = false;
try
{
// For each file
for (int i = 0; i < num_files; ++i)
{
std::string filename = filenames[i];
send_message(filename);
if (filename != "")
{
filetype_t file_type = test_filename(filename);
if (file_type == UNKNOWN_FILE)
{
send_message(
"Unrecognised file type. Supported formats: las, txt, csv.");
sig_fail();
return;
}
LASreadOpener lasreadopener;
lasreadopener.set_file_name(filename.c_str());
// ASCII files
if (file_type == ASCII_FILE)
{
lasreadopener.set_parse_string(ascii_code.c_str());
if (!use_default_scale_factors)
{
lasreadopener.set_scale_factor(scale_factor);
}
}
// Point filter
if (point_filter.argc != 0)
{
std::vector<char*> argv;
std::transform(point_filter.args.begin(), point_filter.args.end(), std::back_inserter(argv), convert_string);
argv.push_back(0);
if (!lasreadopener.parse(point_filter.argc, &argv[0]))
{
for (size_t i = 0; i < argv.size(); ++i)
delete[] argv[i];
send_message("Error parsing filter parameters.");
sig_fail();
return;
}
for (size_t i = 0; i < argv.size(); ++i)
delete[] argv[i];
}
reader = lasreadopener.open();
if (reader == NULL)
{
send_message("Error opening the file.");
sig_fail();
return;
}
// Check if we have a latlong file
latlong = is_latlong(reader);
// If we have latlong convert to UTM
if (latlong)
convert_projection();
// Get file boundary
Boundary boundary = get_boundary();
fileopener->set_utm_zone(get_utm_zone());
// If refreshing
if ((i == 0
&& (create_new_quadtree
|| !fileopener->get_loadedanyfiles()))
|| fileopener->get_lidardata() == NULL)
{
// Delete old quadtree
fileopener->delete_lidardata();
// Create new quadree
//.........这里部分代码省略.........
示例4: main
int main(int argc, char *argv[])
{
int i,j;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
bool verbose = false;
int shutup = 5;
int random_seeks = 0;
double start_time = 0.0;
LASreadOpener lasreadopener;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasdiff_gui(argc, argv, 0);
#else
char file_name[256];
fprintf(stderr,"lasdiff.exe is better run in the command line\n");
fprintf(stderr,"enter input file1: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter input file2: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
}
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-random_seeks") == 0)
{
random_seeks = 10;
}
else if (strcmp(argv[i],"-shutup") == 0)
{
i++;
shutup = atoi(argv[i]);;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
byebye(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return lasdiff_gui(argc, argv, &lasreadopener);
}
#endif
if (!lasreadopener.active())
{
fprintf (stderr, "ERROR: no input specified\n");
byebye(true, argc==1);
}
//.........这里部分代码省略.........
示例5: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
#ifdef COMPILE_WITH_MULTI_CORE
I32 cores = 1;
#endif
bool verbose = false;
F32 tile_size = 0.0f;
U32 threshold = 1000;
U32 minimum_points = 100000;
I32 maximum_intervals = -20;
BOOL append = FALSE;
F64 start_time = 0.0;
F64 total_start_time = 0.0;
LASreadOpener lasreadopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasindex_gui(argc, argv, 0);
#else
fprintf(stderr,"lasindex.exe is better run in the command line or via the lastool.exe GUI\n");
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
}
if (!lasreadopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-cores") == 0)
{
#ifdef COMPILE_WITH_MULTI_CORE
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number\n", argv[i]);
usage(true);
}
argv[i][0] = '\0';
i++;
cores = atoi(argv[i]);
argv[i][0] = '\0';
#else
fprintf(stderr, "WARNING: not compiled with multi-core batching. ignoring '-cores' ...\n");
i++;
#endif
}
else if (strcmp(argv[i],"-tile_size") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
i++;
tile_size = (F32)atof(argv[i]);
}
else if (strcmp(argv[i],"-maximum") == 0)
{
if ((i+1) >= argc)
{
//.........这里部分代码省略.........
示例6: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
#ifdef COMPILE_WITH_MULTI_CORE
I32 cores = 1;
#endif
bool verbose = false;
bool projection_was_set = false;
bool quiet = false;
int file_creation_day = -1;
int file_creation_year = -1;
int set_version_major = -1;
int set_version_minor = -1;
int set_classification = -1;
char* set_system_identifier = 0;
char* set_generating_software = 0;
bool set_ogc_wkt = false;
double start_time = 0.0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return txt2las_gui(argc, argv, 0);
#else
char file_name[256];
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
// need to get those before lastransform->parse() routine gets them
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
if (strcmp(argv[i],"-scale_intensity") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: factor\n", argv[i]);
usage(true);
}
lasreadopener.set_scale_intensity((F32)atof(argv[i+1]));
*argv[i]='\0'; *argv[i+1]='\0'; i+=1;
}
else if (strcmp(argv[i],"-translate_intensity") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
usage(true);
}
lasreadopener.set_translate_intensity((F32)atof(argv[i+1]));
*argv[i]='\0'; *argv[i+1]='\0'; i+=1;
}
else if (strcmp(argv[i],"-translate_then_scale_intensity") == 0)
{
if ((i+2) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 2 arguments: offset factor\n", argv[i]);
usage(true);
}
lasreadopener.set_translate_intensity((F32)atof(argv[i+1]));
lasreadopener.set_scale_intensity((F32)atof(argv[i+2]));
*argv[i]='\0'; *argv[i+1]='\0'; *argv[i+2]='\0'; i+=2;
}
else if (strcmp(argv[i],"-scale_scan_angle") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: factor\n", argv[i]);
usage(true);
}
lasreadopener.set_scale_scan_angle((F32)atof(argv[i+1]));
*argv[i]='\0'; *argv[i+1]='\0'; i+=1;
}
}
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
//.........这里部分代码省略.........
示例7: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
bool verbose = false;
bool keep_lastiling = false;
U32 chopchop = 0;
bool projection_was_set = false;
double start_time = 0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasmerge_gui(argc, argv, 0);
#else
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
char file_name[256];
fprintf(stderr,"enter input file 1: ");
fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter input file 2: ");
fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter output file: ");
fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-split") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
i++;
chopchop = atoi(argv[i]);
}
else if (strcmp(argv[i],"-keep_lastiling") == 0)
{
keep_lastiling = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
byebye(true);
}
//.........这里部分代码省略.........
示例8: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
#ifdef COMPILE_WITH_MULTI_CORE
I32 cores = 1;
#endif
bool diff = false;
bool verbose = false;
CHAR separator_sign = ' ';
CHAR* separator = "space";
bool opts = false;
bool optx = false;
CHAR header_comment_sign = '\0';
CHAR* parse_string = 0;
CHAR* extra_string = 0;
CHAR printstring[512];
double start_time = 0.0;
LASreadOpener lasreadopener;
LASwriteOpener laswriteopener;
laswriteopener.set_format("txt");
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return las2txt_gui(argc, argv, 0);
#else
fprintf(stderr,"las2txt.exe is better run in the command line or via the lastool.exe GUI\n");
CHAR file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
if (strcmp(argv[i],"-opts") == 0)
{
opts = TRUE;
*argv[i]='\0';
}
else if (strcmp(argv[i],"-optx") == 0)
{
optx = TRUE;
*argv[i]='\0';
}
}
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-cores") == 0)
{
#ifdef COMPILE_WITH_MULTI_CORE
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number\n", argv[i]);
usage(true);
}
argv[i][0] = '\0';
i++;
cores = atoi(argv[i]);
//.........这里部分代码省略.........
示例9: main
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
bool verbose = false;
bool keep_lastiling = false;
U32 chopchop = 0;
bool projection_was_set = false;
double start_time = 0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasmerge_gui(argc, argv, 0);
#else
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
char file_name[256];
fprintf(stderr,"enter input file 1: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter input file 2: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '�') argv[i][0] = '-';
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (lasreadopener.get_file_name_number()<2)
{
fprintf(stderr,"Must specify more than one input file.\n");
byebye(true); // only support merging more than one file
}
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-split") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
i++;
chopchop = atoi(argv[i]);
}
else if (strcmp(argv[i],"-keep_lastiling") == 0)
{
keep_lastiling = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
//.........这里部分代码省略.........
示例10: main
int main(int argc, char *argv[])
{
int i;
bool dry = false;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
#ifdef COMPILE_WITH_MULTI_CORE
I32 cores = 1;
#endif
bool verbose = false;
bool waveform = false;
bool waveform_with_map = false;
bool report_file_size = false;
I32 end_of_points = -1;
bool projection_was_set = false;
bool lax = false;
U32 tile_size = 100;
U32 threshold = 1000;
U32 minimum_points = 100000;
I32 maximum_intervals = -20;
double start_time = 0.0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return laszip_gui(argc, argv, 0);
#else
fprintf(stderr,"laszip.exe is better run in the command line or via the lastool.exe GUI\n");
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-cores") == 0)
{
#ifdef COMPILE_WITH_MULTI_CORE
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number\n", argv[i]);
usage(true);
}
argv[i][0] = '\0';
i++;
cores = atoi(argv[i]);
argv[i][0] = '\0';
#else
fprintf(stderr, "WARNING: not compiled with multi-core batching. ignoring '-cores' ...\n");
#endif
}
else if (strcmp(argv[i],"-dry") == 0)
{
dry = true;
//.........这里部分代码省略.........
示例11: main
int main(int argc, char *argv[])
{
int i;
int is_mpi = 1;
int debug = 0;
bool verbose = false;
bool force = false;
// fixed header changes
int set_version_major = -1;
int set_version_minor = -1;
int set_point_data_format = -1;
int set_point_data_record_length = -1;
int set_gps_time_endcoding = -1;
// variable header changes
bool remove_extra_header = false;
bool remove_all_variable_length_records = false;
int remove_variable_length_record = -1;
int remove_variable_length_record_from = -1;
int remove_variable_length_record_to = -1;
bool remove_tiling_vlr = false;
bool remove_original_vlr = false;
// extract a subsequence
//unsigned int subsequence_start = 0;
//unsigned int subsequence_stop = U32_MAX;
I64 subsequence_start = 0;
I64 subsequence_stop = I64_MAX;
// fix files with corrupt points
bool clip_to_bounding_box = false;
double start_time = 0;
time_t wall_start_time;
time_t wall_end_time;
LASreadOpener lasreadopener;
//if(is_mpi)lasreadopener.setIsMpi(TRUE);
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if(is_mpi)laswriteopener.setIsMpi(TRUE);
int process_count = 1;
int rank = 0;
start_time = taketime();
time(&wall_start_time);
if (is_mpi){
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&process_count);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
if(debug) printf ("MPI task %d has started...\n", rank);
}
if (argc == 1)
{
fprintf(stderr,"las2las.exe is better run in the command line or via the lastool.exe GUI\n");
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
}
else
{
for (i = 1; i < argc; i++)
{
//if (argv[i][0] == '�') argv[i][0] = '-';
if (strcmp(argv[i],"-week_to_adjusted") == 0)
{
set_gps_time_endcoding = 1;
}
else if (strcmp(argv[i],"-adjusted_to_week") == 0)
{
set_gps_time_endcoding = 0;
}
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
//.........这里部分代码省略.........
示例12: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
#ifdef COMPILE_WITH_MULTI_CORE
I32 cores = 1;
#endif
bool verbose = false;
bool force = false;
// fixed header changes
int set_version_major = -1;
int set_version_minor = -1;
int set_point_data_format = -1;
int set_point_data_record_length = -1;
int set_gps_time_endcoding = -1;
// variable header changes
bool remove_extra_header = false;
bool remove_all_variable_length_records = false;
int remove_variable_length_record = -1;
bool remove_tiling_vlr = false;
bool remove_original_vlr = false;
// extract a subsequence
unsigned int subsequence_start = 0;
unsigned int subsequence_stop = U32_MAX;
// fix files with corrupt points
bool clip_to_bounding_box = false;
double start_time = 0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return las2las_gui(argc, argv, 0);
#else
fprintf(stderr,"las2las.exe is better run in the command line or via the lastool.exe GUI\n");
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
if (strcmp(argv[i],"-week_to_adjusted") == 0)
{
set_gps_time_endcoding = 1;
}
else if (strcmp(argv[i],"-adjusted_to_week") == 0)
{
set_gps_time_endcoding = 0;
}
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-cores") == 0)
{
#ifdef COMPILE_WITH_MULTI_CORE
if ((i+1) >= argc)
//.........这里部分代码省略.........