GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-7413740dd8
defs/raster3d.h
Go to the documentation of this file.
1 #ifndef GRASS_RASTER3DDEFS_H
2 #define GRASS_RASTER3DDEFS_H
3 
4 /* cache.c */
7 void *Rast3d_cache_new(int, int, int, write_fn *, void *, read_fn *, void *);
10 void *Rast3d_cache_new_read(int, int, int, read_fn *, void *);
25 int Rast3d_cache_get_elt(RASTER3D_cache *, int, void *);
26 int Rast3d_cache_put_elt(RASTER3D_cache *, int, const void *);
27 
28 /* cachehash.c */
31 void *Rast3d_cache_hash_new(int);
35 
36 /* changeprecision.c */
37 void Rast3d_change_precision(void *, int, const char *);
38 
39 /* changetype.c */
40 void Rast3d_change_type(void *, const char *);
41 
42 /* filecompare.c */
43 void Rast3d_compare_files(const char *, const char *, const char *,
44  const char *);
45 
46 /* filename.c */
47 void Rast3d_filename(char *, const char *, const char *, const char *);
48 
49 /* fpcompress.c */
50 void Rast3d_fpcompress_print_binary(char *, int);
51 void Rast3d_fpcompress_dissect_xdr_double(unsigned char *);
52 int Rast3d_fpcompress_write_xdr_nums(int, char *, int, int, char *, int);
53 int Rast3d_fpcompress_read_xdr_nums(int, char *, int, int, int, char *, int);
54 
55 /* alloc.c */
56 void *Rast3d_malloc(int);
57 void *Rast3d_realloc(void *, int);
58 void Rast3d_free(void *);
59 
60 /* cache.c */
64 
65 /* cats.c */
66 int Rast3d_write_cats(const char *, struct Categories *);
67 int Rast3d_read_cats(const char *, const char *, struct Categories *);
68 
69 /* close.c */
71 
72 /* color.c */
73 int Rast3d_remove_color(const char *);
74 int Rast3d_read_colors(const char *, const char *, struct Colors *);
75 int Rast3d_write_colors(const char *, const char *, struct Colors *);
76 
77 /* defaults.c */
78 void Rast3d_set_compression_mode(int, int);
79 void Rast3d_get_compression_mode(int *, int *);
80 void Rast3d_set_cache_size(int);
81 int Rast3d_get_cache_size(void);
82 void Rast3d_set_cache_limit(int);
83 int Rast3d_get_cache_limit(void);
84 void Rast3d_set_file_type(int);
85 int Rast3d_get_file_type(void);
86 void Rast3d_set_tile_dimension(int, int, int);
87 void Rast3d_get_tile_dimension(int *, int *, int *);
88 void Rast3d_set_error_fun(void (*)(const char *));
89 void Rast3d_init_defaults(void);
90 
91 /* doubleio.c */
92 int Rast3d_write_doubles(int, int, const double *, int);
93 int Rast3d_read_doubles(int, int, double *, int);
94 
95 /* error.c */
96 void Rast3d_skip_error(const char *);
97 void Rast3d_print_error(const char *);
98 void Rast3d_fatal_error(const char *, ...) __attribute__((format(printf, 1, 2)))
99 __attribute__((noreturn));
100 void Rast3d_fatal_error_noargs(const char *) __attribute__((noreturn));
101 void Rast3d_error(const char *, ...) __attribute__((format(printf, 1, 2)));
102 
103 /* fpxdr.c */
104 int Rast3d_is_xdr_null_num(const void *, int);
105 int Rast3d_is_xdr_null_float(const float *);
106 int Rast3d_is_xdr_null_double(const double *);
107 void Rast3d_set_xdr_null_num(void *, int);
108 void Rast3d_set_xdr_null_double(double *);
109 void Rast3d_set_xdr_null_float(float *);
110 int Rast3d_init_fp_xdr(RASTER3D_Map *, int);
112 int Rast3d_copy_to_xdr(const void *, int);
114 int Rast3d_copy_from_xdr(int, void *);
115 
116 /* gradient.c */
120 
121 /* history.c */
122 int Rast3d_write_history(const char *, struct History *);
123 int Rast3d_read_history(const char *, const char *, struct History *);
124 
125 /* intio.c */
126 int Rast3d_write_ints(int, int, const int *, int);
127 int Rast3d_read_ints(int, int, int *, int);
128 
129 /* keys.c */
130 int Rast3d_key_get_int(struct Key_Value *, const char *, int *);
131 int Rast3d_key_get_double(struct Key_Value *, const char *, double *);
132 int Rast3d_key_get_string(struct Key_Value *, const char *, char **);
133 int Rast3d_key_get_value(struct Key_Value *, const char *, char *, char *, int,
134  int, int *);
135 int Rast3d_key_set_int(struct Key_Value *, const char *, const int *);
136 int Rast3d_key_set_double(struct Key_Value *, const char *, const double *);
137 int Rast3d_key_set_string(struct Key_Value *, const char *, char *const *);
138 int Rast3d_key_set_value(struct Key_Value *, const char *, const char *,
139  const char *, int, int, const int *);
140 /* long.c */
141 int Rast3d_long_encode(long *, unsigned char *, int);
142 void Rast3d_long_decode(unsigned char *, long *, int, int);
143 
144 /* mapset.c */
145 void Rast3d_make_mapset_map_directory(const char *);
146 
147 /* mask.c */
148 int Rast3d_mask_close(void);
149 int Rast3d_mask_file_exists(void);
150 int Rast3d_mask_open_old(void);
151 int Rast3d_mask_reopen(int);
152 int Rast3d_is_masked(RASTER3D_Map *, int, int, int);
153 void Rast3d_mask_num(RASTER3D_Map *, int, int, int, void *, int);
154 void Rast3d_mask_float(RASTER3D_Map *, int, int, int, float *);
155 void Rast3d_mask_double(RASTER3D_Map *, int, int, int, double *);
156 void Rast3d_mask_tile(RASTER3D_Map *, int, void *, int);
161 const char *Rast3d_mask_file(void);
162 int Rast3d_mask_map_exists(void);
163 
164 /* maskfn.c */
167 void Rast3d_parse_vallist(char **, d_Mask **);
168 
169 /* misc.c */
171 void Rast3d_copy_float2Double(const float *, int, double *, int, int);
172 void Rast3d_copy_double2Float(const double *, int, float *, int, int);
173 void Rast3d_copy_values(const void *, int, int, void *, int, int, int);
174 int Rast3d_length(int);
175 int Rast3d_extern_length(int);
176 
177 /* null.c */
178 int Rast3d_is_null_value_num(const void *, int);
179 void Rast3d_set_null_value(void *, int, int);
180 
181 /* open2.c */
182 void *Rast3d_open_new_param(const char *, int, int, RASTER3D_Region *, int, int,
183  int, int, int, int);
184 /* open.c */
185 void *Rast3d_open_cell_old_no_header(const char *, const char *);
186 void *Rast3d_open_cell_old(const char *, const char *, RASTER3D_Region *, int,
187  int);
188 void *Rast3d_open_cell_new(const char *, int, int, RASTER3D_Region *);
189 void *Rast3d_open_new_opt_tile_size(const char *, int, RASTER3D_Region *, int,
190  int);
191 
192 /* param.c */
194 int Rast3d_get_standard3d_params(int *, int *, int *, int *, int *, int *,
195  int *, int *, int *, int *);
196 void Rast3d_set_window_params(void);
197 char *Rast3d_get_window_params(void);
198 
199 /* range.c */
200 void Rast3d_range_update_from_tile(RASTER3D_Map *, const void *, int, int, int,
201  int, int, int, int, int);
202 int Rast3d_read_range(const char *, const char *, struct FPRange *);
204 void Rast3d_range_min_max(RASTER3D_Map *, double *, double *);
207 
208 /* region.c */
209 void Rast3d_get_region_value(RASTER3D_Map *, double, double, double, void *,
210  int);
218 int Rast3d_read_region_map(const char *, const char *, RASTER3D_Region *);
219 int Rast3d_is_valid_location(RASTER3D_Region *, double, double, double);
220 void Rast3d_location2coord(RASTER3D_Region *, double, double, double, int *,
221  int *, int *);
222 void Rast3d_location2coord_double(RASTER3D_Region *, double, double, double,
223  double *, double *, double *);
224 void Rast3d_location2coord2(RASTER3D_Region *, double, double, double, int *,
225  int *, int *);
226 void Rast3d_coord2location(RASTER3D_Region *, double, double, double, double *,
227  double *, double *);
228 /* resample.c */
229 void Rast3d_nearest_neighbor(RASTER3D_Map *, int, int, int, void *, int);
230 void Rast3d_set_resampling_fun(RASTER3D_Map *, void (*)(RASTER3D_Map *, int,
231  int, int, void *, int));
233  void (**)(RASTER3D_Map *, int, int, int, void *,
234  int));
235 void Rast3d_get_nearest_neighbor_fun_ptr(void (**)(RASTER3D_Map *, int, int,
236  int, void *, int));
237 
238 /* volume.c */
239 void Rast3d_get_volume_a(void *, double[2][2][2][3], int, int, int, void *,
240  int);
241 void Rast3d_get_volume(void *, double, double, double, double, double, double,
242  double, double, double, double, double, double, int, int,
243  int, void *, int);
244 void Rast3d_get_aligned_volume(void *, double, double, double, double, double,
245  double, int, int, int, void *, int);
246 void Rast3d_make_aligned_volume_file(void *, const char *, double, double,
247  double, double, double, double, int, int,
248  int);
249 /* window.c */
250 void Rast3d_get_value(RASTER3D_Map *, int, int, int, void *, int);
251 float Rast3d_get_float(RASTER3D_Map *, int, int, int);
252 double Rast3d_get_double(RASTER3D_Map *, int, int, int);
253 void Rast3d_get_window_value(RASTER3D_Map *, double, double, double, void *,
254  int);
255 
260 
261 /* windowio.c */
262 void Rast3d_use_window_params(void);
263 int Rast3d_read_window(RASTER3D_Region *, const char *);
264 
265 /* int Rast3d_writeWindow (RASTER3D_Region *, char *); */
266 /* getblock.c */
267 void Rast3d_get_block_nocache(RASTER3D_Map *, int, int, int, int, int, int,
268  void *, int);
269 void Rast3d_get_block(RASTER3D_Map *, int, int, int, int, int, int, void *,
270  int);
271 
272 /* header.c */
273 int Rast3d_read_header(RASTER3D_Map *, int *, int *, double *, double *,
274  double *, double *, double *, double *, int *, int *,
275  int *, double *, double *, double *, int *, int *, int *,
276  int *, int *, int *, int *, int *, int *, int *, int *,
277  char **, int *, int *);
278 int Rast3d_write_header(RASTER3D_Map *, int, int, double, double, double,
279  double, double, double, int, int, int, double, double,
280  double, int, int, int, int, int, int, int, int, int,
281  int, int, char *, int, int);
283 int Rast3d_cache_size_encode(int, int);
285 int Rast3d_fill_header(RASTER3D_Map *, int, int, int, int, int, int, int, int,
286  int, int, int, int, int, int, int, int, double, double,
287  double, double, double, double, int, int, int, double,
288  double, double, char *, int, int);
289 /* headerinfo.c */
290 void Rast3d_get_coords_map(RASTER3D_Map *, int *, int *, int *);
291 void Rast3d_get_coords_map_window(RASTER3D_Map *, int *, int *, int *);
292 void Rast3d_get_nof_tiles_map(RASTER3D_Map *, int *, int *, int *);
293 void Rast3d_get_region_map(RASTER3D_Map *, double *, double *, double *,
294  double *, double *, double *);
295 void Rast3d_get_window_map(RASTER3D_Map *, double *, double *, double *,
296  double *, double *, double *);
297 void Rast3d_get_tile_dimensions_map(RASTER3D_Map *, int *, int *, int *);
304 const char *Rast3d_get_unit(RASTER3D_Map *map);
306 const char *Rast3d_get_vertical_unit(RASTER3D_Map *map);
307 void Rast3d_set_unit(RASTER3D_Map *map, const char *);
308 void Rast3d_set_vertical_unit(RASTER3D_Map *map, const char *);
310 
311 /* index.c */
313 int Rast3d_init_index(RASTER3D_Map *, int);
314 
315 /* retile.c */
316 void Rast3d_retile(void *, const char *, int, int, int);
317 
318 /* rle.c */
319 int Rast3d_rle_count_only(char *, int, int);
320 void Rast3d_rle_encode(char *, char *, int, int);
321 void Rast3d_rle_decode(char *, char *, int, int, int *, int *);
322 
323 /* tilealloc.c */
324 void *Rast3d_alloc_tiles_type(RASTER3D_Map *, int, int);
325 void *Rast3d_alloc_tiles(RASTER3D_Map *, int);
326 void Rast3d_free_tiles(void *);
327 
328 /* tileio.c */
329 void *Rast3d_get_tile_ptr(RASTER3D_Map *, int);
330 int Rast3d_tile_load(RASTER3D_Map *, int);
332 float Rast3d_get_float_region(RASTER3D_Map *, int, int, int);
333 double Rast3d_get_double_region(RASTER3D_Map *, int, int, int);
334 void Rast3d_get_value_region(RASTER3D_Map *, int, int, int, void *, int);
335 
336 /* tilemath.c */
338  int *, int);
339 void Rast3d_tile_index2tile(RASTER3D_Map *, int, int *, int *, int *);
340 int Rast3d_tile2tile_index(RASTER3D_Map *, int, int, int);
341 void Rast3d_tile_coord_origin(RASTER3D_Map *, int, int, int, int *, int *,
342  int *);
343 void Rast3d_tile_index_origin(RASTER3D_Map *, int, int *, int *, int *);
344 void Rast3d_coord2tile_coord(RASTER3D_Map *, int, int, int, int *, int *, int *,
345  int *, int *, int *);
346 void Rast3d_coord2tile_index(RASTER3D_Map *, int, int, int, int *, int *);
347 int Rast3d_coord_in_range(RASTER3D_Map *, int, int, int);
349 int Rast3d_tile_in_range(RASTER3D_Map *, int, int, int);
351  int *, int *, int *, int *);
352 
353 /* tilenull.c */
354 void Rast3d_set_null_tile_type(RASTER3D_Map *, void *, int);
355 void Rast3d_set_null_tile(RASTER3D_Map *, void *);
356 
357 /* tileread.c */
358 int Rast3d_read_tile(RASTER3D_Map *, int, void *, int);
359 int Rast3d_read_tile_float(RASTER3D_Map *, int, void *);
360 int Rast3d_read_tile_double(RASTER3D_Map *, int, void *);
361 int Rast3d_lock_tile(RASTER3D_Map *, int);
362 int Rast3d_unlock_tile(RASTER3D_Map *, int);
366 void Rast3d_min_unlocked(RASTER3D_Map *, int);
369 
370 /* tilewrite.c */
371 int Rast3d_write_tile(RASTER3D_Map *, int, const void *, int);
372 int Rast3d_write_tile_float(RASTER3D_Map *, int, const void *);
373 int Rast3d_write_tile_double(RASTER3D_Map *, int, const void *);
374 int Rast3d_flush_tile(RASTER3D_Map *, int);
375 int Rast3d_flush_tile_cube(RASTER3D_Map *, int, int, int, int, int, int);
376 int Rast3d_flush_tiles_in_cube(RASTER3D_Map *, int, int, int, int, int, int);
377 int Rast3d_put_float(RASTER3D_Map *, int, int, int, float);
378 int Rast3d_put_double(RASTER3D_Map *, int, int, int, double);
379 int Rast3d_put_value(RASTER3D_Map *, int, int, int, const void *, int);
380 
381 /* writeascii.c */
382 void Rast3d_write_ascii(void *, const char *);
383 
384 #endif /* RASTER3DDEFS */
void Rast3d_gradient_double(RASTER3D_Array_double *, double *, RASTER3D_Array_double *, RASTER3D_Array_double *, RASTER3D_Array_double *)
Gradient computation.
Definition: gradient.c:34
int Rast3d_read_tile_double(RASTER3D_Map *, int, void *)
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE).
Definition: tileread.c:233
void Rast3d_copy_values(const void *, int, int, void *, int, int, int)
Definition: raster3d/misc.c:50
void * Rast3d_cache_new_read(int, int, int, read_fn *, void *)
Definition: cache1.c:161
void Rast3d_retile(void *, const char *, int, int, int)
Makes a copy of map with name nameOut which has tile dimensions tileX, tileY, tileZ....
Definition: retile.c:78
int Rast3d_rewrite_header(RASTER3D_Map *map)
void Rast3d_get_value(RASTER3D_Map *, int, int, int, void *, int)
Returns in *value the resampled cell-value of the cell with window-coordinate (x, y,...
Definition: getvalue.c:22
int Rast3d_cache_lock(RASTER3D_cache *, int)
Definition: cache1.c:267
int Rast3d_fill_header(RASTER3D_Map *, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, double, double, double, double, double, double, int, int, int, double, double, double, char *, int, int)
int Rast3d_g3d_type2cell_type(int)
Definition: raster3d/misc.c:13
int Rast3d_cache_size_encode(int, int)
Returns a number which encodes multiplicity n of cacheCode. This value can be used to specify the siz...
int Rast3d_flush_all_tiles(RASTER3D_Map *)
Definition: cache.c:283
void Rast3d_cache_lock_intern(RASTER3D_cache *, int)
Definition: cache1.c:292
void * Rast3d_realloc(void *, int)
Same as realloc (ptr, nBytes), except that in case of error Rast3d_error() is invoked.
void Rast3d_mask_num(RASTER3D_Map *, int, int, int, void *, int)
Replaces the value stored in value with the NULL-value if Rast3d_is_masked (x, y, z) returns 1....
Definition: mask.c:201
void Rast3d_location2coord(RASTER3D_Region *, double, double, double, int *, int *, int *)
Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z).
Definition: region.c:284
int Rast3d_write_header(RASTER3D_Map *, int, int, double, double, double, double, double, double, int, int, int, double, double, double, int, int, int, int, int, int, int, int, int, int, int, char *, int, int)
int Rast3d_read_colors(const char *, const char *, struct Colors *)
Reads color file for map name in mapset into the Colors structure.
void Rast3d_write_ascii(void *, const char *)
Writes the cell-values of map in ascii format to file fname. The values are organized by horizontal s...
Definition: writeascii.c:19
int Rast3d_mask_is_off(RASTER3D_Map *)
Returns 1 if the mask for map is turned off. Returns 0 otherwise.
Definition: mask.c:374
int Rast3d_cache_flush_all(RASTER3D_cache *)
Definition: cache1.c:451
int Rast3d_put_float(RASTER3D_Map *, int, int, int, float)
Is equivalent to Rast3d_put_value (map, x, y, z, &value, FCELL_TYPE).
Definition: putvalue.c:18
void Rast3d_cache_dispose(RASTER3D_cache *)
Definition: cache1.c:63
void Rast3d_set_xdr_null_num(void *, int)
Definition: fpxdr.c:38
void Rast3d_nearest_neighbor(RASTER3D_Map *, int, int, int, void *, int)
The default resampling function which uses nearest neighbor resampling. This method converts the wind...
Definition: resample.c:23
void Rast3d_filename(char *, const char *, const char *, const char *)
Definition: filename.c:9
int Rast3d_flush_tile(RASTER3D_Map *, int)
Writes the tile with tileIndex to the file corresponding to map and removes the tile from the cache (...
Definition: tilewrite.c:253
int Rast3d_write_colors(const char *, const char *, struct Colors *)
Writes the colors for map name in mapset into a color file.
int Rast3d_read_cats(const char *, const char *, struct Categories *)
Reads the categories file for map name in mapset and stores the categories in the pcats structure....
void Rast3d_cache_set_load_fun(RASTER3D_cache *, read_fn *, void *)
int Rast3d_mask_d_select(DCELL *, d_Mask *)
Definition: maskfn.c:45
int Rast3d_is_xdr_null_double(const double *)
Definition: fpxdr.c:31
void Rast3d_free(void *)
Same as free (ptr).
int Rast3d_file_type_map(RASTER3D_Map *)
Returns the type with which tiles of map are stored on file.
Definition: headerinfo.c:276
void Rast3d_rle_encode(char *, char *, int, int)
Definition: rle.c:184
int Rast3d_rle_count_only(char *, int, int)
Definition: rle.c:141
int Rast3d_cache_put_elt(RASTER3D_cache *, int, const void *)
Definition: cache1.c:547
int Rast3d_tile_type_map(RASTER3D_Map *)
Returns the type in which tiles of map are stored in memory.
Definition: headerinfo.c:156
void Rast3d_get_nof_tiles_map(RASTER3D_Map *, int *, int *, int *)
Returns the dimensions of the tile-cube used to tile the region of map. These numbers include partial...
Definition: headerinfo.c:50
void Rast3d_set_xdr_null_double(double *)
Definition: fpxdr.c:49
void Rast3d_fatal_error_noargs(const char *) __attribute__((noreturn))
void Rast3d_compute_optimal_tile_dimension(RASTER3D_Region *, int, int *, int *, int *, int)
Compute the optimal tile size.
Definition: tilemath.c:317
void Rast3d_autolock_on(RASTER3D_Map *)
Turns autolock mode on.
Definition: tileread.c:340
const char * Rast3d_get_vertical_unit(RASTER3D_Map *map)
Return the name of the unit of map. Units are defined in gis.h.
Definition: headerinfo.c:260
void * Rast3d_open_cell_old(const char *, const char *, RASTER3D_Region *, int, int)
Opens existing g3d-file name in mapset. Tiles are stored in memory with type which must be any of FCE...
Definition: raster3d/open.c:80
void Rast3d_get_region_value(RASTER3D_Map *, double, double, double, void *, int)
Returns in value the value of the map which corresponds to region coordinates (north,...
Definition: getvalue.c:131
int Rast3d_flush_index(RASTER3D_Map *)
void Rast3d_cache_hash_dispose(Rast3d_cache_hash *)
Definition: cachehash.c:36
void Rast3d_cache_hash_remove_name(Rast3d_cache_hash *, int)
Definition: cachehash.c:76
float Rast3d_get_float_region(RASTER3D_Map *, int, int, int)
Is equivalent to Rast3d_get_value_region (map, x, y, z, &value, FCELL_TYPE); return value.
Definition: getvalue.c:165
void Rast3d_region_to_cell_head(RASTER3D_Region *, struct Cell_head *)
Returns in region2d the 2d portion of region3d.
Definition: region.c:47
int Rast3d_init_copy_from_xdr(RASTER3D_Map *, int)
Definition: fpxdr.c:184
int Rast3d_get_cache_limit(void)
Get cache limit.
Definition: defaults.c:190
void Rast3d_get_tile_dimensions_map(RASTER3D_Map *, int *, int *, int *)
Returns the tile dimensions used for map.
Definition: headerinfo.c:138
int Rast3d_unlock_all(RASTER3D_Map *)
Unlocks every tile in cache of map.
Definition: tileread.c:315
void Rast3d_cache_autolock_off(RASTER3D_cache *)
Definition: cache1.c:361
void Rast3d_set_null_tile_type(RASTER3D_Map *, void *, int)
Assumes that tile is a tile with the same dimensions as the tiles of map. Fills tile with NULL-values...
Definition: tilenull.c:22
int Rast3d_read_doubles(int, int, double *, int)
Definition: doubleio.c:53
void Rast3d_mask_tile(RASTER3D_Map *, int, void *, int)
Replaces the values stored in tile (with tileIndex) for which Rast3d_is_masked returns 1 with NULL-va...
Definition: mask.c:270
void Rast3d_make_mapset_map_directory(const char *)
void Rast3d_get_tile_dimension(int *, int *, int *)
get Tile Dimension
Definition: defaults.c:262
void Rast3d_tile_index_origin(RASTER3D_Map *, int, int *, int *, int *)
Computes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tileIndex.
Definition: tilemath.c:97
void Rast3d_change_precision(void *, int, const char *)
Makes a copy of map with name nameOut which is written with precision. The source code can be found i...
int Rast3d_write_doubles(int, int, const double *, int)
Definition: doubleio.c:9
int Rast3d_cache_load(RASTER3D_cache *, int)
Definition: cache1.c:518
void Rast3d_get_volume_a(void *, double[2][2][2][3], int, int, int, void *, int)
Definition: volume.c:44
void Rast3d_cache_reset(RASTER3D_cache *)
Definition: cache1.c:31
int Rast3d_read_history(const char *, const char *, struct History *)
read raster3d History file
void Rast3d_long_decode(unsigned char *, long *, int, int)
Definition: long.c:35
int Rast3d_is_valid_location(RASTER3D_Region *, double, double, double)
Returns 1 if region-coordinates (north, east, top) are inside the region of map. Returns 0 otherwise.
Definition: region.c:257
int Rast3d_key_set_int(struct Key_Value *, const char *, const int *)
Definition: keys.c:93
int Rast3d_dispose_cache(RASTER3D_Map *)
Definition: cache.c:249
void Rast3d_extract2d_region(RASTER3D_Region *, struct Cell_head *)
Returns in region2d the 2d portion of region3d.
Definition: region.c:19
int Rast3d_tile_index_in_range(RASTER3D_Map *, int)
Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise.
Definition: tilemath.c:204
void Rast3d_get_coords_map_window(RASTER3D_Map *, int *, int *, int *)
Definition: headerinfo.c:27
void Rast3d_get_region_struct_map(RASTER3D_Map *, RASTER3D_Region *)
Returns in region the region of map.
Definition: headerinfo.c:112
void Rast3d_get_resampling_fun(RASTER3D_Map *, void(**)(RASTER3D_Map *, int, int, int, void *, int))
Returns in resampleFun a pointer to the resampling function used by map.
Definition: resample.c:72
void Rast3d_set_standard3d_input_params(void)
Initializes a parameter structure for the subset of command line arguments which lets the user overwr...
Definition: param.c:39
void Rast3d_set_null_value(void *, int, int)
Fills the vector pointed to by c with nofElts NULL-values of type.
Definition: null.c:34
void Rast3d_min_unlocked(RASTER3D_Map *, int)
Sets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination...
Definition: tileread.c:389
int Rast3d_unlock_tile(RASTER3D_Map *, int)
Unlocks tile with tileIndex.
Definition: tileread.c:289
int Rast3d_mask_map_exists(void)
Returns 1 if the 3d mask is loaded.
Definition: mask.c:400
void Rast3d_set_resampling_fun(RASTER3D_Map *, void(*)(RASTER3D_Map *, int, int, int, void *, int))
Sets the resampling function to be used by Rast3d_get_value () (cf.{g3d:G3d.getValue})....
Definition: resample.c:53
int Rast3d_is_null_value_num(const void *, int)
Definition: null.c:12
int Rast3d_mask_open_old(void)
Definition: mask.c:74
int Rast3d_coord_in_range(RASTER3D_Map *, int, int, int)
Returns 1 if cell-coordinate (x, y, z) is a coordinate inside the region. Returns 0 otherwise.
Definition: tilemath.c:185
int Rast3d_write_history(const char *, struct History *)
write raster3d History file
void Rast3d_autolock_off(RASTER3D_Map *)
Turns autolock mode Off.
Definition: tileread.c:360
void Rast3d_free_tiles(void *)
Is equivalent to Rast3d_free (tiles);
Definition: tilealloc.c:73
void Rast3d_set_null_tile(RASTER3D_Map *, void *)
Is equivalent to Rast3d_set_null_tile_type (map, tile, Rast3d_file_type_map (map)).
Definition: tilenull.c:40
int Rast3d_tile_precision_map(RASTER3D_Map *)
Returns the precision used to store map.
Definition: headerinfo.c:292
void Rast3d_set_tile_dimension(int, int, int)
set Tile Dimension
Definition: defaults.c:236
int Rast3d_read_range(const char *, const char *, struct FPRange *)
int Rast3d__compute_cache_size(RASTER3D_Map *, int)
void Rast3d_copy_float2Double(const float *, int, double *, int, int)
Definition: raster3d/misc.c:22
void Rast3d_set_vertical_unit2(RASTER3D_Map *map, int)
set Vertical unit from integer value defined in gis.h (U_METERS, ...)
Definition: headerinfo.c:190
int Rast3d_key_get_string(struct Key_Value *, const char *, char **)
Definition: keys.c:48
void Rast3d_adjust_region_res(RASTER3D_Region *)
Computes an adjusts the number of cells per dimension in the region structure from the region boundar...
Definition: region.c:174
int Rast3d_read_header(RASTER3D_Map *, int *, int *, double *, double *, double *, double *, double *, double *, int *, int *, int *, double *, double *, double *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, char **, int *, int *)
void Rast3d_get_coords_map(RASTER3D_Map *, int *, int *, int *)
Returns the size of the region of map in cells.
Definition: headerinfo.c:18
int Rast3d_init_index(RASTER3D_Map *, int)
void Rast3d_mask_off(RASTER3D_Map *)
Turns off the mask for map. This is the default. Do not invoke this function after the first tile has...
Definition: mask.c:345
void Rast3d_mask_double(RASTER3D_Map *, int, int, int, double *)
Same as Rast3d_mask_num (x, y, z, value, DCELL_TYPE).
Definition: mask.c:244
void Rast3d_set_error_fun(void(*)(const char *))
set error function
Definition: defaults.c:278
void Rast3d_tile_index2tile(RASTER3D_Map *, int, int *, int *, int *)
Converts index tileIndex into tile-coordinates (xTile, yTile, zTile).
Definition: tilemath.c:23
int Rast3d_cache_flush(RASTER3D_cache *, int)
Definition: cache1.c:422
void Rast3d_region_from_to_cell_head(struct Cell_head *, RASTER3D_Region *)
Replaces the 2d portion of region3d with the values stored in region2d.
Definition: region.c:115
void Rast3d_get_block(RASTER3D_Map *, int, int, int, int, int, int, void *, int)
Copies the cells contained in the block (cube) with vertices (x0, y0, z0) and (x0 + nx - 1,...
Definition: getblock.c:102
int Rast3d_get_vertical_unit2(RASTER3D_Map *map)
Returns the vertical unit of map as integer. Units are defined in gis.h.
Definition: headerinfo.c:242
void * Rast3d_get_tile_ptr(RASTER3D_Map *, int)
This function returns a pointer to a tile which contains the data for the tile with index tileIndex....
Definition: tileio.c:79
int Rast3d_tile_use_cache_map(RASTER3D_Map *)
Returns 1 if map uses cache, returns 0 otherwise.
Definition: headerinfo.c:308
void Rast3d_cache_hash_reset(Rast3d_cache_hash *)
Definition: cachehash.c:24
void * Rast3d_cache_new(int, int, int, write_fn *, void *, read_fn *, void *)
void Rast3d_print_header(RASTER3D_Map *)
Prints the header information of map.
Definition: headerinfo.c:322
int Rast3d_read_region_map(const char *, const char *, RASTER3D_Region *)
Definition: region.c:226
void Rast3d_set_file_type(int)
set G3d file type
Definition: defaults.c:204
RASTER3D_Region * Rast3d_window_ptr(void)
void Rast3d_set_unit(RASTER3D_Map *map, const char *)
Set the data unit defintiong.
Definition: headerinfo.c:173
int Rast3d_key_set_string(struct Key_Value *, const char *, char *const *)
Definition: keys.c:116
int Rast3d_write_tile_float(RASTER3D_Map *, int, const void *)
Is equivalent to Rast3d_write_tile (map, tileIndex, tile, FCELL_TYPE).
Definition: tilewrite.c:195
void Rast3d_get_aligned_volume(void *, double, double, double, double, double, double, int, int, int, void *, int)
Definition: volume.c:180
void Rast3d_set_cache_limit(int)
Set cache limit.
Definition: defaults.c:174
void Rast3d_cache_autolock_on(RASTER3D_cache *)
Definition: cache1.c:354
int Rast3d_write_cats(const char *, struct Categories *)
Writes the categories stored in the cats structure into the categories file for map name in the curre...
Definition: raster3d/cats.c:26
int Rast3d_mask_file_exists(void)
Returns 1 if the 3d mask file exists.
Definition: mask.c:64
void Rast3d_adjust_region(RASTER3D_Region *)
Computes an adjusts the resolutions in the region structure from the region boundaries and number of ...
Definition: region.c:149
int Rast3d_range_load(RASTER3D_Map *)
Loads the range into the range structure of map.
void Rast3d_location2coord_double(RASTER3D_Region *, double, double, double, double *, double *, double *)
Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z).
Definition: region.c:315
int Rast3d_get_file_type(void)
get G3d file type
Definition: defaults.c:220
int Rast3d_put_value(RASTER3D_Map *, int, int, int, const void *, int)
After converting *value of type into the type specified at the initialization time (i....
Definition: putvalue.c:92
void * Rast3d_alloc_tiles(RASTER3D_Map *, int)
Is equivalent to Rast3d_alloc_tiles_type (map, nofTiles, Rast3d_file_type_map (map)).
Definition: tilealloc.c:49
void Rast3d_get_nearest_neighbor_fun_ptr(void(**)(RASTER3D_Map *, int, int, int, void *, int))
Returns in nnFunPtr a pointer to Rast3d_nearest_neighbor () (cf.{g3d:G3d.nearestNeighbor}).
Definition: resample.c:91
void __attribute__((noreturn))
int Rast3d_tile2tile_index(RASTER3D_Map *, int, int, int)
Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).
Definition: tilemath.c:49
void Rast3d_get_value_region(RASTER3D_Map *, int, int, int, void *, int)
Returns in *value the cell-value of the cell with region-coordinate (x, y, z). The value returned is ...
Definition: getvalue.c:257
const char * Rast3d_mask_file(void)
Returns the name of the 3d mask file.
Definition: mask.c:387
void Rast3d_cache_set_min_unlock(RASTER3D_cache *, int)
Definition: cache1.c:368
int Rast3d_mask_close(void)
Definition: mask.c:37
void Rast3d_skip_error(const char *)
void Rast3d_range_update_from_tile(RASTER3D_Map *, const void *, int, int, int, int, int, int, int, int)
char * Rast3d_get_window_params(void)
Definition: param.c:134
void Rast3d_tile_coord_origin(RASTER3D_Map *, int, int, int, int *, int *, int *)
Computes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tile-coordina...
Definition: tilemath.c:73
void Rast3d_print_error(const char *)
Prints error message.
void * Rast3d_cache_hash_new(int)
Definition: cachehash.c:50
void Rast3d_mask_on(RASTER3D_Map *)
Turns on the mask for map. Do not invoke this function after the first tile has been read since the r...
Definition: mask.c:329
void Rast3d_get_block_nocache(RASTER3D_Map *, int, int, int, int, int, int, void *, int)
Definition: getblock.c:11
void Rast3d_mask_float(RASTER3D_Map *, int, int, int, float *)
Same as Rast3d_mask_num (x, y, z, value, FCELL_TYPE).
Definition: mask.c:223
int Rast3d_init_fp_xdr(RASTER3D_Map *, int)
Definition: fpxdr.c:65
int Rast3d_key_get_int(struct Key_Value *, const char *, int *)
Definition: keys.c:7
void Rast3d_parse_vallist(char **, d_Mask **)
Definition: maskfn.c:100
int Rast3d_key_set_value(struct Key_Value *, const char *, const char *, const char *, int, int, const int *)
Definition: keys.c:125
int Rast3d_write_ints(int, int, const int *, int)
Definition: intio.c:9
void Rast3d_get_window_value(RASTER3D_Map *, double, double, double, void *, int)
Returns in value the value of the map which corresponds to window coordinates (north,...
Definition: getvalue.c:95
void Rast3d_make_aligned_volume_file(void *, const char *, double, double, double, double, double, double, int, int, int)
Definition: volume.c:194
void Rast3d_coord2tile_coord(RASTER3D_Map *, int, int, int, int *, int *, int *, int *, int *, int *)
Converts cell-coordinates (x, y, z) into tile-coordinates (xTile, yTile, zTile) and the coordinate of...
Definition: tilemath.c:129
int Rast3d_length(int)
Definition: raster3d/misc.c:75
void Rast3d_set_window_params(void)
Definition: param.c:121
void Rast3d_get_volume(void *, double, double, double, double, double, double, double, double, double, double, double, double, int, int, int, void *, int)
Definition: volume.c:134
void Rast3d_get_compression_mode(int *, int *)
Gets compression mode.
Definition: defaults.c:127
int Rast3d_lock_tile(RASTER3D_Map *, int)
Locks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles ...
Definition: tileread.c:262
int Rast3d_extern_length(int)
Definition: raster3d/misc.c:87
void Rast3d_get_window_map(RASTER3D_Map *, double *, double *, double *, double *, double *, double *)
Definition: headerinfo.c:88
int Rast3d_cache_remove_elt(RASTER3D_cache *, int)
Definition: cache1.c:410
int Rast3d_range_init(RASTER3D_Map *)
void * Rast3d_open_new_opt_tile_size(const char *, int, RASTER3D_Region *, int, int)
Opens new g3d-file with name in the current mapset. This method tries to compute optimal tile size ba...
Definition: open2.c:94
void * Rast3d_open_cell_old_no_header(const char *, const char *)
Definition: raster3d/open.c:12
int Rast3d_cache_unlock_all(RASTER3D_cache *)
Definition: cache1.c:324
const char * Rast3d_get_unit(RASTER3D_Map *map)
Return the data unit definition of map.
Definition: headerinfo.c:223
int Rast3d_end_cycle(RASTER3D_Map *)
Ends a cycle.
Definition: tileread.c:434
DCELL Rast3d_mask_match_d_interval(DCELL, d_Interval *)
Definition: maskfn.c:58
void Rast3d_compare_files(const char *, const char *, const char *, const char *)
Compares the cell-values of file f1 in mapset mapset1 and file f2 in mapset mapset2....
Definition: filecompare.c:377
int Rast3d_tile_load(RASTER3D_Map *, int)
Same functionality as Rast3d_get_tile_ptr() but does not return the pointer.
Definition: tileio.c:123
void Rast3d_cache_set_remove_fun(RASTER3D_cache *, write_fn *, void *)
void Rast3d_set_vertical_unit(RASTER3D_Map *map, const char *)
set Vertical unit from string
Definition: headerinfo.c:207
int Rast3d_read_window(RASTER3D_Region *, const char *)
Reads window from the file specified by windowName. The name is converted by the rules defined in win...
Definition: windowio.c:133
void Rast3d_region_copy(RASTER3D_Region *, RASTER3D_Region *)
Copies the values of regionSrc into regionDst.
Definition: region.c:203
void Rast3d_cache_hash_load_name(Rast3d_cache_hash *, int, int)
Definition: cachehash.c:93
void int Rast3d_is_xdr_null_num(const void *, int)
Definition: fpxdr.c:13
int Rast3d_tile_in_range(RASTER3D_Map *, int, int, int)
Returns 1 if tile-coordinate (x, y, z) is a coordinate inside tile cube. Returns 0 otherwise.
Definition: tilemath.c:225
int Rast3d_cache_unlock(RASTER3D_cache *, int)
Definition: cache1.c:303
int Rast3d_range_write(RASTER3D_Map *)
Writes the range which is stored in the range structure of map. (This function is invoked automatical...
int Rast3d_begin_cycle(RASTER3D_Map *)
Starts a new cycle.
Definition: tileread.c:411
int Rast3d_put_double(RASTER3D_Map *, int, int, int, double)
Is equivalent to Rast3d_put_value (map, x, y, z, &value, DCELL_TYPE).
Definition: putvalue.c:53
void Rast3d_init_defaults(void)
Initializes the default values described in RASTER3D Defaults. Applications have to use this function...
Definition: defaults.c:294
void Rast3d_get_region_map(RASTER3D_Map *, double *, double *, double *, double *, double *, double *)
Returns the size of the region.
Definition: headerinfo.c:74
int Rast3d_read_tile(RASTER3D_Map *, int, void *, int)
Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must ...
Definition: tileread.c:151
int Rast3d_copy_to_xdr(const void *, int)
Definition: fpxdr.c:141
void * Rast3d_open_new_param(const char *, int, int, RASTER3D_Region *, int, int, int, int, int, int)
Opens new g3d-file with name in the current mapset. Tiles are stored in memory with typeIntern which ...
Definition: open2.c:39
void Rast3d_change_type(void *, const char *)
Makes a copy of map with name nameOut in which the cells are of type FCELL_TYPE if they are DCELL_TYP...
Definition: changetype.c:22
void * Rast3d_open_cell_new(const char *, int, int, RASTER3D_Region *)
Opens new g3d-file with name in the current mapset. Tiles are stored in memory with type which must b...
int Rast3d_copy_from_xdr(int, void *)
Definition: fpxdr.c:223
void Rast3d_use_window_params(void)
Writes window to the file specified by windowName. The name is converted by the rules defined in wind...
Definition: windowio.c:265
void * Rast3d_alloc_tiles_type(RASTER3D_Map *, int, int)
Allocates a vector of nofTiles tiles with the same dimensions as the tiles of map and large enough to...
Definition: tilealloc.c:23
int Rast3d_compute_clipped_tile_dimensions(RASTER3D_Map *, int, int *, int *, int *, int *, int *, int *)
Computes the dimensions of the tile when clipped to fit the region of map. The clipped dimensions are...
Definition: tilemath.c:253
int Rast3d_key_get_double(struct Key_Value *, const char *, double *)
Definition: keys.c:27
int Rast3d_cache_lock_all(RASTER3D_cache *)
Definition: cache1.c:341
int Rast3d_read_tile_float(RASTER3D_Map *, int, void *)
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE).
Definition: tileread.c:210
void Rast3d_error(const char *,...) __attribute__((format(printf
int Rast3d_get_cache_size(void)
get cache size
Definition: defaults.c:160
int Rast3d_get_standard3d_params(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *)
Definition: param.c:54
int Rast3d_write_tile_double(RASTER3D_Map *, int, const void *)
Is equivalent to Rast3d_write_tile (map, tileIndex, tile, DCELL_TYPE).
Definition: tilewrite.c:220
int Rast3d_fpcompress_read_xdr_nums(int, char *, int, int, int, char *, int)
Definition: fpcompress.c:716
double Rast3d_get_double(RASTER3D_Map *, int, int, int)
Is equivalent to Rast3d_get_value (map, x, y, z, &value, DCELL_TYPE); return value.
Definition: getvalue.c:68
void Rast3d_set_compression_mode(int, int)
set compression mode
Definition: defaults.c:94
int Rast3d_write_tile(RASTER3D_Map *, int, const void *, int)
Writes tile with index tileIndex to the file corresponding to map. It is assumed that the cells in ti...
Definition: tilewrite.c:126
void Rast3d_set_window(RASTER3D_Region *)
Sets the default window used for every map opened later in the program. Can be used multiple times in...
void Rast3d_copy_double2Float(const double *, int, float *, int, int)
Definition: raster3d/misc.c:36
void Rast3d_fpcompress_print_binary(char *, int)
Definition: fpcompress.c:16
void Rast3d_incorporate2d_region(struct Cell_head *, RASTER3D_Region *)
Replaces the 2d portion of region3d with the values stored in region2d.
Definition: region.c:86
int Rast3d_read_ints(int, int, int *, int)
Definition: intio.c:52
int Rast3d_mask_reopen(int)
This function should be used to adjust the cache size used for the 3d-mask. First the open 3d-mask is...
Definition: mask.c:137
int Rast3d_key_set_double(struct Key_Value *, const char *, const double *)
Definition: keys.c:104
int Rast3d_flush_tiles_in_cube(RASTER3D_Map *, int, int, int, int, int, int)
Writes those tiles for which every cell has coordinate contained in the axis-parallel cube defined by...
Definition: tilewrite.c:344
int Rast3d_cache_hash_name2index(Rast3d_cache_hash *, int)
Definition: cachehash.c:108
int Rast3d_long_encode(long *, unsigned char *, int)
Definition: long.c:5
int Rast3d_key_get_value(struct Key_Value *, const char *, char *, char *, int, int, int *)
Definition: keys.c:66
void Rast3d_set_cache_size(int)
set cache size
Definition: defaults.c:144
int Rast3d_is_xdr_null_float(const float *)
Definition: fpxdr.c:24
int Rast3d__remove_tile(RASTER3D_Map *, int)
Definition: tileio.c:135
void Rast3d_set_xdr_null_float(float *)
Definition: fpxdr.c:56
void Rast3d_get_window(RASTER3D_Region *)
Stores the current default window in window.
void Rast3d_fatal_error(const char *,...) __attribute__((format(printf
int Rast3d_close(RASTER3D_Map *)
Close 3D raster map files.
int Rast3d_cache_remove_all(RASTER3D_cache *)
Definition: cache1.c:434
int Rast3d_init_copy_to_xdr(RASTER3D_Map *, int)
Definition: fpxdr.c:102
void Rast3d_location2coord2(RASTER3D_Region *, double, double, double, int *, int *, int *)
Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z). This function calls R...
Definition: region.c:341
int Rast3d_remove_color(const char *)
Removes the primary and/or secondary color file.
float Rast3d_get_float(RASTER3D_Map *, int, int, int)
Is equivalent to Rast3d_get_value (map, x, y, z, &value, FCELL_TYPE); return value.
Definition: getvalue.c:44
void Rast3d_rle_decode(char *, char *, int, int, int *, int *)
Definition: rle.c:236
int Rast3d_is_masked(RASTER3D_Map *, int, int, int)
Returns 1 if the cell with cell-coordinates (x, y, z) is masked out. Returns 0 otherwise.
Definition: mask.c:175
void Rast3d_coord2tile_index(RASTER3D_Map *, int, int, int, int *, int *)
Converts cell-coordinates (x, y, z) into tileIndex and the offset of the cell within the tile.
Definition: tilemath.c:158
void Rast3d_coord2location(RASTER3D_Region *, double, double, double, double *, double *, double *)
Converts cell-coordinates (x, y, z) into region-coordinates (north, east, top).
Definition: region.c:386
int Rast3d_cache_get_elt(RASTER3D_cache *, int, void *)
Definition: cache1.c:530
void Rast3d_range_min_max(RASTER3D_Map *, double *, double *)
Returns in min and max the minimum and maximum values of the range.
void Rast3d_fpcompress_dissect_xdr_double(unsigned char *)
Definition: fpcompress.c:31
void * Rast3d_cache_elt_ptr(RASTER3D_cache *, int)
Definition: cache1.c:468
double Rast3d_get_double_region(RASTER3D_Map *, int, int, int)
Is equivalent to Rast3d_get_value_region (map, x, y, z, &value, DCELL_TYPE); return value.
Definition: getvalue.c:208
int Rast3d_fpcompress_write_xdr_nums(int, char *, int, int, char *, int)
Definition: fpcompress.c:685
int Rast3d_init_cache(RASTER3D_Map *, int)
Definition: cache.c:221
void * Rast3d_malloc(int)
Same as malloc (nBytes), except that in case of error Rast3d_error() is invoked.
void Rast3d_set_window_map(RASTER3D_Map *, RASTER3D_Region *)
Sets the window for map to window. Can be used multiple times for the same map.
int Rast3d_mask_is_on(RASTER3D_Map *)
Returns 1 if the mask for map is turned on. Returns 0 otherwise.
Definition: mask.c:360
int Rast3d_flush_tile_cube(RASTER3D_Map *, int, int, int, int, int, int)
Writes the tiles with tile-coordinates contained in the axis-parallel cube with vertices (xMin,...
Definition: tilewrite.c:298
double DCELL
Definition: gis.h:626
int write_fn(int, const void *, void *)
Definition: raster3d.h:254
int read_fn(int, void *, void *)
Definition: raster3d.h:255
2D/3D raster map header (used also for region)
Definition: gis.h:437
Definition: gis.h:683
Raster history info (metadata)
Definition: raster.h:172
Definition: gis.h:525