GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72846
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lidar.h
Go to the documentation of this file.
1 
2 /***********************************************************************
3  *
4  * MODULE: lidarlib
5  *
6  * AUTHOR(S): Roberto Antolin
7  *
8  * PURPOSE: LIDAR library
9  *
10  * COPYRIGHT: (C) 2006 by Politecnico di Milano -
11  * Polo Regionale di Como
12  *
13  * This program is free software under the
14  * GNU General Public License (>=v2).
15  * Read the file COPYING that comes with GRASS
16  * for details.
17  *
18  **************************************************************************/
19 
20 #ifndef _POLIMIFUNCT_H_
21 #define _POLIMIFUNCT_H_
22 
23 #include <grass/gis.h>
24 #include <grass/gmath.h>
25 #include <grass/vector.h>
26 #include <grass/dbmi.h>
27 #include <grass/raster.h>
28 #include <grass/segment.h>
29 #include <grass/glocale.h>
30 
31 /*----------------------------------------------------------------------------------------------------------*/
32 /*CONSTANTS DECLARATION */
33 
34 #define NSPLX_MAX 150 /* Maximum number of splines along East direction used in the subregions interpolation */
35 #define NSPLY_MAX 150 /* Maximum number of splines along North direction used in the subregions interpolation */
36 #define OVERLAP_SIZE 10 /* Subregions overlapping size. */
37 #define LATO 1000 /* Side's size for v.lidar.growing. */
38 #define CONTOUR 15 /**/
39 #define GENERAL_ROW 0
40 #define GENERAL_COLUMN 1
41 #define FIRST_ROW 2
42 #define LAST_ROW 3
43 #define FIRST_COLUMN 4
44 #define LAST_COLUMN 5
45  /* FIELDS ID */
46 #define F_EDGE_DETECTION_CLASS 1
47 #define F_CLASSIFICATION 2
48 #define F_INTERPOLATION 3
49 #define F_COUNTER_OBJ 4
50  /* PRE-CLASSIFICATION */
51 #define PRE_TERRAIN 1
52 #define PRE_EDGE 2
53 #define PRE_UNKNOWN 3
54  /* FINAL CLASSIFICATION */
55 #define TERRAIN_SINGLE 1
56 #define TERRAIN_DOUBLE 2
57 #define OBJECT_DOUBLE 3
58 #define OBJECT_SINGLE 4
59  /* SINGLE OR DOUBLE PULSE */
60 #define SINGLE_PULSE 1
61 #define DOUBLE_PULSE 2
62  /* INTERPOLATOR */
63 #define P_BILINEAR 1
64 #define P_BICUBIC 0
65  /* Boolean definitions */
66 #define TRUE 1
67 #define FALSE 0
68 
69 /*----------------------------------------------------------------------------------------------------------*/
70  /*STRUCTS DECLARATION */
71  struct Reg_dimens
72 {
73  double edge_h; /*Horizontal tile edge */
74  double edge_v; /*Vertical tile edge */
75  double overlap; /*Tile's overlapping size */
76  double sn_size; /*South-North side size */
77  double ew_size; /*East-West side size */
78 };
79 
80 struct Point
81 {
82  double coordX;
83  double coordY;
84  double coordZ;
85  int lineID;
86  int cat;
87 };
88 
89 struct element
90 {
91  double value;
92  double residual;
93  int freq;
94 };
95 
96 /*----------------------------------------------------------------------------------------------------------*/
97 /*FUNCTIONS DECLARATION */
98 /*zones */
99 void P_zero_dim(struct Reg_dimens * /**/);
100 int P_set_dim(struct Reg_dimens *, double, double, int *, int *);
101 
102 int P_set_regions(struct Cell_head *, /**/
103  struct bound_box *, /**/
104  struct bound_box *, /**/ struct Reg_dimens, /**/ int /**/);
105 
106 int P_get_edge(int, /**/ struct Reg_dimens *, /**/ double, /**/ double /**/);
107 
108 int P_get_BandWidth(int, /**/ int /**/);
109 
110 double P_estimate_splinestep(struct Map_info *, double *, double *);
111 
112 struct Point *P_Read_Vector_Region_Map(struct Map_info *, /**/
113  struct Cell_head *, /**/
114  int *, /**/ int, /**/ int /**/);
115 
116 struct Point *P_Read_Raster_Region_Map(SEGMENT *, /**/
117  struct Cell_head *, /**/
118  struct Cell_head *, /**/
119  int *, /**/ int /**/);
120 
121 double P_Mean_Calc(struct Cell_head *, /**/ struct Point *, /**/ int /**/);
122 
123 /*----------------------------------------------------------------------------------------------------------*/
124 void
125 P_Sparse_Points(struct Map_info *, /**/
126  struct Cell_head *, /**/
127  struct bound_box, /**/
128  struct bound_box, /**/
129  double **, /**/
130  double *, /**/
131  int *, /**/
132  double, /**/
133  double, /**/
134  double, /**/
135  int, /**/
136  int, /**/
137  int, /**/
138  int, /**/
139  struct line_cats *, /**/
140  dbDriver *, /**/ double, /**/ char * /**/);
141 
142 int P_Regular_Points(struct Cell_head *, /**/
143  struct Cell_head *, /**/
144  struct bound_box, /**/
145  struct bound_box, /**/
146  SEGMENT *, /**/
147  double *, /**/
148  double, /**/
149  double, /**/
150  double, /**/
151  double, /**/
152  int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
153 
154 /*----------------------------------------------------------------------------------------------------------*/
155 int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
156 
157 int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
158 
159 int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
160 
161 /*----------------------------------------------------------------------------------------------------------*/
162 void P_Aux_to_Raster(double **, /**/ int /**/);
163 
164 void P_Aux_to_Vector(struct Map_info *, /**/
165  struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
166 
167 double **P_Null_Matrix(double ** /**/);
168 
169 /*---------------------------------------------------------------------------------------*/
170 /*interpSpline */
171 void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
172  double deltaX, double deltaY, int xNum, int yNum,
173  double xMin, double yMin, int obsNum, int parNum,
174  int BW);
175 
176 void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
177  double deltaX, double deltaY, int xNum, int yNum,
178  double xMin, double yMin, int obsNum, int parNum, int BW);
179 
180 void nCorrectLapl(double **N, /* Normal Matrix () */
181  double lambda, /* */
182  int xNum, /* */
183  int yNum, /* */
184  double deltaX, /* */
185  double deltaY); /* */
186 
187 void nCorrectGrad(double **N, double lambda, int xNum, int yNum,
188  double deltaX, double deltaY);
189 
190 void obsEstimateBicubic(double **obsV, /* */
191  double *obsE, /* */
192  double *parV, /* */
193  double deltX, /* */
194  double deltY, /* */
195  int xNm, /* */
196  int yNm, /* */
197  double xMi, /* */
198  double yMi, /* */
199  int obsN); /* */
200 
201 double dataInterpolateBicubic(double x, /* */
202  double y, /* */
203  double deltaX, /* */
204  double deltaY, /* */
205  int xNum, /* */
206  int yNum, /* */
207  double xMin, /* */
208  double yMin, /* */
209  double *parVect); /* */
210 
211 void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
212  double deltY, int xNm, int yNm, double xMi, double yMi,
213  int obsN);
214 
215 double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
216  int xNum, int yNum, double xMin, double yMin,
217  double *parVect);
218 
219 #endif
void P_Sparse_Points(struct Map_info *, struct Cell_head *, struct bound_box, struct bound_box, double **, double *, int *, double, double, double, int, int, int, int, struct line_cats *, dbDriver *, double, char *)
Definition: lidar/raster.c:9
void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX, double deltY, int xNm, int yNm, double xMi, double yMi, int obsN)
Definition: InterpSpline.c:595
void nCorrectGrad(double **N, double lambda, int xNum, int yNum, double deltaX, double deltaY)
Definition: InterpSpline.c:432
Bounding box.
Definition: dig_structs.h:65
int cat
Definition: lidar.h:86
int P_Create_Aux4_Table(dbDriver *, char *)
Definition: zones.c:486
void nCorrectLapl(double **N, double lambda, int xNum, int yNum, double deltaX, double deltaY)
Definition: InterpSpline.c:211
double coordX
Definition: lidar.h:82
2D/3D raster map header (used also for region)
Definition: gis.h:390
double dataInterpolateBilin(double x, double y, double deltaX, double deltaY, int xNum, int yNum, double xMin, double yMin, double *parVect)
Definition: InterpSpline.c:644
void obsEstimateBicubic(double **obsV, double *obsE, double *parV, double deltX, double deltY, int xNm, int yNm, double xMi, double yMi, int obsN)
Definition: InterpSpline.c:467
double coordY
Definition: lidar.h:83
int P_get_BandWidth(int, int)
Definition: zones.c:208
int lineID
Definition: lidar.h:85
int P_Regular_Points(struct Cell_head *, struct Cell_head *, struct bound_box, struct bound_box, SEGMENT *, double *, double, double, double, double, int, int, int, int, int)
Definition: lidar/raster.c:190
#define N
Definition: e_intersect.c:923
double residual
Definition: lidar.h:92
struct Point * P_Read_Vector_Region_Map(struct Map_info *, struct Cell_head *, int *, int, int)
Definition: zones.c:312
#define x
double ew_size
Definition: lidar.h:77
struct Point * P_Read_Raster_Region_Map(SEGMENT *, struct Cell_head *, struct Cell_head *, int *, int)
Definition: zones.c:379
Feature category info.
Definition: dig_structs.h:1702
Definition: lidar.h:89
int P_Drop_Aux_Table(dbDriver *, char *)
Definition: zones.c:523
void P_zero_dim(struct Reg_dimens *)
Definition: zones.c:9
int P_get_edge(int, struct Reg_dimens *, double, double)
Definition: zones.c:187
void normalDefBilin(double **N, double *TN, double *Q, double **obsVect, double deltaX, double deltaY, int xNum, int yNum, double xMin, double yMin, int obsNum, int parNum, int BW)
Definition: InterpSpline.c:313
double coordZ
Definition: lidar.h:84
double edge_h
Definition: lidar.h:73
double ** P_Null_Matrix(double **)
double overlap
Definition: lidar.h:75
void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect, double deltaX, double deltaY, int xNum, int yNum, double xMin, double yMin, int obsNum, int parNum, int BW)
Definition: InterpSpline.c:108
double sn_size
Definition: lidar.h:76
void P_Aux_to_Vector(struct Map_info *, struct Map_info *, dbDriver *, char *)
Definition: zones.c:560
Vector map info.
Definition: dig_structs.h:1259
double value
Definition: lidar.h:91
double edge_v
Definition: lidar.h:74
int P_Create_Aux2_Table(dbDriver *, char *)
Definition: zones.c:457
double dataInterpolateBicubic(double x, double y, double deltaX, double deltaY, int xNum, int yNum, double xMin, double yMin, double *parVect)
Definition: InterpSpline.c:533
double P_estimate_splinestep(struct Map_info *, double *, double *)
Definition: zones.c:249
void P_Aux_to_Raster(double **, int)
Definition: zones.c:534
int P_set_dim(struct Reg_dimens *, double, double, int *, int *)
Definition: zones.c:119
Definition: lidar.h:80
int freq
Definition: lidar.h:93
double P_Mean_Calc(struct Cell_head *, struct Point *, int)
Definition: zones.c:222
int P_set_regions(struct Cell_head *, struct bound_box *, struct bound_box *, struct Reg_dimens, int)
Definition: zones.c:54