44 #ifndef LAS_DEFINITIONS_HPP 45 #define LAS_DEFINITIONS_HPP 47 #define LAS_TOOLS_VERSION 111229 57 #define LAS_TOOLS_FORMAT_DEFAULT 0 58 #define LAS_TOOLS_FORMAT_LAS 1 59 #define LAS_TOOLS_FORMAT_LAZ 2 60 #define LAS_TOOLS_FORMAT_BIN 3 61 #define LAS_TOOLS_FORMAT_SHP 4 62 #define LAS_TOOLS_FORMAT_QFIT 5 63 #define LAS_TOOLS_FORMAT_TXT 6 99 inline F64 get_x(
const I32 x)
const {
return x_scale_factor*x+x_offset; };
100 inline F64 get_y(
const I32 y)
const {
return y_scale_factor*y+y_offset; };
101 inline F64 get_z(
const I32 z)
const {
return z_scale_factor*z+z_offset; };
103 inline I32 get_x(
const F64 x)
const {
if (x >= x_offset)
return (
I32)((x-x_offset)/x_scale_factor+0.5);
else return (
I32)((x-x_offset)/x_scale_factor-0.5); };
104 inline I32 get_y(
const F64 y)
const {
if (y >= y_offset)
return (
I32)((y-y_offset)/y_scale_factor+0.5);
else return (
I32)((y-y_offset)/y_scale_factor-0.5); };
105 inline I32 get_z(
const F64 z)
const {
if (z >= z_offset)
return (
I32)((z-z_offset)/z_scale_factor+0.5);
else return (
I32)((z-z_offset)/z_scale_factor-0.5); };
109 x_scale_factor = 0.01;
110 y_scale_factor = 0.01;
111 z_scale_factor = 0.01;
122 this->x_offset = quantizer.
x_offset;
123 this->y_offset = quantizer.
y_offset;
124 this->z_offset = quantizer.
z_offset;
129 #define LAS_ATTRIBUTE_U8 0 130 #define LAS_ATTRIBUTE_I8 1 131 #define LAS_ATTRIBUTE_U16 2 132 #define LAS_ATTRIBUTE_I16 3 133 #define LAS_ATTRIBUTE_U32 4 134 #define LAS_ATTRIBUTE_I32 5 135 #define LAS_ATTRIBUTE_U64 6 136 #define LAS_ATTRIBUTE_I64 7 137 #define LAS_ATTRIBUTE_F32 8 138 #define LAS_ATTRIBUTE_F64 9 153 char description[32];
157 if (size == 0)
throw;
159 scale[0] = scale[1] = scale[2] = 1.0;
160 this->options = size;
166 if (dim < 1 || dim > 3)
throw;
167 if (name == 0)
throw;
169 scale[0] = scale[1] = scale[2] = 1.0;
170 this->data_type = type*dim+1;
171 strncpy(this->name, name, 32);
172 if (description) strncpy(this->description, description, 32);
175 inline BOOL set_no_data(
U8 no_data,
I32 dim=0) {
if ((0 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
176 inline BOOL set_no_data(
I8 no_data,
I32 dim=0) {
if ((1 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
177 inline BOOL set_no_data(
U16 no_data,
I32 dim=0) {
if ((2 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
178 inline BOOL set_no_data(
I16 no_data,
I32 dim=0) {
if ((3 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
179 inline BOOL set_no_data(
U32 no_data,
I32 dim=0) {
if ((4 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
180 inline BOOL set_no_data(
I32 no_data,
I32 dim=0) {
if ((5 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
181 inline BOOL set_no_data(
U64 no_data,
I32 dim=0) {
if ((6 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
182 inline BOOL set_no_data(
I64 no_data,
I32 dim=0) {
if ((7 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
183 inline BOOL set_no_data(
F32 no_data,
I32 dim=0) {
if ((8 == get_type()) && (dim < get_dim())) { this->no_data[dim].f64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
184 inline BOOL set_no_data(
F64 no_data,
I32 dim=0) {
if ((9 == get_type()) && (dim < get_dim())) { this->no_data[dim].f64 = no_data; options |= 0x01;
return TRUE; }
return FALSE; }
186 inline void set_min(
U8* min,
I32 dim=0) { this->min[dim] = cast(min); options |= 0x02; }
187 inline void update_min(
U8* min,
I32 dim=0) { this->min[dim] = smallest(cast(min), this->min[dim]); }
188 inline BOOL set_min(
U8 min,
I32 dim=0) {
if ((0 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
189 inline BOOL set_min(
I8 min,
I32 dim=0) {
if ((1 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
190 inline BOOL set_min(
U16 min,
I32 dim=0) {
if ((2 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
191 inline BOOL set_min(
I16 min,
I32 dim=0) {
if ((3 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
192 inline BOOL set_min(
U32 min,
I32 dim=0) {
if ((4 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
193 inline BOOL set_min(
I32 min,
I32 dim=0) {
if ((5 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
194 inline BOOL set_min(
U64 min,
I32 dim=0) {
if ((6 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
195 inline BOOL set_min(
I64 min,
I32 dim=0) {
if ((7 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
196 inline BOOL set_min(
F32 min,
I32 dim=0) {
if ((8 == get_type()) && (dim < get_dim())) { this->min[dim].f64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
197 inline BOOL set_min(
F64 min,
I32 dim=0) {
if ((9 == get_type()) && (dim < get_dim())) { this->min[dim].f64 = min; options |= 0x02;
return TRUE; }
return FALSE; }
199 inline void set_max(
U8* max,
I32 dim=0) { this->max[dim] = cast(max); options |= 0x04; }
200 inline void update_max(
U8* max,
I32 dim=0) { this->max[dim] = biggest(cast(max), this->max[dim]); }
201 inline BOOL set_max(
U8 max,
I32 dim=0) {
if ((0 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
202 inline BOOL set_max(
I8 max,
I32 dim=0) {
if ((1 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
203 inline BOOL set_max(
U16 max,
I32 dim=0) {
if ((2 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
204 inline BOOL set_max(
I16 max,
I32 dim=0) {
if ((3 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
205 inline BOOL set_max(
U32 max,
I32 dim=0) {
if ((4 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
206 inline BOOL set_max(
I32 max,
I32 dim=0) {
if ((5 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
207 inline BOOL set_max(
U64 max,
I32 dim=0) {
if ((6 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
208 inline BOOL set_max(
I64 max,
I32 dim=0) {
if ((7 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
209 inline BOOL set_max(
F32 max,
I32 dim=0) {
if ((8 == get_type()) && (dim < get_dim())) { this->max[dim].f64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
210 inline BOOL set_max(
F64 max,
I32 dim=0) {
if ((9 == get_type()) && (dim < get_dim())) { this->max[dim].f64 = max; options |= 0x04;
return TRUE; }
return FALSE; }
225 const U32 size_table[10] = { 1, 1, 2, 2, 4, 4, 8, 8, 4, 8 };
226 U32 type = get_type();
228 return size_table[type]*dim;
239 return ((
I32)data_type - 1)%10;
243 return 1 + ((
I32)data_type - 1)/10;
247 I32 type = get_type();
250 casted_value.
u64 = *((
U8*)value);
252 casted_value.
i64 = *((
I8*)value);
254 casted_value.
u64 = *((
U16*)value);
256 casted_value.
i64 = *((
I16*)value);
258 casted_value.
u64 = *((
U32*)value);
260 casted_value.
i64 = *((
I32*)value);
262 casted_value.
u64 = *((
U64*)value);
264 casted_value.
i64 = *((
I64*)value);
266 casted_value.
f64 = *((
F32*)value);
268 casted_value.
f64 = *((
F64*)value);
273 I32 type = get_type();
276 if (a.
f64 < b.
f64)
return a;
281 if (a.
i64 < b.
i64)
return a;
284 if (a.
u64 < b.
u64)
return a;
289 I32 type = get_type();
292 if (a.
f64 > b.
f64)
return a;
297 if (a.
i64 > b.
i64)
return a;
300 if (a.
u64 > b.
u64)
return a;
315 number_extra_attributes = 0;
316 extra_attributes = 0;
317 extra_attribute_array_offsets = 0;
318 extra_attribute_sizes = 0;
323 clean_extra_attributes();
328 if (number_extra_attributes)
330 number_extra_attributes = 0;
331 free(extra_attributes); extra_attributes = 0;
332 free(extra_attribute_array_offsets); extra_attribute_array_offsets = 0;
333 free(extra_attribute_sizes); extra_attribute_sizes = 0;
340 clean_extra_attributes();
341 this->number_extra_attributes = number_extra_attributes;
343 memcpy(this->extra_attributes, extra_attributes,
sizeof(
LASattribute)*number_extra_attributes);
344 extra_attribute_array_offsets = (
I32*)malloc(
sizeof(
I32)*number_extra_attributes);
345 extra_attribute_sizes = (
I32*)malloc(
sizeof(
I32)*number_extra_attributes);
346 extra_attribute_array_offsets[0] = 0;
347 extra_attribute_sizes[0] = extra_attributes[0].
get_size();
348 for (i = 1; i < number_extra_attributes; i++)
350 extra_attribute_array_offsets[i] = extra_attribute_array_offsets[i-1] + extra_attribute_sizes[i-1];
351 extra_attribute_sizes[i] = extra_attributes[i].
get_size();
360 if (extra_attributes)
362 number_extra_attributes++;
364 extra_attribute_array_offsets = (
I32*)realloc(extra_attribute_array_offsets,
sizeof(
I32)*number_extra_attributes);
365 extra_attribute_sizes = (
I32*)realloc(extra_attribute_sizes,
sizeof(
I32)*number_extra_attributes);
366 extra_attributes[number_extra_attributes-1] = extra_attribute;
367 extra_attribute_array_offsets[number_extra_attributes-1] = extra_attribute_array_offsets[number_extra_attributes-2] + extra_attribute_sizes[number_extra_attributes-2];
368 extra_attribute_sizes[number_extra_attributes-1] = extra_attributes[number_extra_attributes-1].
get_size();
372 number_extra_attributes = 1;
374 extra_attribute_array_offsets = (
I32*)malloc(
sizeof(
I32));
375 extra_attribute_sizes = (
I32*)malloc(
sizeof(
I32));
376 extra_attributes[0] = extra_attribute;
377 extra_attribute_array_offsets[0] = 0;
378 extra_attribute_sizes[0] = extra_attributes[0].
get_size();
380 return number_extra_attributes-1;
387 return (extra_attributes ? extra_attribute_array_offsets[number_extra_attributes-1] + extra_attribute_sizes[number_extra_attributes-1] : 0);
393 for (i = 0; i < number_extra_attributes; i++)
395 if (strcmp(extra_attributes[i].name, name) == 0)
406 for (i = 0; i < number_extra_attributes; i++)
408 if (strcmp(extra_attributes[i].name, name) == 0)
410 return extra_attribute_array_offsets[i];
418 if (index < number_extra_attributes)
420 return extra_attribute_array_offsets[index];
427 if (index < 0 || index >= number_extra_attributes)
431 for (index = index + 1; index < number_extra_attributes; index++)
433 extra_attributes[index-1] = extra_attributes[index];
436 extra_attribute_array_offsets[index-1] = extra_attribute_array_offsets[index-2] + extra_attribute_sizes[index-2];
440 extra_attribute_array_offsets[index-1] = 0;
442 extra_attribute_sizes[index-1] = extra_attribute_sizes[index];
444 number_extra_attributes--;
445 if (number_extra_attributes)
448 extra_attribute_array_offsets = (
I32*)realloc(extra_attribute_array_offsets,
sizeof(
I32)*number_extra_attributes);
449 extra_attribute_sizes = (
I32*)realloc(extra_attribute_sizes,
sizeof(
I32)*number_extra_attributes);
453 free(extra_attributes); extra_attributes = 0;
454 free(extra_attribute_array_offsets); extra_attribute_array_offsets = 0;
455 free(extra_attribute_sizes); extra_attribute_sizes = 0;
463 I32 index = get_extra_attribute_index(name);
466 return remove_extra_attribute(index);
556 rgb[0] = other.
rgb[0];
557 rgb[1] = other.
rgb[1];
558 rgb[2] = other.
rgb[2];
566 memcpy(extra_bytes, other.
extra_bytes, extra_bytes_number);
575 for (i = 0; i < num_items; i++)
577 memcpy(&buffer[b], point[i], items[i].size);
586 for (i = 0; i < num_items; i++)
588 memcpy(point[i], &buffer[b], items[i].size);
603 if (!
LASzip().setup(&num_items, &items, point_type, point_size))
605 fprintf(stderr,
"ERROR: unknown point type %d with point size %d\n", (
I32)point_type, (
I32)point_size);
611 point =
new U8*[num_items];
614 for (i = 0; i < num_items; i++)
616 total_point_size += items[i].
size;
617 switch (items[i].type)
620 have_gps_time =
true;
622 this->point[i] = (
U8*)&(this->x);
625 have_gps_time =
true;
626 this->point[i] = (
U8*)&(this->gps_time);
631 this->point[i] = (
U8*)(this->rgb);
634 have_wavepacket =
true;
635 this->point[i] = (
U8*)&(this->wavepacket);
638 extra_bytes_number = items[i].
size;
639 extra_bytes =
new U8[extra_bytes_number];
640 this->point[i] = extra_bytes;
646 this->quantizer = quantizer;
647 this->attributer = attributer;
661 this->num_items = num_items;
662 if (this->items)
delete [] this->items;
663 this->items =
new LASitem[num_items];
664 if (this->point)
delete [] this->point;
665 this->point =
new U8*[num_items];
667 for (i = 0, e = 0; i < num_items; i++)
669 this->items[i] = items[i];
670 total_point_size += items[i].
size;
672 switch (items[i].type)
675 this->point[i] = (
U8*)&(this->x);
678 have_gps_time =
true;
679 this->point[i] = (
U8*)&(this->gps_time);
683 this->point[i] = (
U8*)(this->rgb);
686 have_wavepacket =
true;
687 this->point[i] = (
U8*)&(this->wavepacket);
690 extra_bytes_number = items[i].
size;
691 extra_bytes =
new U8[extra_bytes_number];
692 this->point[i] = extra_bytes;
698 this->quantizer = quantizer;
699 this->attributer = attributer;
707 if (xy < r_min_x || xy > r_max_x)
return FALSE;
709 if (xy < r_min_y || xy > r_max_y)
return FALSE;
717 if (xy < ll_x || xy >= ur_x)
return FALSE;
719 if (xy < ll_y || xy >= ur_y)
return FALSE;
725 F64 dx = center_x - get_x();
726 F64 dy = center_y - get_y();
727 return ((dx*dx+dy*dy) < squared_radius);
732 if (((
U32*)&(this->x))[0] || ((
U32*)&(this->x))[1] || ((
U32*)&(this->x))[2] || ((
U32*)&(this->x))[3] || ((
U32*)&(this->x))[4])
745 if (this->rgb[0] || this->rgb[1] || this->rgb[2])
759 edge_of_flight_line=0;
760 scan_direction_flag=0;
761 number_of_returns_of_given_pulse = 1;
769 extended_classification = 0;
770 extended_return_number = 1;
771 extended_number_of_returns_of_given_pulse = 1;
772 extended_scanner_channel = 0;
775 rgb[0] = rgb[1] = rgb[2] = 0;
785 delete [] extra_bytes;
789 if (point)
delete [] point;
792 have_gps_time =
FALSE;
794 have_wavepacket =
FALSE;
795 extra_bytes_number = 0;
796 total_point_size = 0;
799 if (items)
delete [] items;
821 coordinates[0] = get_x();
822 coordinates[1] = get_y();
823 coordinates[2] = get_z();
828 set_x(coordinates[0]);
829 set_y(coordinates[1]);
830 set_z(coordinates[2]);
835 x = quantizer->
get_x(coordinates[0]);
836 y = quantizer->
get_y(coordinates[1]);
837 z = quantizer->
get_z(coordinates[2]);
955 I8 file_signature[4];
961 U8 project_ID_GUID_data_4[8];
964 I8 system_identifier[32];
965 I8 generating_software[32];
974 U32 number_of_points_by_return[5];
989 U64 extended_number_of_points_by_return[15];
1017 memset((
void*)
this, 0,
sizeof(
LASheader));
1018 file_signature[0] =
'L'; file_signature[1] =
'A'; file_signature[2] =
'S'; file_signature[3] =
'F';
1022 offset_to_point_data = 227;
1023 point_data_record_length = 20;
1024 x_scale_factor = 0.01;
1025 y_scale_factor = 0.01;
1026 z_scale_factor = 0.01;
1031 if (user_data_in_header)
1033 header_size -= user_data_in_header_size;
1034 delete [] user_data_in_header;
1035 user_data_in_header = 0;
1036 user_data_in_header_size = 0;
1045 for (i = 0; i < number_of_variable_length_records; i++)
1048 if (vlrs[i].
data && (vlrs[i].
data != (
char*)extra_attributes))
1050 delete [] vlrs[i].
data;
1056 vlr_geo_key_entries = 0;
1057 vlr_geo_double_params = 0;
1058 vlr_geo_ascii_params = 0;
1059 vlr_classification = 0;
1060 if (vlr_wave_packet_descr)
delete [] vlr_wave_packet_descr;
1061 vlr_wave_packet_descr = 0;
1062 number_of_variable_length_records = 0;
1079 delete vlr_lastiling;
1086 if (user_data_after_header)
1088 offset_to_point_data -= user_data_after_header_size;
1089 delete [] user_data_after_header;
1090 user_data_after_header = 0;
1091 user_data_after_header_size = 0;
1097 clean_user_data_in_header();
1101 clean_user_data_after_header();
1102 clean_extra_attributes();
1111 this->x_offset = quantizer.
x_offset;
1112 this->y_offset = quantizer.
y_offset;
1113 this->z_offset = quantizer.
z_offset;
1119 if (strncmp(file_signature,
"LASF", 4) != 0)
1121 fprintf(stderr,
"ERROR: wrong file signature '%s'\n", file_signature);
1124 if ((version_major != 1) || (version_minor > 4))
1126 fprintf(stderr,
"WARNING: unknown version %d.%d (should be 1.0 or 1.1 or 1.2 or 1.3 or 1.4)\n", version_major, version_minor);
1128 if (header_size < 227)
1130 fprintf(stderr,
"ERROR: header size is %d but should be at least 227\n", header_size);
1133 if (offset_to_point_data < header_size)
1135 fprintf(stderr,
"ERROR: offset to point data %d is smaller than header size %d\n", offset_to_point_data, header_size);
1138 if (x_scale_factor == 0)
1140 fprintf(stderr,
"WARNING: x scale factor is zero.\n");
1142 if (y_scale_factor == 0)
1144 fprintf(stderr,
"WARNING: y scale factor is zero.\n");
1146 if (z_scale_factor == 0)
1148 fprintf(stderr,
"WARNING: z scale factor is zero.\n");
1150 if (max_x < min_x || max_y < min_y || max_z < min_z)
1152 fprintf(stderr,
"WARNING: invalid bounding box [ %g %g %g / %g %g %g ]\n", min_x, min_y, min_z, max_x, max_y, max_z);
1162 for (i = 0; i < number_of_variable_length_records; i++)
1164 if ((strcmp(vlrs[i].user_id, user_id) == 0) && (vlrs[i].record_id == record_id))
1166 if (vlrs[i].record_length_after_header)
1169 delete [] vlrs[i].
data;
1174 if (i == number_of_variable_length_records)
1176 number_of_variable_length_records++;
1177 offset_to_point_data += 54;
1178 vlrs = (
LASvlr*)realloc(vlrs,
sizeof(
LASvlr)*number_of_variable_length_records);
1183 number_of_variable_length_records = 1;
1184 offset_to_point_data += 54;
1185 vlrs = (
LASvlr*)malloc(
sizeof(
LASvlr)*number_of_variable_length_records);
1188 strncpy(vlrs[i].user_id, user_id, 16);
1191 sprintf(vlrs[i].description,
"by LAStools of Martin Isenburg");
1192 if (record_length_after_header)
1194 offset_to_point_data += record_length_after_header;
1207 if (i < number_of_variable_length_records)
1210 if (vlrs[i].record_length_after_header)
1212 delete [] vlrs[i].
data;
1214 number_of_variable_length_records--;
1215 if (number_of_variable_length_records)
1217 vlrs[i] = vlrs[number_of_variable_length_records];
1218 vlrs = (
LASvlr*)realloc(vlrs,
sizeof(
LASvlr)*number_of_variable_length_records);
1234 for (i = 0; i < number_of_variable_length_records; i++)
1236 if ((strcmp(vlrs[i].user_id, user_id) == 0) && (vlrs[i].record_id == record_id))
1238 return remove_vlr(i);
1248 vlr_lastiling->
level = level;
1251 vlr_lastiling->
overlap = overlap;
1253 vlr_lastiling->
min_x = min_x;
1254 vlr_lastiling->
max_x = max_x;
1255 vlr_lastiling->
min_y = min_y;
1256 vlr_lastiling->
max_y = max_y;
1267 memcpy(vlr_geo_key_entries, geo_keys,
sizeof(
LASvlr_key_entry)*number_of_keys);
1268 add_vlr(
"LASF_Projection", 34735,
sizeof(
LASvlr_geo_keys)*(number_of_keys+1), (
char*)vlr_geo_keys);
1273 vlr_geo_double_params =
new F64[num_geo_double_params];
1274 memcpy(vlr_geo_double_params, geo_double_params,
sizeof(
F64)*num_geo_double_params);
1275 add_vlr(
"LASF_Projection", 34736,
sizeof(
F64)*num_geo_double_params, (
char*)vlr_geo_double_params);
1280 if (vlr_geo_double_params)
1282 remove_vlr(
"LASF_Projection", 34736);
1283 vlr_geo_double_params = 0;
1289 if (vlr_geo_ascii_params)
1291 remove_vlr(
"LASF_Projection", 34737);
1292 vlr_geo_ascii_params = 0;
1298 if (number_extra_attributes)
1300 U16 record_length_after_header =
sizeof(
LASattribute)*number_extra_attributes;
1301 char*
data =
new char[record_length_after_header];
1302 memcpy(data, extra_attributes, record_length_after_header);
1303 add_vlr(
"LASF_Spec", 4, record_length_after_header, data);
1307 remove_vlr(
"LASF_Spec", 4);
LASpoint(const LASpoint &other)
LASattribute(U32 type, const char *name, const char *description=0, U32 dim=1)
BOOL set_max(F32 max, I32 dim=0)
void get_extra_attribute(I32 offset, F32 &data) const
LASvlr_wave_packet_descr()
BOOL set_max(I64 max, I32 dim=0)
BOOL set_max(F64 max, I32 dim=0)
void set_extra_attribute(I32 offset, F64 data)
BOOL set_min(I32 min, I32 dim=0)
BOOL set_min(F32 min, I32 dim=0)
void set_extra_attribute(I32 offset, F32 data)
void setOffset(U64 offset)
void get_extra_attribute(I32 offset, I32 &data) const
const kaboom::Options * options
U8 getCompressionType() const
void copy_to(U8 *buffer) const
BOOL set_no_data(I32 no_data, I32 dim=0)
BOOL set_no_data(F32 no_data, I32 dim=0)
void get_extra_attribute(I32 offset, U16 &data) const
BOOL init(const LASquantizer *quantizer, const U32 num_items, const LASitem *items, const LASattributer *attributer=0)
U16 record_length_after_header
BOOL set_min(I8 min, I32 dim=0)
void clean_extra_attributes()
void get_extra_attribute(I32 offset, I8 &data) const
LASpoint & operator=(const LASpoint &other)
void setDigitizerGain(F64 gain)
BOOL set_max(I8 max, I32 dim=0)
F64 getDigitizerOffset() const
BOOL set_no_data(I64 no_data, I32 dim=0)
BOOL inside_rectangle(const F64 r_min_x, const F64 r_min_y, const F64 r_max_x, const F64 r_max_y) const
I16 get_total_extra_attributes_size() const
BOOL set_max(U64 max, I32 dim=0)
void set_min(U8 *min, I32 dim=0)
BOOL set_min(U16 min, I32 dim=0)
BOOL set_no_data(F64 no_data, I32 dim=0)
const LASattributer * attributer
void setDigitizerOffset(F64 offset)
BOOL init(const LASquantizer *quantizer, const U8 point_type, const U16 point_size, const LASattributer *attributer=0)
F64 getDigitizerGain() const
LASquantizer & operator=(const LASquantizer &quantizer)
U64I64F64 cast(U8 *value) const
void update_min(U8 *min, I32 dim=0)
void get_extra_attribute(I32 offset, U8 &data) const
BOOL set_max(U8 max, I32 dim=0)
U8 extended_return_number
BOOL set_min(U32 min, I32 dim=0)
BOOL inside_circle(const F64 center_x, const F64 center_y, F64 squared_radius) const
void set_extra_attribute(I32 index, const U8 *data)
void setLocation(F32 location)
void copy_from(const U8 *buffer)
void setNumberOfSamples(U32 samples)
BOOL set_no_data(U64 no_data, I32 dim=0)
void set_extra_attribute(I32 offset, I16 data)
BOOL set_max(U16 max, I32 dim=0)
BOOL set_max(I32 max, I32 dim=0)
I32 get_x(const F64 x) const
U64I64F64 biggest(U64I64F64 a, U64I64F64 b) const
BOOL set_min(F64 min, I32 dim=0)
void compute_xyz(const LASquantizer *quantizer)
U32 getNumberOfSamples() const
F64 get_y(const I32 y) const
void update_max(U8 *max, I32 dim=0)
U16 key_directory_version
void setCompressionType(U8 compression)
U8 extended_number_of_returns_of_given_pulse
I32 number_extra_attributes
void compute_coordinates()
BOOL set_min(U64 min, I32 dim=0)
BOOL set_scale(F64 scale, I32 dim=0)
I32 * extra_attribute_sizes
void get_extra_attribute(I32 offset, I16 &data) const
BOOL set_min(I16 min, I32 dim=0)
void set_max(U8 *max, I32 dim=0)
BOOL inside_tile(const F32 ll_x, const F32 ll_y, const F32 ur_x, const F32 ur_y) const
void set_extra_attribute(I32 offset, U64 data)
BOOL set_no_data(I16 no_data, I32 dim=0)
F64 get_z(const I32 z) const
BOOL set_max(I16 max, I32 dim=0)
void set_extra_attribute(I32 offset, I8 data)
void setBitsPerSample(U8 bps)
I32 get_y(const F64 y) const
BOOL set_min(I64 min, I32 dim=0)
U8 extended_classification
I32 add_extra_attribute(const LASattribute extra_attribute)
void set_extra_attribute(I32 offset, U32 data)
I32 get_extra_attribute_index(const char *name) const
BOOL remove_extra_attribute(const char *name)
BOOL set_no_data(I8 no_data, I32 dim=0)
BOOL set_no_data(U32 no_data, I32 dim=0)
BOOL set_max(U32 max, I32 dim=0)
BOOL init_extra_attributes(U32 number_extra_attributes, LASattribute *extra_attributes)
void set_extra_attribute(I32 offset, U8 data)
BOOL set_no_data(U16 no_data, I32 dim=0)
I32 get_extra_attribute_array_offset(const char *name) const
void get_extra_attribute(I32 offset, I64 &data) const
BOOL set_min(U8 min, I32 dim=0)
F64 get_x(const I32 x) const
U64I64F64 smallest(U64I64F64 a, U64I64F64 b) const
void get_extra_attribute(I32 offset, U32 &data) const
const LASquantizer * quantizer
I32 get_z(const F64 z) const
void get_extra_attribute(I32 index, U8 *data) const
I32 get_extra_attribute_array_offset(I32 index) const
void set_extra_attribute(I32 offset, U16 data)
void setTemporalSpacing(U32 spacing)
void set_extra_attribute(I32 offset, I32 data)
U32 getTemporalSpacing() const
BOOL set_offset(F64 offset, I32 dim=0)
void set_extra_attribute(I32 offset, I64 data)
U8 getBitsPerSample() const
LASattribute * extra_attributes
void get_extra_attribute(I32 offset, U64 &data) const
#define LAS_ATTRIBUTE_F64
I32 * extra_attribute_array_offsets
BOOL remove_extra_attribute(I32 index)
void get_extra_attribute(I32 offset, F64 &data) const
U8 number_of_returns_of_given_pulse
BOOL set_no_data(U8 no_data, I32 dim=0)
U8 extended_scanner_channel