44 fprintf(stderr,
"ERROR: file name pointer is NULL\n");
48 FILE*
file = fopen(file_name,
"r");
51 fprintf(stderr,
"ERROR: file '%s' cannot be opened\n", file_name);
56 if (strstr(file_name,
".las") || strstr(file_name,
".laz") || strstr(file_name,
".LAS") || strstr(file_name,
".LAZ"))
60 fprintf(stderr,
"ERROR: cannot mix BIN with LAS. skipping '%s' ...\n", file_name);
65 fprintf(stderr,
"ERROR: cannot mix SHP with LAS. skipping '%s' ...\n", file_name);
70 fprintf(stderr,
"ERROR: cannot mix QFIT with LAS. skipping '%s' ...\n", file_name);
75 fprintf(stderr,
"ERROR: cannot mix TXT with LAS. skipping '%s' ...\n", file_name);
83 else if (strstr(file_name,
".bin") || strstr(file_name,
".BIN"))
87 fprintf(stderr,
"ERROR: cannot mix LAS with BIN. skipping '%s' ...\n", file_name);
92 fprintf(stderr,
"ERROR: cannot mix SHP with BIN. skipping '%s' ...\n", file_name);
97 fprintf(stderr,
"ERROR: cannot mix QFIT with BIN. skipping '%s' ...\n", file_name);
102 fprintf(stderr,
"ERROR: cannot mix TXT with BIN. skipping '%s' ...\n", file_name);
110 else if (strstr(file_name,
".shp") || strstr(file_name,
".SHP"))
114 fprintf(stderr,
"ERROR: cannot mix LAS with SHP. skipping '%s' ...\n", file_name);
119 fprintf(stderr,
"ERROR: cannot mix BIN with SHP. skipping '%s' ...\n", file_name);
124 fprintf(stderr,
"ERROR: cannot mix QFIT with SHP. skipping '%s' ...\n", file_name);
129 fprintf(stderr,
"ERROR: cannot mix TXT with SHP. skipping '%s' ...\n", file_name);
137 else if (strstr(file_name,
".qi") || strstr(file_name,
".QI"))
141 fprintf(stderr,
"ERROR: cannot mix LAS with QFIT. skipping '%s' ...\n", file_name);
146 fprintf(stderr,
"ERROR: cannot mix BIN with QFIT. skipping '%s' ...\n", file_name);
151 fprintf(stderr,
"ERROR: cannot mix SHP with QFIT. skipping '%s' ...\n", file_name);
156 fprintf(stderr,
"ERROR: cannot mix TXT with QFIT. skipping '%s' ...\n", file_name);
168 fprintf(stderr,
"ERROR: cannot mix LAS with TXT. skipping '%s' ...\n", file_name);
173 fprintf(stderr,
"ERROR: cannot mix BIN with TXT. skipping '%s' ...\n", file_name);
178 fprintf(stderr,
"ERROR: cannot mix SHP with TXT. skipping '%s' ...\n", file_name);
183 fprintf(stderr,
"ERROR: cannot mix QFIT with TXT. skipping '%s' ...\n", file_name);
205 fprintf(stderr,
"ERROR: alloc for file_names pointer array failed at %d\n",
file_name_allocated);
218 if (this->scale_factor == 0) this->scale_factor =
new F64[3];
219 this->scale_factor[0] = scale_factor[0];
220 this->scale_factor[1] = scale_factor[1];
221 this->scale_factor[2] = scale_factor[2];
223 else if (this->scale_factor)
226 this->scale_factor = 0;
234 if (this->offset == 0) this->offset =
new F64[3];
235 this->offset[0] = offset[0];
236 this->offset[1] = offset[1];
237 this->offset[2] = offset[2];
239 else if (this->offset)
268 if (this->parse_string) free(this->parse_string);
271 this->parse_string = strdup(parse_string);
275 this->parse_string = 0;
293 fprintf(stderr,
"ERROR: no valid file names\n");
314 fprintf(stderr,
"ERROR: could not open lasreaderlas for file '%s'\n",
file_names[i]);
322 fprintf(stderr,
"ERROR: could not open lasreaderbin for file '%s'\n",
file_names[i]);
330 fprintf(stderr,
"ERROR: could not open lasreadershp for file '%s'\n",
file_names[i]);
338 fprintf(stderr,
"ERROR: could not open lasreaderqfit for file '%s'\n",
file_names[i]);
352 fprintf(stderr,
"ERROR: could not open lasreadertxt for file '%s'\n",
file_names[i]);
490 x_scale_factor *= 10;
494 fprintf(stderr,
"WARNING: i changed x_scale_factor from %g to %g to accommodate enlarged bounding box\n",
header.
x_scale_factor, x_scale_factor);
501 fprintf(stderr,
"WARNING: i changed x_offset from %g to %g to accommodate enlarged bounding box\n",
header.
x_offset, x_offset);
516 y_scale_factor *= 10;
520 fprintf(stderr,
"WARNING: i changed y_scale_factor from %g to %g to accommodate enlarged bounding box\n",
header.
y_scale_factor, y_scale_factor);
527 fprintf(stderr,
"WARNING: i changed y_offset from %g to %g to accommodate enlarged bounding box\n",
header.
y_offset, y_offset);
542 z_scale_factor *= 10;
546 fprintf(stderr,
"WARNING: i changed z_scale_factor from %g to %g to accommodate enlarged bounding box\n",
header.
z_scale_factor, z_scale_factor);
553 fprintf(stderr,
"WARNING: i changed z_offset from %g to %g to accommodate enlarged bounding box\n",
header.
z_offset, z_offset);
870 fprintf(stderr,
"ERROR: could not open lasreaderlas for file '%s'\n",
file_names[file_name_current]);
883 fprintf(stderr,
"ERROR: could not open lasreaderbin for file '%s'\n",
file_names[file_name_current]);
896 fprintf(stderr,
"ERROR: could not open lasreadershp for file '%s'\n",
file_names[file_name_current]);
904 fprintf(stderr,
"ERROR: could not open lasreaderqfit for file '%s'\n",
file_names[file_name_current]);
917 fprintf(stderr,
"ERROR: could not open lasreadertxt for file '%s'\n",
file_names[file_name_current]);
BOOL open(const char *file_name)
BOOL read(const char *file_name)
BOOL inside_tile(const F32 ll_x, const F32 ll_y, const F32 size)
virtual BOOL inside_circle(const F64 center_x, const F64 center_y, const F64 radius)
virtual void close(BOOL close_stream=TRUE)=0
LASreaderLAS * lasreaderlas
void set_scale_scan_angle(F32 scale_scan_angle)
void set_parse_string(const char *parse_string)
void set_populate_header(BOOL populate_header)
void set_translate_intensity(F32 translate_intensity)
void set_filter(LASfilter *filter)
void set_offset(const F64 *offset)
virtual BOOL inside_tile(const F32 ll_x, const F32 ll_y, const F32 size)
void set_scale_intensity(F32 scale_intensity)
BOOL init(const LASquantizer *quantizer, const U8 point_type, const U16 point_size, const LASattributer *attributer=0)
LASreaderSHP * lasreadershp
void set_scale_scan_angle(F32 scale_scan_angle)
void close(BOOL close_stream=TRUE)
void set_translate_scan_angle(F32 translate_scan_angle)
BOOL inside_circle(const F64 center_x, const F64 center_y, const F64 radius)
void set_translate_intensity(F32 translate_intensity)
void set_translate_scan_angle(F32 translate_scan_angle)
virtual BOOL inside_rectangle(const F64 min_x, const F64 min_y, const F64 max_x, const F64 max_y)
I32 number_extra_attributes
void set_scale_factor(const F64 *scale_factor)
BOOL read_point_default()
virtual I32 get_format() const =0
void set_offset(const F64 *offset)
virtual BOOL open(const char *file_name)
LASreaderTXT * lasreadertxt
void set_transform(LAStransform *transform)
virtual void set_filter(LASfilter *filter)
BOOL inside_rectangle(const F64 min_x, const F64 min_y, const F64 max_x, const F64 max_y)
BOOL read_point_alternate()
void set_index(LASindex *index)
BOOL open(const char *file_name, U32 io_buffer_size=65536)
BOOL add_file_name(const char *file_name)
void set_scale_intensity(F32 scale_intensity)
void set_scale_factor(const F64 *scale_factor)
BOOL init_extra_attributes(U32 number_extra_attributes, LASattribute *extra_attributes)
BOOL open(const char *file_name)
LASreaderQFIT * lasreaderqfit
virtual void set_transform(LAStransform *transform)
virtual BOOL open(const char *file_name, const char *parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE)
LASattribute * extra_attributes
void set_skip_lines(I32 skip_lines)
LASreaderBIN * lasreaderbin