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
LASindex::read
BOOL read(const char *file_name)
Definition: lasindex.cpp:267
LASindex::cells
U32 cells
Definition: lasindex.hpp:75
LASpoint
Definition: lasdefinitions.hpp:472
LASindex::get_intervals
BOOL get_intervals()
Definition: lasindex.cpp:247
F64
double F64
Definition: mydefs.hpp:52
LASindex::~LASindex
~LASindex()
Definition: lasindex.cpp:70
I32
int I32
Definition: mydefs.hpp:35
LASindex::interval
LASinterval * interval
Definition: lasindex.hpp:92
LASindex
Definition: lasindex.hpp:45
LASspatial
Definition: lasspatial.hpp:42
LASindex::complete
void complete(U32 minimum_points=100000, I32 maximum_intervals=-1)
Definition: lasindex.cpp:90
LASindex::intersect_tile
BOOL intersect_tile(const F32 ll_x, const F32 ll_y, const F32 size)
Definition: lasindex.cpp:227
LASindex::seek_next
BOOL seek_next(LASreader *lasreader)
Definition: lasindex.cpp:453
ByteStreamOut
Definition: bytestreamout.hpp:36
LASindex::end
U32 end
Definition: lasindex.hpp:72
LASreader
Definition: lasreader.hpp:49
LASindex::intersect_rectangle
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
LASindex::have_interval
BOOL have_interval
Definition: lasindex.hpp:93
LASindex::start
U32 start
Definition: lasindex.hpp:71
LASindex::read_next
BOOL read_next(LASreader *lasreader)
Definition: lasindex.cpp:438
LASindex::intersect_circle
BOOL intersect_circle(const F64 center_x, const F64 center_y, const F64 radius)
Definition: lasindex.cpp:237
ByteStreamIn
Definition: bytestreamin.hpp:36
LASindex::get_interval
LASinterval * get_interval() const
Definition: lasindex.cpp:212
LASindex::merge_intervals
BOOL merge_intervals()
Definition: lasindex.cpp:468
LASindex::LASindex
LASindex()
Definition: lasindex.cpp:58
LASindex::prepare
void prepare(LASspatial *spatial, I32 threshold=1000)
Definition: lasindex.cpp:76
BOOL
int BOOL
Definition: mydefs.hpp:57
F32
float F32
Definition: mydefs.hpp:51
LASindex::write
BOOL write(const char *file_name) const
Definition: lasindex.cpp:311
LASindex::full
U32 full
Definition: lasindex.hpp:73
U32
unsigned int U32
Definition: mydefs.hpp:39
LASindex::get_spatial
LASspatial * get_spatial() const
Definition: lasindex.cpp:207
LASindex::total
U32 total
Definition: lasindex.hpp:74
lasdefinitions.hpp
LASindex::add
BOOL add(const LASpoint *point, const U32 index)
Definition: lasindex.cpp:84
LASindex::spatial
LASspatial * spatial
Definition: lasindex.hpp:91
LASindex::print
void print(BOOL verbose)
Definition: lasindex.cpp:176
LASinterval
Definition: lasinterval.hpp:61
LASindex::has_intervals
BOOL has_intervals()
Definition: lasindex.cpp:253


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