Geoinformatica  0.90
dem.h
Go to the documentation of this file.
1 #ifndef RAL_DEM_H
2 #define RAL_DEM_H
3 
17 int RAL_CALL ral_dem_fit_surface(ral_grid *dem, double z_factor, ral_grid ***params);
18 
19 ral_grid_handle RAL_CALL ral_dem_aspect(ral_grid *dem);
20 
22 ral_grid_handle RAL_CALL ral_dem_slope(ral_grid *dem, double z_factor);
23 
24 #define RAL_FLOW(fdg, c) (ral_cell_move((c), RAL_INTEGER_GRID_CELL((fdg), (c))))
25 
26 #define RAL_D8 1
27 #define RAL_RHO8 2
28 #define RAL_MANY8 3
29 
38 ral_grid_handle RAL_CALL ral_dem_fdg(ral_grid *dem, int method);
39 
44 ral_cell RAL_CALL ral_fdg_outlet(ral_grid *fdg, ral_grid *streams, ral_cell c);
45 
50 ral_grid_handle RAL_CALL ral_dem_ucg(ral_grid *dem);
51 
53 typedef struct {
61  double zf;
63  double dz;
67  int bc_found;
69  int dir_out;
74  int pp_found;
78  double z_ipp;
80  double slope_in;
82  double slope_out;
84  int dio;
86  int in2out;
92  double z_opp;
93  int counter;
95 
96 int RAL_CALL ral_init_pour_point_struct(ral_pour_point_struct *pp, ral_grid *fdg, ral_grid *dem, ral_grid *mark);
97 
101 long RAL_CALL ral_mark_upslope_cells(ral_pour_point_struct *pp, ral_cell c, int m);
102 
103 long RAL_CALL ral_fdg_catchment(ral_grid *fdg, ral_grid *mark, ral_cell c, int m);
104 
109 int RAL_CALL ral_fdg_drain_flat_areas1(ral_grid *fdg, ral_grid *dem);
110 
116 int RAL_CALL ral_fdg_drain_flat_areas2(ral_grid *fdg, ral_grid *dem);
117 
120 int RAL_CALL ral_dem_raise_pits(ral_grid *dem, double z_limit);
121 
124 int RAL_CALL ral_dem_lower_peaks(ral_grid *dem, double z_limit);
125 
130 ral_grid_handle RAL_CALL ral_fdg_depressions(ral_grid *fdg, int inc_m);
131 
135 int RAL_CALL ral_dem_fill_depressions(ral_grid *dem, ral_grid *fdg);
136 
138 int RAL_CALL ral_dem_breach(ral_grid *dem, ral_grid *fdg, int limit);
139 
143 int RAL_CALL ral_fdg_drain_depressions(ral_grid *fdg, ral_grid *dem);
144 
151 ral_grid_handle RAL_CALL ral_water_route(ral_grid *water, ral_grid *dem, ral_grid *fdg, ral_grid *k, double r);
152 
156 ral_grid_handle RAL_CALL ral_fdg_path(ral_grid *fdg, ral_cell c, ral_grid *stop);
157 
161 
163 ral_grid_handle RAL_CALL ral_fdg_path_sum(ral_grid *fdg, ral_grid *stop, ral_grid *op);
164 
166 ral_grid_handle RAL_CALL ral_fdg_upslope_sum(ral_grid *fdg, ral_grid *op, int include_self);
167 
169 ral_grid_handle RAL_CALL ral_fdg_upslope_mean(ral_grid *fdg, ral_grid *op, int include_self);
170 
172 ral_grid_handle RAL_CALL ral_fdg_upslope_variance(ral_grid *fdg, ral_grid *op, int include_self);
173 
177 ral_grid_handle RAL_CALL ral_fdg_upslope_count(ral_grid *fdg, ral_grid *op, int include_self);
178 
180 ral_grid_handle RAL_CALL ral_fdg_upslope_count_of(ral_grid *fdg, ral_grid *op, int include_self, RAL_INTEGER value);
181 
183 ral_grid_handle RAL_CALL ral_fdg_upslope_integer_range(ral_grid *fdg, ral_grid *op, int include_self, ral_integer_range *range);
184 
186 ral_grid_handle RAL_CALL ral_fdg_upslope_real_range(ral_grid *fdg, ral_grid *op, int include_self, ral_real_range *range);
187 
191 
195 
199 int RAL_CALL ral_streams_number(ral_grid *streams, ral_grid *fdg, ral_cell c, int sid0);
200 
204 int RAL_CALL ral_streams_number2(ral_grid *streams, ral_grid *fdg, int sid0);
205 
206 /* */
207 /* lakes grid is used below */
208 /* */
209 
210 /* lakes should have (by default) only one outlet */
211 
213 int RAL_CALL ral_fdg_kill_extra_outlets(ral_grid *fdg, ral_grid *lakes, ral_grid *uag);
214 
218 int RAL_CALL ral_streams_prune(ral_grid *streams, ral_grid *fdg, ral_grid *lakes, ral_cell c, double min_l);
219 
223 int RAL_CALL ral_streams_prune2(ral_grid *streams, ral_grid *fdg, ral_grid *lakes, double min_l);
224 
231 int RAL_CALL ral_streams_break(ral_grid *streams, ral_grid *fdg, ral_grid *lakes, int nsid);
232 
234 typedef struct {
239  int n;
240  int size;
241  int delta;
242 } ral_catchment;
243 
245 
246 void RAL_CALL ral_catchment_destroy(ral_catchment **catchment);
247 
255 ral_catchment_handle RAL_CALL ral_catchment_create(ral_grid *subs, ral_grid *streams, ral_grid *fdg, ral_grid *lakes, ral_cell outlet, int headwaters);
256 
264 ral_catchment_handle RAL_CALL ral_catchment_create_complete(ral_grid *subs, ral_grid *streams, ral_grid *fdg, ral_grid *lakes, int headwaters);
265 
266 int RAL_CALL ral_streams_vectorize(ral_grid *streams, ral_grid *fdg, int row, int col);
267 int RAL_CALL ral_compare_dem_derived_ws_attribs(ral_grid *str, ral_grid *uag, ral_grid *dem, char *dir, char *basename, int iname, int ielev, int idarea);
268 
269 #endif
ral_cell opp
Definition: dem.h:90
int RAL_CALL ral_dem_fill_depressions(ral_grid *dem, ral_grid *fdg)
ral_catchment_handle RAL_CALL ral_catchment_create_complete(ral_grid *subs, ral_grid *streams, ral_grid *fdg, ral_grid *lakes, int headwaters)
int RAL_CALL ral_dem_lower_peaks(ral_grid *dem, double z_limit)
ral_grid_handle RAL_CALL ral_fdg_path_sum(ral_grid *fdg, ral_grid *stop, ral_grid *op)
ral_grid_handle RAL_CALL ral_fdg_upslope_sum(ral_grid *fdg, ral_grid *op, int include_self)
ral_catchment_handle RAL_CALL ral_catchment_create(ral_grid *subs, ral_grid *streams, ral_grid *fdg, ral_grid *lakes, ral_cell outlet, int headwaters)
int RAL_CALL ral_dem_raise_pits(ral_grid *dem, double z_limit)
double z_ipp
Definition: dem.h:78
ral_grid_handle RAL_CALL ral_fdg_upslope_integer_range(ral_grid *fdg, ral_grid *op, int include_self, ral_integer_range *range)
int RAL_CALL ral_streams_prune2(ral_grid *streams, ral_grid *fdg, ral_grid *lakes, double min_l)
ral_grid_handle RAL_CALL ral_fdg_depressions(ral_grid *fdg, int inc_m)
int RAL_CALL ral_streams_number2(ral_grid *streams, ral_grid *fdg, int sid0)
double slope_out
Definition: dem.h:82
rectangular grid of integer or real values for geospatial data
Definition: grid.h:166
ral_grid * dem
Definition: dem.h:57
ral_cell * down
Definition: dem.h:238
ral_grid_handle RAL_CALL ral_fdg_path_length(ral_grid *fdg, ral_grid *stop, ral_grid *op)
int RAL_CALL ral_fdg_drain_flat_areas2(ral_grid *fdg, ral_grid *dem)
double z_opp
Definition: dem.h:92
ral_grid_handle RAL_CALL ral_fdg_upslope_variance(ral_grid *fdg, ral_grid *op, int include_self)
ral_grid_handle RAL_CALL ral_fdg_upslope_count(ral_grid *fdg, ral_grid *op, int include_self)
int RAL_CALL ral_fdg_drain_depressions(ral_grid *fdg, ral_grid *dem)
long RAL_CALL ral_mark_upslope_cells(ral_pour_point_struct *pp, ral_cell c, int m)
an integer range
Definition: hash.h:14
ral_grid_handle RAL_CALL ral_fdg_upslope_real_range(ral_grid *fdg, ral_grid *op, int include_self, ral_real_range *range)
ral_grid_handle RAL_CALL ral_fdg_path(ral_grid *fdg, ral_cell c, ral_grid *stop)
int pour_to_nodata
Definition: dem.h:88
ral_grid_handle RAL_CALL ral_fdg_upslope_mean(ral_grid *fdg, ral_grid *op, int include_self)
ral_cell ipp
Definition: dem.h:76
catchment structure
Definition: dem.h:234
int RAL_CALL ral_fdg_kill_extra_outlets(ral_grid *fdg, ral_grid *lakes, ral_grid *uag)
int RAL_CALL ral_streams_prune(ral_grid *streams, ral_grid *fdg, ral_grid *lakes, ral_cell c, double min_l)
ral_grid_handle RAL_CALL ral_water_route(ral_grid *water, ral_grid *dem, ral_grid *fdg, ral_grid *k, double r)
ral_grid_handle RAL_CALL ral_dem_slope(ral_grid *dem, double z_factor)
int RAL_CALL ral_streams_number(ral_grid *streams, ral_grid *fdg, ral_cell c, int sid0)
address of a cell of a grid
Definition: grid.h:104
ral_grid_handle RAL_CALL ral_dem_ucg(ral_grid *dem)
ral_grid * fdg
Definition: dem.h:55
int RAL_CALL ral_dem_breach(ral_grid *dem, ral_grid *fdg, int limit)
ral_cell bc
Definition: dem.h:65
a real value range
Definition: hash.h:20
A struct used in many algorithms that work with DEMs.
Definition: dem.h:53
ral_cell RAL_CALL ral_fdg_outlet(ral_grid *fdg, ral_grid *streams, ral_cell c)
ral_grid_handle RAL_CALL ral_dem_fdg(ral_grid *dem, int method)
int RAL_CALL ral_streams_break(ral_grid *streams, ral_grid *fdg, ral_grid *lakes, int nsid)
ral_grid * mark
Definition: dem.h:59
int RAL_CALL ral_dem_fit_surface(ral_grid *dem, double z_factor, ral_grid ***params)
ral_grid_handle RAL_CALL ral_fdg_upslope_count_of(ral_grid *fdg, ral_grid *op, int include_self, RAL_INTEGER value)
ral_cell * outlet
Definition: dem.h:236
int RAL_CALL ral_fdg_drain_flat_areas1(ral_grid *fdg, ral_grid *dem)
double slope_in
Definition: dem.h:80
ral_grid_handle RAL_CALL ral_streams_subcatchments(ral_grid *streams, ral_grid *fdg, ral_cell c)
ral_grid_handle RAL_CALL ral_streams_subcatchments2(ral_grid *streams, ral_grid *fdg)