lasreader_shp.cpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: lasreader_shp.cpp
5 
6  CONTENTS:
7 
8  see corresponding header file
9 
10  PROGRAMMERS:
11 
12  martin.isenburg@gmail.com
13 
14  COPYRIGHT:
15 
16  (c) 2007-2011, Martin Isenburg, LASSO - tools to catch reality
17 
18  This is free software; you can redistribute and/or modify it under the
19  terms of the GNU Lesser General Licence as published by the Free Software
20  Foundation. See the COPYING file for more information.
21 
22  This software is distributed WITHOUT ANY WARRANTY and without even the
23  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 
25  CHANGE HISTORY:
26 
27  see corresponding header file
28 
29 ===============================================================================
30 */
31 #include "lasreader_shp.hpp"
32 
33 #include <stdlib.h>
34 #include <string.h>
35 
36 #ifdef _WIN32
37 #include <windows.h>
38 #endif
39 
40 extern "C" FILE* fopen_compressed(const char* filename, const char* mode, bool* piped);
41 
42 static bool is_little_endian = true;
43 
44 static void initialize_endianness()
45 {
46  int i = 1;
47  if (*((unsigned char*)&i) == 1)
48  is_little_endian = true;
49  else
50  is_little_endian = false;
51 }
52 
53 static void from_big_endian(int* value)
54 {
55  if (is_little_endian)
56  {
57  char help;
58  char* field = (char*)value;
59  help = field[0];
60  field[0] = field[3];
61  field[3] = help;
62  help = field[1];
63  field[1] = field[2];
64  field[2] = help;
65  }
66 }
67 
68 static void from_little_endian(int* value)
69 {
70  if (!is_little_endian)
71  {
72  char help;
73  char* field = (char*)value;
74  help = field[0];
75  field[0] = field[3];
76  field[3] = help;
77  help = field[1];
78  field[1] = field[2];
79  field[2] = help;
80  }
81 }
82 
83 static void from_little_endian(double* value)
84 {
85  if (!is_little_endian)
86  {
87  char help;
88  char* field = (char*)value;
89  help = field[0];
90  field[0] = field[7];
91  field[7] = help;
92  help = field[1];
93  field[1] = field[6];
94  field[6] = help;
95  help = field[2];
96  field[2] = field[5];
97  field[5] = help;
98  help = field[3];
99  field[3] = field[4];
100  field[4] = help;
101  }
102 }
103 
104 BOOL LASreaderSHP::open(const char* file_name)
105 {
106  int i;
107 
108  if (file_name == 0)
109  {
110  fprintf(stderr,"ERROR: fine name pointer is zero\n");
111  return FALSE;
112  }
113 
114  clean();
115  header.clean();
116 
117  file = fopen_compressed(file_name, "rb", &piped);
118  if (file == 0)
119  {
120  fprintf(stderr, "ERROR: cannot open file '%s'\n", file_name);
121  return FALSE;
122  }
123 
124  // populate the header as much as it makes sense
125 
126  for (i = 0; i < 32; i++)
127  {
128  header.system_identifier[i] = '\0';
129  header.generating_software[i] = '\0';
130  }
131  sprintf(header.system_identifier, "LAStools (c) by Martin Isenburg");
132  sprintf(header.generating_software, "via LASreaderSHP (%d)", LAS_TOOLS_VERSION);
133 
134  // maybe set creation date
135 
136 #ifdef _WIN32
137  WIN32_FILE_ATTRIBUTE_DATA attr;
138  SYSTEMTIME creation;
139  GetFileAttributesEx(file_name, GetFileExInfoStandard, &attr);
140  FileTimeToSystemTime(&attr.ftCreationTime, &creation);
141  int startday[13] = {-1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
142  header.file_creation_day = startday[creation.wMonth] + creation.wDay;
143  header.file_creation_year = creation.wYear;
144  // leap year handling
145  if ((((creation.wYear)%4) == 0) && (creation.wMonth > 2)) header.file_creation_day++;
146 #else
148  header.file_creation_year = 2011;
149 #endif
150 
153 
154  // initialize point
155 
157 
158  // read SHP header and populate the LAS header with the bounding box
159 
160  int int_input;
161  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // file code (BIG)
162  from_big_endian(&int_input);
163  if (int_input != 9994)
164  {
165  fprintf(stderr, "ERROR: wrong shapefile code %d != 9994\n", int_input);
166  return FALSE;
167  }
168  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // unused (BIG)
169  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // unused (BIG)
170  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // unused (BIG)
171  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // unused (BIG)
172  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // unused (BIG)
173  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // file length (BIG)
174  from_big_endian(&int_input);
175  int file_length = int_input;
176  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // version (LITTLE)
177  from_little_endian(&int_input);
178  if (int_input != 1000)
179  {
180  fprintf(stderr, "ERROR: wrong shapefile version %d != 1000\n", int_input);
181  return FALSE;
182  }
183  if (fread(&int_input, sizeof(int), 1, file) != 1) return false; // shape type (LITTLE)
184  from_little_endian(&int_input);
185  shape_type = int_input;
186  if (shape_type != 1 && shape_type != 11 && shape_type != 21 && shape_type != 8 && shape_type != 18 && shape_type != 28)
187  {
188  fprintf(stderr, "ERROR: wrong shape type %d != 1,11,21,8,18,28\n", shape_type);
189  return FALSE;
190  }
191  double double_input;
192  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // xmin (LITTLE)
193  from_little_endian(&double_input);
194  header.min_x = double_input;
195  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // ymin (LITTLE)
196  from_little_endian(&double_input);
197  header.min_y = double_input;
198  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // xmax (LITTLE)
199  from_little_endian(&double_input);
200  header.max_x = double_input;
201  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // ymax (LITTLE)
202  from_little_endian(&double_input);
203  header.max_y = double_input;
204  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // zmin (LITTLE)
205  from_little_endian(&double_input);
206  header.min_z = double_input;
207  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // zmax (LITTLE)
208  from_little_endian(&double_input);
209  header.max_z = double_input;
210  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // mmin (LITTLE)
211  from_little_endian(&double_input);
212  if (fread(&double_input, sizeof(double), 1, file) != 1) return false; // mmax (LITTLE)
213  from_little_endian(&double_input);
214 
215  // maybe calculate npoints
216 
217  if (shape_type == 1)
218  {
219  npoints = (file_length-50)/(14);
220  }
221  else if (shape_type == 11)
222  {
223  npoints = (file_length-50)/(22);
224  }
225  else if (shape_type == 21)
226  {
227  npoints = (file_length-50)/(18);
228  }
229  else if (shape_type == 8)
230  {
231  npoints = (file_length-50-20)/(8); // over-estimate (assumes all in one record)
232  }
233  else if (shape_type == 18)
234  {
235  npoints = (file_length-50-36)/(16); // over-estimate (assumes all in one record)
236  }
237  else if (shape_type == 28)
238  {
239  npoints = (file_length-50-28)/(12); // over-estimate (assumes all in one record)
240  }
243 
244  // figure out the right scale factor and offset
245 
247 
248  // populate the quantized bounding box
249 
251 
252  p_count = 0;
253 
254  return TRUE;
255 }
256 
257 void LASreaderSHP::set_scale_factor(const F64* scale_factor)
258 {
259  if (scale_factor)
260  {
261  if (this->scale_factor == 0) this->scale_factor = new F64[3];
262  this->scale_factor[0] = scale_factor[0];
263  this->scale_factor[1] = scale_factor[1];
264  this->scale_factor[2] = scale_factor[2];
265  }
266  else if (this->scale_factor)
267  {
268  delete [] this->scale_factor;
269  this->scale_factor = 0;
270  }
271 }
272 
273 void LASreaderSHP::set_offset(const F64* offset)
274 {
275  if (offset)
276  {
277  if (this->offset == 0) this->offset = new F64[3];
278  this->offset[0] = offset[0];
279  this->offset[1] = offset[1];
280  this->offset[2] = offset[2];
281  }
282  else if (this->offset)
283  {
284  delete [] this->offset;
285  this->offset = 0;
286  }
287 }
288 
290 {
291  return FALSE;
292 }
293 
295 {
297  {
298  int i, int_input;
299  if (fread(&int_input, sizeof(int), 1, file) != 1) { npoints = p_count; return FALSE; }; // record number (BIG)
300  if (fread(&int_input, sizeof(int), 1, file) != 1) { npoints = p_count; return FALSE; }; // content length (BIG)
301  if (fread(&int_input, sizeof(int), 1, file) != 1) { npoints = p_count; return FALSE; }; // shape type (LITTLE)
302  from_little_endian(&int_input);
303  if (int_input != shape_type)
304  {
305  fprintf(stderr, "WARNING: wrong shape type %d != %d in record\n", int_input, shape_type);
306  }
307  double double_input;
308  if (shape_type == 8 || shape_type == 18 || shape_type == 28) // Multipoint
309  {
310  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // xmin (LITTLE)
311  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // ymin (LITTLE)
312  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // xmax (LITTLE)
313  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // ymax (LITTLE)
314  if (fread(&int_input, sizeof(int), 1, file) != 1) { npoints = p_count; return FALSE; }; // number of points (LITTLE)
315  from_little_endian(&int_input);
316  number_of_points = int_input;
317  }
318  else // or regular point?
319  {
320  number_of_points = 1;
321  }
322  if (shape_type == 11 || shape_type == 18)
323  {
325  {
326  if (points) delete [] points;
327  points = new I32[number_of_points*3];
329  }
330  // read points x and y
331  for (i = 0; i < number_of_points; i++)
332  {
333  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // x of point (LITTLE)
334  from_little_endian(&double_input);
335  points[3*i+0] = header.get_x(double_input);
336  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // y of point (LITTLE)
337  from_little_endian(&double_input);
338  points[3*i+1] = header.get_y(double_input);
339  }
340  // read points z and write LAS points
341  if (shape_type == 18) // Multipoint
342  {
343  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // zmin (LITTLE)
344  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // zmin (LITTLE)
345  }
346  for (i = 0; i < number_of_points; i++)
347  {
348  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // z of point (LITTLE)
349  from_little_endian(&double_input);
350  points[3*i+2] = header.get_z(double_input);
351  }
352  }
353  else
354  {
356  {
357  if (points) delete [] points;
358  points = new I32[number_of_points*2];
360  }
361  // read points x and y and write LAS points
362  for (i = 0; i < number_of_points; i++)
363  {
364  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // x of point (LITTLE)
365  from_little_endian(&double_input);
366  points[2*i+0] = header.get_x(double_input);
367  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // y of point (LITTLE)
368  from_little_endian(&double_input);
369  points[2*i+1] = header.get_y(double_input);
370  }
371  }
372  // read points m
373  if (shape_type == 11 || shape_type == 21 || shape_type == 18 || shape_type == 28)
374  {
375  if (shape_type == 18 || shape_type == 28) // Multipoint
376  {
377  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // mmin (LITTLE)
378  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // mmin (LITTLE)
379  }
380  for (i = 0; i < number_of_points; i++)
381  {
382  if (fread(&double_input, sizeof(double), 1, file) != 1) { npoints = p_count; return FALSE; }; // m of point (LITTLE)
383  }
384  }
385  point_count = 0;
386  }
387  if (shape_type == 11 || shape_type == 18)
388  {
389  point.x = points[3*point_count+0];
390  point.y = points[3*point_count+1];
391  point.z = points[3*point_count+2];
392  }
393  else
394  {
395  point.x = points[2*point_count+0];
396  point.y = points[2*point_count+1];
397  point.z = 0;
398  }
399  p_count++;
400  point_count++;
401  return TRUE;
402 }
403 
405 {
406  return 0;
407 }
408 
409 void LASreaderSHP::close(BOOL close_stream)
410 {
411  if (file)
412  {
413  if (piped) while(fgetc(file) != EOF);
414  fclose(file);
415  file = 0;
416  }
417 }
418 
419 BOOL LASreaderSHP::reopen(const char* file_name)
420 {
421  if (file_name == 0)
422  {
423  fprintf(stderr,"ERROR: fine name pointer is zero\n");
424  return FALSE;
425  }
426 
427  file = fopen_compressed(file_name, "rb", &piped);
428  if (file == 0)
429  {
430  fprintf(stderr, "ERROR: cannot reopen file '%s'\n", file_name);
431  return FALSE;
432  }
433 
434  // read SHP header again to skip to the right point in the file
435 
436  int int_input;
437  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // file code (BIG)
438  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // unused (BIG)
439  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // unused (BIG)
440  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // unused (BIG)
441  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // unused (BIG)
442  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // unused (BIG)
443  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // file length (BIG)
444  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // version (LITTLE)
445  if (fread(&int_input, sizeof(int), 1, file) != 1) return FALSE; // shape type (LITTLE)
446  double double_input;
447  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // xmin (LITTLE)
448  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // ymin (LITTLE)
449  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // xmax (LITTLE)
450  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // ymax (LITTLE)
451  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // zmin (LITTLE)
452  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // zmax (LITTLE)
453  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // mmin (LITTLE)
454  if (fread(&double_input, sizeof(double), 1, file) != 1) return FALSE; // mmax (LITTLE)
455 
456  p_count = 0;
457 
458  return TRUE;
459 }
460 
462 {
463  if (file)
464  {
465  if (piped) while(fgetc(file) != EOF);
466  fclose(file);
467  file = 0;
468  }
469  number_of_points = 0;
470  point_count = 0;
471 }
472 
474 {
476 
477  file = 0;
478  piped = false;
479  scale_factor = 0;
480  offset = 0;
481  shape_type = 0;
482  points = 0;
483  points_allocated = 0;
484  number_of_points = 0;
485  point_count = 0;
486 }
487 
489 {
490  clean();
491  if (scale_factor)
492  {
493  delete [] scale_factor;
494  scale_factor = 0;
495  }
496  if (offset)
497  {
498  delete [] offset;
499  offset = 0;
500  }
501  if (points)
502  {
503  delete [] points;
504  points = 0;
505  }
506 }
507 
509 {
510  // if not specified in the command line, set a reasonable scale_factor
511  if (scale_factor)
512  {
516  }
517  else
518  {
519  if (-360 < header.min_x && -360 < header.min_y && header.max_x < 360 && header.max_y < 360) // do we have longitude / latitude coordinates
520  {
521  header.x_scale_factor = 1e-7;
522  header.y_scale_factor = 1e-7;
523  }
524  else // then we assume utm or mercator / lambertian projections
525  {
526  header.x_scale_factor = 0.01;
527  header.y_scale_factor = 0.01;
528  }
529  header.z_scale_factor = 0.01;
530  }
531 
532  // if not specified in the command line, set a reasonable offset
533  if (offset)
534  {
535  header.x_offset = offset[0];
536  header.y_offset = offset[1];
537  header.z_offset = offset[2];
538  }
539  else
540  {
541  if (-360 < header.min_x && -360 < header.min_y && header.max_x < 360 && header.max_y < 360) // do we have longitude / latitude coordinates
542  {
543  header.x_offset = 0;
544  header.y_offset = 0;
545  header.z_offset = 0;
546  }
547  else // then we assume utm or mercator / lambertian projections
548  {
549  header.x_offset = ((I32)((header.min_x + header.max_x)/200000))*100000;
550  header.y_offset = ((I32)((header.min_y + header.max_y)/200000))*100000;
551  header.z_offset = ((I32)((header.min_z + header.max_z)/200000))*100000;
552  }
553  }
554 }
555 
557 {
558  // compute quantized and then unquantized bounding box
559 
560  F64 dequant_min_x = header.get_x(header.get_x(header.min_x));
561  F64 dequant_max_x = header.get_x(header.get_x(header.max_x));
562  F64 dequant_min_y = header.get_y(header.get_y(header.min_y));
563  F64 dequant_max_y = header.get_y(header.get_y(header.max_y));
564  F64 dequant_min_z = header.get_z(header.get_z(header.min_z));
565  F64 dequant_max_z = header.get_z(header.get_z(header.max_z));
566 
567  // make sure there is not sign flip
568 
569  if ((header.min_x > 0) != (dequant_min_x > 0))
570  {
571  fprintf(stderr, "WARNING: quantization sign flip for min_x from %g to %g.\n", header.min_x, dequant_min_x);
572  fprintf(stderr, " set scale factor for x coarser than %g with '-scale'\n", header.x_scale_factor);
573  }
574  else
575  {
576  header.min_x = dequant_min_x;
577  }
578  if ((header.max_x > 0) != (dequant_max_x > 0))
579  {
580  fprintf(stderr, "WARNING: quantization sign flip for max_x from %g to %g.\n", header.max_x, dequant_max_x);
581  fprintf(stderr, " set scale factor for x coarser than %g with '-scale'\n", header.x_scale_factor);
582  }
583  else
584  {
585  header.max_x = dequant_max_x;
586  }
587  if ((header.min_y > 0) != (dequant_min_y > 0))
588  {
589  fprintf(stderr, "WARNING: quantization sign flip for min_y from %g to %g.\n", header.min_y, dequant_min_y);
590  fprintf(stderr, " set scale factor for y coarser than %g with '-scale'\n", header.y_scale_factor);
591  }
592  else
593  {
594  header.min_y = dequant_min_y;
595  }
596  if ((header.max_y > 0) != (dequant_max_y > 0))
597  {
598  fprintf(stderr, "WARNING: quantization sign flip for max_y from %g to %g.\n", header.max_y, dequant_max_y);
599  fprintf(stderr, " set scale factor for y coarser than %g with '-scale'\n", header.y_scale_factor);
600  }
601  else
602  {
603  header.max_y = dequant_max_y;
604  }
605  if ((header.min_z > 0) != (dequant_min_z > 0))
606  {
607  fprintf(stderr, "WARNING: quantization sign flip for min_z from %g to %g.\n", header.min_z, dequant_min_z);
608  fprintf(stderr, " set scale factor for z coarser than %g with '-scale'\n", header.z_scale_factor);
609  }
610  else
611  {
612  header.min_z = dequant_min_z;
613  }
614  if ((header.max_z > 0) != (dequant_max_z > 0))
615  {
616  fprintf(stderr, "WARNING: quantization sign flip for max_z from %g to %g.\n", header.max_z, dequant_max_z);
617  fprintf(stderr, " set scale factor for z coarser than %g with '-scale'\n", header.z_scale_factor);
618  }
619  else
620  {
621  header.max_z = dequant_max_z;
622  }
623 }
624 
625 LASreaderSHPrescale::LASreaderSHPrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor) : LASreaderSHP()
626 {
627  scale_factor[0] = x_scale_factor;
628  scale_factor[1] = y_scale_factor;
629  scale_factor[2] = z_scale_factor;
630 }
631 
632 BOOL LASreaderSHPrescale::open(const char* file_name)
633 {
634  if (!LASreaderSHP::open(file_name)) return FALSE;
635  // do we need to change anything
637  {
639  }
641  {
643  }
645  {
647  }
648  return TRUE;
649 }
650 
652 {
653  this->offset[0] = x_offset;
654  this->offset[1] = y_offset;
655  this->offset[2] = z_offset;
656 }
657 
658 BOOL LASreaderSHPreoffset::open(const char* file_name)
659 {
660  if (!LASreaderSHP::open(file_name)) return FALSE;
661  // do we need to change anything
662  if (header.x_offset != offset[0])
663  {
664  header.x_offset = offset[0];
665  }
666  if (header.y_offset != offset[1])
667  {
668  header.y_offset = offset[1];
669  }
670  if (header.z_offset != offset[2])
671  {
672  header.z_offset = offset[2];
673  }
674  return TRUE;
675 }
676 
677 LASreaderSHPrescalereoffset::LASreaderSHPrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset) : LASreaderSHPrescale(x_scale_factor, y_scale_factor, z_scale_factor), LASreaderSHPreoffset(x_offset, y_offset, z_offset)
678 {
679 }
680 
682 {
683  if (!LASreaderSHP::open(file_name)) return FALSE;
684  // do we need to change anything
686  {
688  }
690  {
692  }
694  {
696  }
697  if (header.x_offset != offset[0])
698  {
699  header.x_offset = offset[0];
700  }
701  if (header.y_offset != offset[1])
702  {
703  header.y_offset = offset[1];
704  }
705  if (header.z_offset != offset[2])
706  {
707  header.z_offset = offset[2];
708  }
709  return TRUE;
710 }
LASquantizer::y_offset
F64 y_offset
Definition: lasdefinitions.hpp:96
LASreaderSHPreoffset::LASreaderSHPreoffset
LASreaderSHPreoffset(F64 x_offset, F64 y_offset, F64 z_offset)
Definition: lasreader_shp.cpp:651
LASreaderSHP::point_count
I32 point_count
Definition: lasreader_shp.hpp:68
LASheader::system_identifier
I8 system_identifier[32]
Definition: lasdefinitions.hpp:964
LASreaderSHP::offset
F64 * offset
Definition: lasreader_shp.hpp:62
LASheader::clean
void clean()
Definition: lasdefinitions.hpp:1095
LASheader::min_y
F64 min_y
Definition: lasdefinitions.hpp:978
LASreaderSHPrescale::open
virtual BOOL open(const char *file_name)
Definition: lasreader_shp.cpp:632
LASheader::number_of_points_by_return
U32 number_of_points_by_return[5]
Definition: lasdefinitions.hpp:974
LASreaderSHP::points_allocated
I32 points_allocated
Definition: lasreader_shp.hpp:66
LASreaderSHP
Definition: lasreader_shp.hpp:38
LASreaderSHP::shape_type
I32 shape_type
Definition: lasreader_shp.hpp:64
LASquantizer::get_y
F64 get_y(const I32 y) const
Definition: lasdefinitions.hpp:100
LASreader::point
LASpoint point
Definition: lasreader.hpp:53
LASreaderSHPreoffset::open
virtual BOOL open(const char *file_name)
Definition: lasreader_shp.cpp:658
LASreaderSHP::seek
BOOL seek(const I64 p_index)
Definition: lasreader_shp.cpp:289
LASreaderSHP::file
FILE * file
Definition: lasreader_shp.hpp:63
LASheader::generating_software
I8 generating_software[32]
Definition: lasdefinitions.hpp:965
from_little_endian
static void from_little_endian(int *value)
Definition: lasreader_shp.cpp:68
LASreaderSHP::populate_scale_and_offset
void populate_scale_and_offset()
Definition: lasreader_shp.cpp:508
I64
long long I64
Definition: mydefs.hpp:48
LASquantizer::get_z
F64 get_z(const I32 z) const
Definition: lasdefinitions.hpp:101
F64
double F64
Definition: mydefs.hpp:52
LASquantizer::x_scale_factor
F64 x_scale_factor
Definition: lasdefinitions.hpp:92
I32
int I32
Definition: mydefs.hpp:35
TRUE
#define TRUE
Definition: mydefs.hpp:137
lasreader_shp.hpp
initialize_endianness
static void initialize_endianness()
Definition: lasreader_shp.cpp:44
LASreader::p_count
I64 p_count
Definition: lasreader.hpp:56
LASreader::npoints
I64 npoints
Definition: lasreader.hpp:55
from_big_endian
static void from_big_endian(int *value)
Definition: lasreader_shp.cpp:53
LASreaderSHP::points
I32 * points
Definition: lasreader_shp.hpp:65
LASreaderSHP::populate_bounding_box
void populate_bounding_box()
Definition: lasreader_shp.cpp:556
LASreaderSHP::~LASreaderSHP
virtual ~LASreaderSHP()
Definition: lasreader_shp.cpp:488
LASquantizer::x_offset
F64 x_offset
Definition: lasdefinitions.hpp:95
LASheader::number_of_point_records
U32 number_of_point_records
Definition: lasdefinitions.hpp:973
LASreaderSHP::set_offset
void set_offset(const F64 *offset)
Definition: lasreader_shp.cpp:273
LASreaderSHPrescale
Definition: lasreader_shp.hpp:75
LASpoint::y
I32 y
Definition: lasdefinitions.hpp:479
LASreaderSHP::get_stream
ByteStreamIn * get_stream() const
Definition: lasreader_shp.cpp:404
LASheader::point_data_format
U8 point_data_format
Definition: lasdefinitions.hpp:971
LASheader::file_creation_year
U16 file_creation_year
Definition: lasdefinitions.hpp:967
LASreaderSHPrescalereoffset::open
BOOL open(const char *file_name)
Definition: lasreader_shp.cpp:681
LASreaderSHP::LASreaderSHP
LASreaderSHP()
Definition: lasreader_shp.cpp:473
LASheader::max_x
F64 max_x
Definition: lasdefinitions.hpp:975
scripts.normalize_multiple.filename
filename
Definition: normalize_multiple.py:60
ByteStreamIn
Definition: bytestreamin.hpp:36
LASreaderSHP::piped
bool piped
Definition: lasreader_shp.hpp:69
LASquantizer::z_offset
F64 z_offset
Definition: lasdefinitions.hpp:97
LASreaderSHP::read_point_default
BOOL read_point_default()
Definition: lasreader_shp.cpp:294
BOOL
int BOOL
Definition: mydefs.hpp:57
LASreaderSHPrescale::scale_factor
F64 scale_factor[3]
Definition: lasreader_shp.hpp:82
LASpoint::z
I32 z
Definition: lasdefinitions.hpp:480
LASreaderSHP::reopen
BOOL reopen(const char *file_name)
Definition: lasreader_shp.cpp:419
FALSE
#define FALSE
Definition: mydefs.hpp:133
LASreaderSHPrescale::LASreaderSHPrescale
LASreaderSHPrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor)
Definition: lasreader_shp.cpp:625
LASheader::max_y
F64 max_y
Definition: lasdefinitions.hpp:977
LASreaderSHPrescalereoffset::LASreaderSHPrescalereoffset
LASreaderSHPrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset)
Definition: lasreader_shp.cpp:677
LASreaderSHP::clean
void clean()
Definition: lasreader_shp.cpp:461
is_little_endian
static bool is_little_endian
Definition: lasreader_shp.cpp:42
LAS_TOOLS_VERSION
#define LAS_TOOLS_VERSION
Definition: lasdefinitions.hpp:47
LASreaderSHP::set_scale_factor
void set_scale_factor(const F64 *scale_factor)
Definition: lasreader_shp.cpp:257
LASheader::min_x
F64 min_x
Definition: lasdefinitions.hpp:976
LASreaderSHP::open
virtual BOOL open(const char *file_name)
Definition: lasreader_shp.cpp:104
LASpoint::init
BOOL init(const LASquantizer *quantizer, const U8 point_type, const U16 point_size, const LASattributer *attributer=0)
Definition: lasdefinitions.hpp:595
fopen_compressed
FILE * fopen_compressed(const char *filename, const char *mode, bool *piped)
Definition: fopen_compressed.cpp:331
LASreader::header
LASheader header
Definition: lasreader.hpp:52
U32
unsigned int U32
Definition: mydefs.hpp:39
LASreaderSHPreoffset
Definition: lasreader_shp.hpp:85
LASheader::file_creation_day
U16 file_creation_day
Definition: lasdefinitions.hpp:966
LASquantizer::get_x
F64 get_x(const I32 x) const
Definition: lasdefinitions.hpp:99
LASpoint::x
I32 x
Definition: lasdefinitions.hpp:478
LASreaderSHP::number_of_points
I32 number_of_points
Definition: lasreader_shp.hpp:67
LASheader::max_z
F64 max_z
Definition: lasdefinitions.hpp:979
LASreaderSHP::close
void close(BOOL close_stream=TRUE)
Definition: lasreader_shp.cpp:409
LASreaderSHPreoffset::offset
F64 offset[3]
Definition: lasreader_shp.hpp:91
LASreaderSHP::scale_factor
F64 * scale_factor
Definition: lasreader_shp.hpp:61
LASheader::point_data_record_length
U16 point_data_record_length
Definition: lasdefinitions.hpp:972
LASquantizer::y_scale_factor
F64 y_scale_factor
Definition: lasdefinitions.hpp:93
LASquantizer::z_scale_factor
F64 z_scale_factor
Definition: lasdefinitions.hpp:94
LASheader::min_z
F64 min_z
Definition: lasdefinitions.hpp:980


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23