lasindex.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: lasindex.hpp
5 
6  CONTENTS:
7 
8  This class can create a spatial indexing, store a spatial indexing, write
9  a spatial indexing to file, read a spatial indexing from file, and - most
10  importantly - it can be used together with a lasreader for efficient access
11  to a particular spatial region of a LAS file or a LAZ file.
12 
13  PROGRAMMERS:
14 
15  martin.isenburg@gmail.com
16 
17  COPYRIGHT:
18 
19  (c) 2009-11, Martin Isenburg, LASSO - tools to catch reality
20 
21  This is free software; you can redistribute and/or modify it under the
22  terms of the GNU Lesser General Licence as published by the Free Software
23  Foundation. See the COPYING file for more information.
24 
25  This software is distributed WITHOUT ANY WARRANTY and without even the
26  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 
28  CHANGE HISTORY:
29 
30  29 April 2011 -- created after cable outage during the royal wedding (-:
31 
32 ===============================================================================
33 */
34 #ifndef LAS_INDEX_HPP
35 #define LAS_INDEX_HPP
36 
37 #include "lasdefinitions.hpp"
38 
39 class LASspatial;
40 class LASinterval;
41 class LASreader;
42 class ByteStreamIn;
43 class ByteStreamOut;
44 
45 class LASindex
46 {
47 public:
48  LASindex();
49  ~LASindex();
50 
51  // create spatial index
52  void prepare(LASspatial* spatial, I32 threshold=1000);
53  BOOL add(const LASpoint* point, const U32 index);
54  void complete(U32 minimum_points=100000, I32 maximum_intervals=-1);
55 
56  // read from file or write to file
57  BOOL read(const char* file_name);
58  BOOL write(const char* file_name) const;
59  BOOL read(ByteStreamIn* stream);
60  BOOL write(ByteStreamOut* stream) const;
61 
62  // intersect
63  BOOL intersect_rectangle(const F64 r_min_x, const F64 r_min_y, const F64 r_max_x, const F64 r_max_y);
64  BOOL intersect_tile(const F32 ll_x, const F32 ll_y, const F32 size);
65  BOOL intersect_circle(const F64 center_x, const F64 center_y, const F64 radius);
66 
67  // access the intersected intervals
70 
76 
77  // read or seek next interval point
78  BOOL read_next(LASreader* lasreader);
79  BOOL seek_next(LASreader* lasreader);
80 
81  // for debugging
82  void print(BOOL verbose);
83 
84  // for visualization
85  LASspatial* get_spatial() const;
86  LASinterval* get_interval() const;
87 
88 private:
90 
94 };
95 
96 #endif
BOOL intersect_rectangle(const F64 r_min_x, const F64 r_min_y, const F64 r_max_x, const F64 r_max_y)
Definition: lasindex.cpp:217
U32 end
Definition: lasindex.hpp:72
BOOL read(const char *file_name)
Definition: lasindex.cpp:267
int BOOL
Definition: mydefs.hpp:57
U32 start
Definition: lasindex.hpp:71
LASspatial * get_spatial() const
Definition: lasindex.cpp:207
U32 cells
Definition: lasindex.hpp:75
BOOL read_next(LASreader *lasreader)
Definition: lasindex.cpp:438
float F32
Definition: mydefs.hpp:51
BOOL merge_intervals()
Definition: lasindex.cpp:468
BOOL seek_next(LASreader *lasreader)
Definition: lasindex.cpp:453
void complete(U32 minimum_points=100000, I32 maximum_intervals=-1)
Definition: lasindex.cpp:90
unsigned int U32
Definition: mydefs.hpp:39
BOOL intersect_circle(const F64 center_x, const F64 center_y, const F64 radius)
Definition: lasindex.cpp:237
U32 full
Definition: lasindex.hpp:73
BOOL get_intervals()
Definition: lasindex.cpp:247
BOOL has_intervals()
Definition: lasindex.cpp:253
BOOL write(const char *file_name) const
Definition: lasindex.cpp:311
LASinterval * interval
Definition: lasindex.hpp:92
U32 total
Definition: lasindex.hpp:74
LASindex()
Definition: lasindex.cpp:58
LASspatial * spatial
Definition: lasindex.hpp:91
BOOL intersect_tile(const F32 ll_x, const F32 ll_y, const F32 size)
Definition: lasindex.cpp:227
int I32
Definition: mydefs.hpp:35
void print(BOOL verbose)
Definition: lasindex.cpp:176
LASinterval * get_interval() const
Definition: lasindex.cpp:212
~LASindex()
Definition: lasindex.cpp:70
BOOL have_interval
Definition: lasindex.hpp:93
void prepare(LASspatial *spatial, I32 threshold=1000)
Definition: lasindex.cpp:76
BOOL add(const LASpoint *point, const U32 index)
Definition: lasindex.cpp:84
double F64
Definition: mydefs.hpp:52


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 Mon Feb 28 2022 22:46:07