当前位置: 首页>>代码示例>>C++>>正文


C++ LASreader::get_format方法代码示例

本文整理汇总了C++中LASreader::get_format方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreader::get_format方法的具体用法?C++ LASreader::get_format怎么用?C++ LASreader::get_format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LASreader的用法示例。


在下文中一共展示了LASreader::get_format方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
    {
      // 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';
          }
          laswriteopener.set_file_name(file_name_out);
          free(file_name_out);
        }
      }

      // maybe set projection

      if (projection_was_set)
      {
        lasreader->header.set_geo_keys(number_of_keys, (LASvlr_key_entry*)geo_keys);
        if (geo_double_params)
        {
          lasreader->header.set_geo_double_params(num_geo_double_params, geo_double_params);
        }
        else
        {
          lasreader->header.del_geo_double_params();
        }
        lasreader->header.del_geo_ascii_params();
      }
开发者ID:bsmaldon,项目名称:lag,代码行数:66,代码来源:laszip.cpp


注:本文中的LASreader::get_format方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。