GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
raster3d.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void Rast3d_cache_reset (RASTER3D_cache *)
 
void Rast3d_cache_dispose (RASTER3D_cache *)
 
voidRast3d_cache_new (int, int, int, write_fn *, void *, read_fn *, void *)
 
void Rast3d_cache_set_remove_fun (RASTER3D_cache *, write_fn *, void *)
 
void Rast3d_cache_set_load_fun (RASTER3D_cache *, read_fn *, void *)
 
voidRast3d_cache_new_read (int, int, int, read_fn *, void *)
 
int Rast3d_cache_lock (RASTER3D_cache *, int)
 
void Rast3d_cache_lock_intern (RASTER3D_cache *, int)
 
int Rast3d_cache_unlock (RASTER3D_cache *, int)
 
int Rast3d_cache_unlock_all (RASTER3D_cache *)
 
int Rast3d_cache_lock_all (RASTER3D_cache *)
 
void Rast3d_cache_autolock_on (RASTER3D_cache *)
 
void Rast3d_cache_autolock_off (RASTER3D_cache *)
 
void Rast3d_cache_set_min_unlock (RASTER3D_cache *, int)
 
int Rast3d_cache_remove_elt (RASTER3D_cache *, int)
 
int Rast3d_cache_flush (RASTER3D_cache *, int)
 
int Rast3d_cache_remove_all (RASTER3D_cache *)
 
int Rast3d_cache_flush_all (RASTER3D_cache *)
 
voidRast3d_cache_elt_ptr (RASTER3D_cache *, int)
 
int Rast3d_cache_load (RASTER3D_cache *, int)
 
int Rast3d_cache_get_elt (RASTER3D_cache *, int, void *)
 
int Rast3d_cache_put_elt (RASTER3D_cache *, int, const void *)
 
void Rast3d_cache_hash_reset (Rast3d_cache_hash *)
 
void Rast3d_cache_hash_dispose (Rast3d_cache_hash *)
 
voidRast3d_cache_hash_new (int)
 
void Rast3d_cache_hash_remove_name (Rast3d_cache_hash *, int)
 
void Rast3d_cache_hash_load_name (Rast3d_cache_hash *, int, int)
 
int Rast3d_cache_hash_name2index (Rast3d_cache_hash *, int)
 
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 in changeprecision.c.
 
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_TYPE in map, and in DCELL_TYPE otherwise. The source code can be found in changetype.c.
 
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. The values are compared up to precision. Terminates in error if the files don't match. This function uses the more advanced features of the cache. The source code can be found in filecompare.c.
 
void Rast3d_filename (char *, const char *, const char *, const char *)
 
void Rast3d_fpcompress_print_binary (char *, int)
 
void Rast3d_fpcompress_dissect_xdr_double (unsigned char *)
 
int Rast3d_fpcompress_write_xdr_nums (int, char *, int, int, char *, int)
 
int Rast3d_fpcompress_read_xdr_nums (int, char *, int, int, int, char *, int)
 
voidRast3d_malloc (int)
 Same as malloc (nBytes), except that in case of error Rast3d_error() is invoked.
 
voidRast3d_realloc (void *, int)
 Same as realloc (ptr, nBytes), except that in case of error Rast3d_error() is invoked.
 
void Rast3d_free (void *)
 Same as free (ptr).
 
int Rast3d_init_cache (RASTER3D_Map *, int)
 
int Rast3d_dispose_cache (RASTER3D_Map *)
 
int Rast3d_flush_all_tiles (RASTER3D_Map *)
 
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 current mapset. See Rast_write_cats (Raster_Category_File) for details and return values.
 
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. See Rast_read_cats (Raster_Category_File) for details and return values.
 
int Rast3d_close (RASTER3D_Map *)
 Close 3D raster map files.
 
int Rast3d_remove_color (const char *)
 Removes the primary and/or secondary color file.
 
int Rast3d_read_colors (const char *, const char *, struct Colors *)
 Reads color file for map name in mapset into the Colors structure.
 
int Rast3d_write_colors (const char *, const char *, struct Colors *)
 Writes the colors for map name in mapset into a color file.
 
void Rast3d_set_compression_mode (int, int)
 set compression mode
 
void Rast3d_get_compression_mode (int *, int *)
 Gets compression mode.
 
void Rast3d_set_cache_size (int)
 set cache size
 
int Rast3d_get_cache_size (void)
 get cache size
 
void Rast3d_set_cache_limit (int)
 Set cache limit.
 
int Rast3d_get_cache_limit (void)
 Get cache limit.
 
void Rast3d_set_file_type (int)
 set G3d file type
 
int Rast3d_get_file_type (void)
 get G3d file type
 
void Rast3d_set_tile_dimension (int, int, int)
 set Tile Dimension
 
void Rast3d_get_tile_dimension (int *, int *, int *)
 get Tile Dimension
 
void Rast3d_set_error_fun (void(*)(const char *))
 set error function
 
void Rast3d_init_defaults (void)
 Initializes the default values described in RASTER3D Defaults. Applications have to use this function only if they need to query the default values before the first file (either old or new) has been opened.
 
int Rast3d_write_doubles (int, int, const double *, int)
 
int Rast3d_read_doubles (int, int, double *, int)
 
void Rast3d_skip_error (const char *)
 This function ignores the error.
 
void Rast3d_print_error (const char *)
 Prints error message.
 
void Rast3d_fatal_error (const char *,...) __attribute__((format(printf
 
void __attribute__ ((noreturn))
 
void Rast3d_fatal_error_noargs (const char *) __attribute__((noreturn))
 
void Rast3d_error (const char *,...) __attribute__((format(printf
 
void int Rast3d_is_xdr_null_num (const void *, int)
 
int Rast3d_is_xdr_null_float (const float *)
 
int Rast3d_is_xdr_null_double (const double *)
 
void Rast3d_set_xdr_null_num (void *, int)
 
void Rast3d_set_xdr_null_double (double *)
 
void Rast3d_set_xdr_null_float (float *)
 
int Rast3d_init_fp_xdr (RASTER3D_Map *, int)
 
int Rast3d_init_copy_to_xdr (RASTER3D_Map *, int)
 
int Rast3d_copy_to_xdr (const void *, int)
 
int Rast3d_init_copy_from_xdr (RASTER3D_Map *, int)
 
int Rast3d_copy_from_xdr (int, void *)
 
void Rast3d_gradient_double (RASTER3D_Array_double *, double *, RASTER3D_Array_double *, RASTER3D_Array_double *, RASTER3D_Array_double *)
 Gradient computation.
 
int Rast3d_write_history (const char *, struct History *)
 write raster3d History file
 
int Rast3d_read_history (const char *, const char *, struct History *)
 read raster3d History file
 
int Rast3d_write_ints (int, int, const int *, int)
 
int Rast3d_read_ints (int, int, int *, int)
 
int Rast3d_key_get_int (struct Key_Value *, const char *, int *)
 
int Rast3d_key_get_double (struct Key_Value *, const char *, double *)
 
int Rast3d_key_get_string (struct Key_Value *, const char *, char **)
 
int Rast3d_key_get_value (struct Key_Value *, const char *, char *, char *, int, int, int *)
 
int Rast3d_key_set_int (struct Key_Value *, const char *, const int *)
 
int Rast3d_key_set_double (struct Key_Value *, const char *, const double *)
 
int Rast3d_key_set_string (struct Key_Value *, const char *, char *const *)
 
int Rast3d_key_set_value (struct Key_Value *, const char *, const char *, const char *, int, int, const int *)
 
int Rast3d_long_encode (long *, unsigned char *, int)
 
void Rast3d_long_decode (unsigned char *, long *, int, int)
 
void Rast3d_make_mapset_map_directory (const char *)
 
int Rast3d_mask_close (void)
 
int Rast3d_mask_file_exists (void)
 Returns 1 if the 3d mask file exists.
 
int Rast3d_mask_open_old (void)
 
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 closed and then opened again with a cache size as specified with cache.
 
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.
 
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. Does nothing otherwise. value is assumed to be oftype.
 
void Rast3d_mask_float (RASTER3D_Map *, int, int, int, float *)
 Same as Rast3d_mask_num (x, y, z, value, FCELL_TYPE).
 
void Rast3d_mask_double (RASTER3D_Map *, int, int, int, double *)
 Same as Rast3d_mask_num (x, y, z, value, DCELL_TYPE).
 
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-values. Does not change the remaining values. The values are assumed to be of type. Whether replacement is performed or not only depends on location of the cells of the tile and not on the status of the mask for map (i.e. turned on or off).
 
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 result might be inconsistent cell-values.
 
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 been read since the result might be inconsistent cell-values.
 
int Rast3d_mask_is_on (RASTER3D_Map *)
 Returns 1 if the mask for map is turned on. Returns 0 otherwise.
 
int Rast3d_mask_is_off (RASTER3D_Map *)
 Returns 1 if the mask for map is turned off. Returns 0 otherwise.
 
const charRast3d_mask_file (void)
 Returns the name of the 3d mask file.
 
int Rast3d_mask_map_exists (void)
 Returns 1 if the 3d mask is loaded.
 
int Rast3d_mask_d_select (DCELL *, d_Mask *)
 
DCELL Rast3d_mask_match_d_interval (DCELL, d_Interval *)
 
void Rast3d_parse_vallist (char **, d_Mask **)
 
int Rast3d_g3d_type2cell_type (int)
 
void Rast3d_copy_float2Double (const float *, int, double *, int, int)
 
void Rast3d_copy_double2Float (const double *, int, float *, int, int)
 
void Rast3d_copy_values (const void *, int, int, void *, int, int, int)
 
int Rast3d_length (int)
 
int Rast3d_extern_length (int)
 
int Rast3d_is_null_value_num (const void *, int)
 
void Rast3d_set_null_value (void *, int, int)
 Fills the vector pointed to by c with nofElts NULL-values of type.
 
voidRast3d_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 must be one of FCELL_TYPE, DCELL_TYPE, or RASTER3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region. The map is created using the type which must be of FCELL_TYPE or DCELL_TYPE. The methods for compression can be specified LZW or RLE. The digits of the floating point mantissa can be specified. In case of FCELL_TYPE 0-23 and 0-52 in case of DCELL_TYPE. The number cells in X, Y and Z direction defines the size of each tile. Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
 
voidRast3d_open_cell_old_no_header (const char *, const char *)
 
voidRast3d_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 FCELL_TYPE, DCELL_TYPE, or RASTER3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. window sets the window-region for the map. It is either a pointer to a window structure or RASTER3D_DEFAULT_WINDOW, which uses the window stored at initialization time or set via Rast3d_set_window () (cf.{g3d:G3d.setWindow}). To modify the window for the map after it has already been opened use Rast3d_set_window_map () (cf.{g3d:G3d.setWindowMap}). Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
 
voidRast3d_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 be one of FCELL_TYPE, DCELL_TYPE, or RASTER3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region. Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
 
voidRast3d_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 based on the number of rows, cols and depths and the maximum allowed tile size in KB. Tiles are stored in memory using RASTER3D_TILE_SAME_AS_FILE method. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region. The map is created using the type which must be of FCELL_TYPE or DCELL_TYPE. Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
 
void Rast3d_set_standard3d_input_params (void)
 Initializes a parameter structure for the subset of command line arguments which lets the user overwrite the default properties of the new file. Applications are encouraged to use this function in order to provide a uniform style. The command line arguments provided are the type of the cell values, the precision, the properties of the compression, and the dimension of the tiles (tiledimension). Every of these values defaults to the value described in RASTER3D Defaults. This function has to be used in conjunction with Rast3d_getStandard3dInputParams() (cf.{g3d:G3d.getStandard3dInputParams}).
 
int Rast3d_get_standard3d_params (int *, int *, int *, int *, int *, int *, int *, int *, int *, int *)
 
void Rast3d_set_window_params (void)
 
charRast3d_get_window_params (void)
 
void Rast3d_range_update_from_tile (RASTER3D_Map *, const void *, int, int, int, int, int, int, int, int)
 
int Rast3d_read_range (const char *, const char *, struct FPRange *)
 
int Rast3d_range_load (RASTER3D_Map *)
 Loads the range into the range structure of map.
 
void Rast3d_range_min_max (RASTER3D_Map *, double *, double *)
 Returns in min and max the minimum and maximum values of the range.
 
int Rast3d_range_write (RASTER3D_Map *)
 Writes the range which is stored in the range structure of map. (This function is invoked automatically when a new file is closed).
 
int Rast3d_range_init (RASTER3D_Map *)
 
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, east, top).
 
void Rast3d_adjust_region (RASTER3D_Region *)
 Computes an adjusts the resolutions in the region structure from the region boundaries and number of cells per dimension.
 
void Rast3d_region_copy (RASTER3D_Region *, RASTER3D_Region *)
 Copies the values of regionSrc into regionDst.
 
void Rast3d_incorporate2d_region (struct Cell_head *, RASTER3D_Region *)
 Replaces the 2d portion of region3d with the values stored in region2d.
 
void Rast3d_region_from_to_cell_head (struct Cell_head *, RASTER3D_Region *)
 Replaces the 2d portion of region3d with the values stored in region2d.
 
void Rast3d_adjust_region_res (RASTER3D_Region *)
 Computes an adjusts the number of cells per dimension in the region structure from the region boundaries and resolutions.
 
void Rast3d_extract2d_region (RASTER3D_Region *, struct Cell_head *)
 Returns in region2d the 2d portion of region3d.
 
void Rast3d_region_to_cell_head (RASTER3D_Region *, struct Cell_head *)
 Returns in region2d the 2d portion of region3d.
 
int Rast3d_read_region_map (const char *, const char *, RASTER3D_Region *)
 
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.
 
void Rast3d_location2coord (RASTER3D_Region *, double, double, double, int *, int *, int *)
 Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z).
 
void Rast3d_location2coord_double (RASTER3D_Region *, double, double, double, double *, double *, double *)
 Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z).
 
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 Rast3d_fatal_error in case location is not in window.
 
void Rast3d_coord2location (RASTER3D_Region *, double, double, double, double *, double *, double *)
 Converts cell-coordinates (x, y, z) into region-coordinates (north, east, top).
 
void Rast3d_nearest_neighbor (RASTER3D_Map *, int, int, int, void *, int)
 The default resampling function which uses nearest neighbor resampling. This method converts the window coordinates x, y, and z into region coordinates and returned the nearest neighbor.
 
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}). This function is defined as follows:
 
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.
 
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}).
 
void Rast3d_get_volume_a (void *, double[2][2][2][3], int, int, int, void *, int)
 
void Rast3d_get_volume (void *, double, double, double, double, double, double, double, double, double, double, double, double, int, int, int, void *, int)
 
void Rast3d_get_aligned_volume (void *, double, double, double, double, double, double, int, int, int, void *, int)
 
void Rast3d_make_aligned_volume_file (void *, const char *, double, double, double, double, double, double, int, int, int)
 
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, z). The value returned is of type. This function invokes a fatal error if an error occurs.
 
float Rast3d_get_float (RASTER3D_Map *, int, int, int)
 Is equivalent to Rast3d_get_value (map, x, y, z, &value, FCELL_TYPE); return value.
 
double Rast3d_get_double (RASTER3D_Map *, int, int, int)
 Is equivalent to Rast3d_get_value (map, x, y, z, &value, DCELL_TYPE); return value.
 
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, east, top). The value is resampled using the resampling function specified for map. The value is of type.
 
RASTER3D_RegionRast3d_window_ptr (void)
 
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 the same program.
 
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.
 
void Rast3d_get_window (RASTER3D_Region *)
 Stores the current default window in window.
 
void Rast3d_use_window_params (void)
 Writes window to the file specified by windowName. The name is converted by the rules defined in window defaults. A NULL pointer indicates the WIND3 file in the current mapset.
 
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 window defaults. A NULL pointer indicates the WIND3 file in the current mapset.
 
void Rast3d_get_block_nocache (RASTER3D_Map *, int, int, int, int, int, int, void *, int)
 
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, y0 + ny - 1, z0 + nz - 1) into block. The cell-values in block are of type. The source code can be found in getblock.c.
 
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 *)
 
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_rewrite_header (RASTER3D_Map *map)
 
int Rast3d_cache_size_encode (int, int)
 Returns a number which encodes multiplicity n of cacheCode. This value can be used to specify the size of the cache. If cacheCode is the size (in tiles) of the cache the function returns cacheCode * n. If cacheCode is RASTER3D_USE_CACHE_DEFAULT the function returns RASTER3D_USE_CACHE_DEFAULT. If cacheCode is RASTER3D_USE_CACHE_??? the function returns a value encoding RASTER3D_USE_CACHE_??? and n. Here RASTER3D_USE_CACHE_??? is one of RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, or RASTER3D_USE_CACHE_XYZ, where e.g. RASTER3D_USE_CACHE_X specifies that the cache should store as many tiles as there exist in one row along the x-axis of the tile cube, and RASTER3D_USE_CACHE_XY specifies that the cache should store as many tiles as there exist in one slice of the tile cube with constant Z coordinate.
 
int Rast3d__compute_cache_size (RASTER3D_Map *, int)
 
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)
 
void Rast3d_get_coords_map (RASTER3D_Map *, int *, int *, int *)
 Returns the size of the region of map in cells.
 
void Rast3d_get_coords_map_window (RASTER3D_Map *, int *, int *, int *)
 
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 tiles.
 
void Rast3d_get_region_map (RASTER3D_Map *, double *, double *, double *, double *, double *, double *)
 Returns the size of the region.
 
void Rast3d_get_window_map (RASTER3D_Map *, double *, double *, double *, double *, double *, double *)
 
void Rast3d_get_tile_dimensions_map (RASTER3D_Map *, int *, int *, int *)
 Returns the tile dimensions used for map.
 
int Rast3d_tile_type_map (RASTER3D_Map *)
 Returns the type in which tiles of map are stored in memory.
 
int Rast3d_file_type_map (RASTER3D_Map *)
 Returns the type with which tiles of map are stored on file.
 
int Rast3d_tile_precision_map (RASTER3D_Map *)
 Returns the precision used to store map.
 
int Rast3d_tile_use_cache_map (RASTER3D_Map *)
 Returns 1 if map uses cache, returns 0 otherwise.
 
void Rast3d_print_header (RASTER3D_Map *)
 Prints the header information of map.
 
void Rast3d_get_region_struct_map (RASTER3D_Map *, RASTER3D_Region *)
 Returns in region the region of map.
 
const charRast3d_get_unit (RASTER3D_Map *map)
 Return the data unit definition of map.
 
int Rast3d_get_vertical_unit2 (RASTER3D_Map *map)
 Returns the vertical unit of map as integer. Units are defined in gis.h.
 
const charRast3d_get_vertical_unit (RASTER3D_Map *map)
 Return the name of the unit of map. Units are defined in gis.h.
 
void Rast3d_set_unit (RASTER3D_Map *map, const char *)
 Set the data unit defintiong.
 
void Rast3d_set_vertical_unit (RASTER3D_Map *map, const char *)
 set Vertical unit from string
 
void Rast3d_set_vertical_unit2 (RASTER3D_Map *map, int)
 set Vertical unit from integer value defined in gis.h (U_METERS, ...)
 
int Rast3d_flush_index (RASTER3D_Map *)
 
int Rast3d_init_index (RASTER3D_Map *, int)
 
void Rast3d_retile (void *, const char *, int, int, int)
 Makes a copy of map with name nameOut which has tile dimensions tileX, tileY, tileZ. The source code can be found in retile.c.
 
int Rast3d_rle_count_only (char *, int, int)
 
void Rast3d_rle_encode (char *, char *, int, int)
 
void Rast3d_rle_decode (char *, char *, int, int, int *, int *)
 
voidRast3d_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 store cell-values of type.
 
voidRast3d_alloc_tiles (RASTER3D_Map *, int)
 Is equivalent to Rast3d_alloc_tiles_type (map, nofTiles, Rast3d_file_type_map (map)).
 
void Rast3d_free_tiles (void *)
 Is equivalent to Rast3d_free (tiles);
 
voidRast3d_get_tile_ptr (RASTER3D_Map *, int)
 This function returns a pointer to a tile which contains the data for the tile with index tileIndex. The type of the data stored in the tile depends on the type specified at the initialization time of map. The functionality is different depending on whether map is old or new and depending on the cache-mode of map.

 
int Rast3d_tile_load (RASTER3D_Map *, int)
 Same functionality as Rast3d_get_tile_ptr() but does not return the pointer.
 
int Rast3d__remove_tile (RASTER3D_Map *, int)
 
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.
 
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.
 
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 of type. Here region means the coordinate in the cube of data in the file, i.e. ignoring geographic coordinates. In case the region coordinates are out of bounds, the Null value will be returned. This function invokes a fatal error if an error occurs.
 
void Rast3d_compute_optimal_tile_dimension (RASTER3D_Region *, int, int *, int *, int *, int)
 Compute the optimal tile size.
 
void Rast3d_tile_index2tile (RASTER3D_Map *, int, int *, int *, int *)
 Converts index tileIndex into tile-coordinates (xTile, yTile, zTile).
 
int Rast3d_tile2tile_index (RASTER3D_Map *, int, int, int)
 Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).
 
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-coordinates (xTile, yTile, zTile).
 
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.
 
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 the cell (xOffs, yOffs, zOffs) within the tile.
 
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.
 
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.
 
int Rast3d_tile_index_in_range (RASTER3D_Map *, int)
 Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise.
 
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.
 
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 returned in rows, cols, depths. The complement is returned in xRedundant, yRedundant, and zRedundant. This function returns the number of cells in the clipped tile.
 
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 of type.
 
void Rast3d_set_null_tile (RASTER3D_Map *, void *)
 Is equivalent to Rast3d_set_null_tile_type (map, tile, Rast3d_file_type_map (map)).
 
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 be one of FCELL_TYPE and DCELL_TYPE. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index tile is filled with NULL-values.
 
int Rast3d_read_tile_float (RASTER3D_Map *, int, void *)
 Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE).
 
int Rast3d_read_tile_double (RASTER3D_Map *, int, void *)
 Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE).
 
int Rast3d_lock_tile (RASTER3D_Map *, int)
 Locks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles are unlocked, the lock request is ignored.
 
int Rast3d_unlock_tile (RASTER3D_Map *, int)
 Unlocks tile with tileIndex.
 
int Rast3d_unlock_all (RASTER3D_Map *)
 Unlocks every tile in cache of map.
 
void Rast3d_autolock_on (RASTER3D_Map *)
 Turns autolock mode on.
 
void Rast3d_autolock_off (RASTER3D_Map *)
 Turns autolock mode Off.
 
void Rast3d_min_unlocked (RASTER3D_Map *, int)
 Sets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination with Rast3d_unlock_all () in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles. minUnlocked must be one of RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode() (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which explicitly specifies the number of tiles.
 
int Rast3d_begin_cycle (RASTER3D_Map *)
 Starts a new cycle.
 
int Rast3d_end_cycle (RASTER3D_Map *)
 Ends a cycle.
 
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 tile are of type which must be one of FCELL_TYPE and DCELL_TYPE. The actual type used to write the tile depends on the type specified at the time when map is initialized. A tile can only be written once. Subsequent attempts to write the same tile are ignored.
 
int Rast3d_write_tile_float (RASTER3D_Map *, int, const void *)
 Is equivalent to Rast3d_write_tile (map, tileIndex, tile, FCELL_TYPE).
 
int Rast3d_write_tile_double (RASTER3D_Map *, int, const void *)
 Is equivalent to Rast3d_write_tile (map, tileIndex, tile, DCELL_TYPE).
 
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 (in non-cache mode the buffer provided by the map-structure is written). If this tile has already been written before the write request is ignored. If the tile was never referred to before the invocation of Rast3d_flush_tile, a tile filled with NULL-values is written.
 
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, yMin, zMin) and (xMax, yMax, zMax). Tiles which are not stored in the cache are written as NULL-tiles. Write attempts for tiles which have already been written earlier are ignored.
 
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 the vertices with cell-coordinates (xMin, yMin, zMin) and (xMax, yMax, zMax). Tiles which are not stored in the cache are written as NULL-tiles. Write attempts for tiles which have already been written earlier are ignored.
 
int Rast3d_put_float (RASTER3D_Map *, int, int, int, float)
 Is equivalent to Rast3d_put_value (map, x, y, z, &value, FCELL_TYPE).
 
int Rast3d_put_double (RASTER3D_Map *, int, int, int, double)
 Is equivalent to Rast3d_put_value (map, x, y, z, &value, DCELL_TYPE).
 
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.e. typeIntern) this function writes the value into the tile buffer corresponding to cell-coordinate (x, y, z).
 
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 slices.
 

Function Documentation

◆ __attribute__()

void __attribute__ ( (noreturn )

◆ Rast3d__compute_cache_size()

◆ Rast3d__remove_tile()

int Rast3d__remove_tile ( RASTER3D_Map map,
int  tileIndex 
)

◆ Rast3d_adjust_region()

void Rast3d_adjust_region ( RASTER3D_Region region)

Computes an adjusts the resolutions in the region structure from the region boundaries and number of cells per dimension.

Parameters
region
Returns
void

Definition at line 144 of file region.c.

References RASTER3D_Region::bottom, RASTER3D_Region::depths, G_adjust_Cell_head3(), Rast3d_fatal_error(), Rast3d_region_from_to_cell_head(), Rast3d_region_to_cell_head(), RASTER3D_Region::tb_res, and RASTER3D_Region::top.

Referenced by Rast3d_fill_header(), Rast3d_open_cell_new(), Rast3d_open_cell_old(), Rast3d_set_window(), and Rast3d_set_window_map().

◆ Rast3d_adjust_region_res()

void Rast3d_adjust_region_res ( RASTER3D_Region region)

Computes an adjusts the number of cells per dimension in the region structure from the region boundaries and resolutions.

Parameters
region
Returns
void

Definition at line 168 of file region.c.

References RASTER3D_Region::bottom, RASTER3D_Region::depths, G_adjust_Cell_head3(), Rast3d_fatal_error(), Rast3d_region_from_to_cell_head(), Rast3d_region_to_cell_head(), RASTER3D_Region::tb_res, and RASTER3D_Region::top.

◆ Rast3d_alloc_tiles()

void * Rast3d_alloc_tiles ( RASTER3D_Map map,
int  nofTiles 
)

Is equivalent to Rast3d_alloc_tiles_type (map, nofTiles, Rast3d_file_type_map (map)).

Parameters
map
nofTiles
Returns
void *

Definition at line 47 of file tilealloc.c.

References NULL, Rast3d_alloc_tiles_type(), Rast3d_error(), and RASTER3D_Map::typeIntern.

Referenced by Rast3d_change_precision(), and Rast3d_change_type().

◆ Rast3d_alloc_tiles_type()

void * Rast3d_alloc_tiles_type ( RASTER3D_Map map,
int  nofTiles,
int  type 
)

Allocates a vector of nofTiles tiles with the same dimensions as the tiles of map and large enough to store cell-values of type.

Parameters
map
nofTiles
type
Returns
void * : a pointer to the vector ... if successful, NULL ... otherwise.

Definition at line 22 of file tilealloc.c.

References NULL, Rast3d_error(), Rast3d_length(), Rast3d_malloc(), and RASTER3D_Map::tileSize.

Referenced by Rast3d_alloc_tiles(), and Rast3d_get_block_nocache().

◆ Rast3d_autolock_off()

void Rast3d_autolock_off ( RASTER3D_Map map)

Turns autolock mode Off.

Parameters
map
Returns
void

Definition at line 352 of file tileread.c.

References RASTER3D_Map::cache, Rast3d_cache_autolock_off(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.

Referenced by Rast3d_end_cycle().

◆ Rast3d_autolock_on()

void Rast3d_autolock_on ( RASTER3D_Map map)

Turns autolock mode on.

Parameters
map
Returns
void

Definition at line 333 of file tileread.c.

References RASTER3D_Map::cache, Rast3d_cache_autolock_on(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.

Referenced by Rast3d_begin_cycle(), and Rast3d_compare_files().

◆ Rast3d_begin_cycle()

int Rast3d_begin_cycle ( RASTER3D_Map map)

Starts a new cycle.

Parameters
map
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 401 of file tileread.c.

References Rast3d_autolock_on(), Rast3d_fatal_error(), and Rast3d_unlock_all().

◆ Rast3d_cache_autolock_off()

void Rast3d_cache_autolock_off ( RASTER3D_cache c)

Definition at line 361 of file cache1.c.

References RASTER3D_cache::autoLock.

Referenced by Rast3d_autolock_off().

◆ Rast3d_cache_autolock_on()

void Rast3d_cache_autolock_on ( RASTER3D_cache c)

Definition at line 354 of file cache1.c.

References RASTER3D_cache::autoLock.

Referenced by MAIN(), and Rast3d_autolock_on().

◆ Rast3d_cache_dispose()

◆ Rast3d_cache_elt_ptr()

◆ Rast3d_cache_flush()

int Rast3d_cache_flush ( RASTER3D_cache c,
int  name 
)

Definition at line 422 of file cache1.c.

References name, and Rast3d_error().

Referenced by MAIN(), Rast3d_cache_flush_all(), and Rast3d_flush_all_tiles().

◆ Rast3d_cache_flush_all()

int Rast3d_cache_flush_all ( RASTER3D_cache c)

◆ Rast3d_cache_get_elt()

int Rast3d_cache_get_elt ( RASTER3D_cache c,
int  name,
void dst 
)

Definition at line 530 of file cache1.c.

References RASTER3D_cache::eltSize, name, NULL, Rast3d_cache_elt_ptr(), and Rast3d_error().

◆ Rast3d_cache_hash_dispose()

void Rast3d_cache_hash_dispose ( Rast3d_cache_hash h)

◆ Rast3d_cache_hash_load_name()

void Rast3d_cache_hash_load_name ( Rast3d_cache_hash h,
int  name,
int  index 
)

◆ Rast3d_cache_hash_name2index()

◆ Rast3d_cache_hash_new()

◆ Rast3d_cache_hash_remove_name()

◆ Rast3d_cache_hash_reset()

void Rast3d_cache_hash_reset ( Rast3d_cache_hash h)

◆ Rast3d_cache_load()

int Rast3d_cache_load ( RASTER3D_cache c,
int  name 
)

Definition at line 518 of file cache1.c.

References name, NULL, Rast3d_cache_elt_ptr(), and Rast3d_error().

Referenced by MAIN(), and Rast3d_flush_all_tiles().

◆ Rast3d_cache_lock()

int Rast3d_cache_lock ( RASTER3D_cache c,
int  name 
)

◆ Rast3d_cache_lock_all()

int Rast3d_cache_lock_all ( RASTER3D_cache c)

Definition at line 341 of file cache1.c.

References IS_UNLOCKED_ELT, RASTER3D_cache::nofElts, and Rast3d_cache_lock_intern().

◆ Rast3d_cache_lock_intern()

void Rast3d_cache_lock_intern ( RASTER3D_cache c,
int  index 
)

Definition at line 292 of file cache1.c.

References IS_LOCKED_ELT, and LOCK_ELT.

Referenced by Rast3d_cache_elt_ptr(), and Rast3d_cache_lock_all().

◆ Rast3d_cache_new()

void * Rast3d_cache_new ( int  ,
int  ,
int  ,
write_fn ,
void ,
read_fn ,
void  
)

◆ Rast3d_cache_new_read()

void * Rast3d_cache_new_read ( int  nofElts,
int  sizeOfElts,
int  nofNames,
read_fn eltLoadFun,
void eltLoadFunData 
)

Definition at line 161 of file cache1.c.

References NULL, and Rast3d_cache_new().

◆ Rast3d_cache_put_elt()

int Rast3d_cache_put_elt ( RASTER3D_cache c,
int  name,
const void src 
)

Definition at line 547 of file cache1.c.

References RASTER3D_cache::eltSize, name, NULL, Rast3d_cache_elt_ptr(), and Rast3d_error().

◆ Rast3d_cache_remove_all()

int Rast3d_cache_remove_all ( RASTER3D_cache c)

◆ Rast3d_cache_remove_elt()

int Rast3d_cache_remove_elt ( RASTER3D_cache c,
int  name 
)

Definition at line 410 of file cache1.c.

References name, and Rast3d_error().

Referenced by Rast3d__remove_tile(), and Rast3d_cache_remove_all().

◆ Rast3d_cache_reset()

◆ Rast3d_cache_set_load_fun()

void Rast3d_cache_set_load_fun ( RASTER3D_cache ,
read_fn ,
void  
)

◆ Rast3d_cache_set_min_unlock()

void Rast3d_cache_set_min_unlock ( RASTER3D_cache c,
int  nofMinUnLocked 
)

Definition at line 368 of file cache1.c.

References RASTER3D_cache::minUnlocked.

Referenced by Rast3d_min_unlocked().

◆ Rast3d_cache_set_remove_fun()

void Rast3d_cache_set_remove_fun ( RASTER3D_cache ,
write_fn ,
void  
)

Referenced by Rast3d_flush_all_tiles().

◆ Rast3d_cache_size_encode()

int Rast3d_cache_size_encode ( int  cacheCode,
int  n 
)

Returns a number which encodes multiplicity n of cacheCode. This value can be used to specify the size of the cache. If cacheCode is the size (in tiles) of the cache the function returns cacheCode * n. If cacheCode is RASTER3D_USE_CACHE_DEFAULT the function returns RASTER3D_USE_CACHE_DEFAULT. If cacheCode is RASTER3D_USE_CACHE_??? the function returns a value encoding RASTER3D_USE_CACHE_??? and n. Here RASTER3D_USE_CACHE_??? is one of RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, or RASTER3D_USE_CACHE_XYZ, where e.g. RASTER3D_USE_CACHE_X specifies that the cache should store as many tiles as there exist in one row along the x-axis of the tile cube, and RASTER3D_USE_CACHE_XY specifies that the cache should store as many tiles as there exist in one slice of the tile cube with constant Z coordinate.

Parameters
cacheCode
n
Returns
int

Definition at line 314 of file raster3d/header.c.

References Rast3d_fatal_error(), RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, and RASTER3D_USE_CACHE_XYZ.

◆ Rast3d_cache_unlock()

◆ Rast3d_cache_unlock_all()

int Rast3d_cache_unlock_all ( RASTER3D_cache c)

◆ Rast3d_change_precision()

◆ Rast3d_change_type()

void Rast3d_change_type ( void map,
const char nameOut 
)

◆ Rast3d_close()

◆ Rast3d_compare_files()

void Rast3d_compare_files ( const char f1,
const char mapset1,
const char f2,
const char mapset2 
)

Compares the cell-values of file f1 in mapset mapset1 and file f2 in mapset mapset2. The values are compared up to precision. Terminates in error if the files don't match. This function uses the more advanced features of the cache. The source code can be found in filecompare.c.

Parameters
f1
mapset1
f2
mapset2
Returns
void

Definition at line 376 of file filecompare.c.

References FCELL_TYPE, NULL, Rast3d_autolock_on(), Rast3d_close(), Rast3d_coord2tile_coord(), Rast3d_fatal_error(), Rast3d_get_coords_map(), Rast3d_get_nof_tiles_map(), Rast3d_get_tile_dimensions_map(), Rast3d_get_value_region(), Rast3d_is_null_value_num(), Rast3d_min_unlocked(), Rast3d_open_cell_old(), Rast3d_print_header(), Rast3d_tile_precision_map(), Rast3d_tile_type_map(), Rast3d_tile_use_cache_map(), Rast3d_unlock_all(), RASTER3D_DEFAULT_WINDOW, RASTER3D_TILE_SAME_AS_FILE, RASTER3D_USE_CACHE_DEFAULT, and x.

◆ Rast3d_compute_clipped_tile_dimensions()

int Rast3d_compute_clipped_tile_dimensions ( RASTER3D_Map map,
int  tileIndex,
int rows,
int cols,
int depths,
int xRedundant,
int yRedundant,
int zRedundant 
)

Computes the dimensions of the tile when clipped to fit the region of map. The clipped dimensions are returned in rows, cols, depths. The complement is returned in xRedundant, yRedundant, and zRedundant. This function returns the number of cells in the clipped tile.

Parameters
map
tileIndex
rows
cols
depths
xRedundant
yRedundant
zRedundant
Returns
int

Definition at line 243 of file tilemath.c.

References RASTER3D_Map::clipX, RASTER3D_Map::clipY, RASTER3D_Map::clipZ, RASTER3D_Region::cols, RASTER3D_Region::depths, Rast3d_tile_index2tile(), RASTER3D_Map::region, RASTER3D_Region::rows, RASTER3D_Map::tileSize, RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.

Referenced by Rast3d_init_index(), Rast3d_mask_tile(), Rast3d_read_tile(), and Rast3d_write_tile().

◆ Rast3d_compute_optimal_tile_dimension()

void Rast3d_compute_optimal_tile_dimension ( RASTER3D_Region region,
int  type,
int tileX,
int tileY,
int tileZ,
int  maxSize 
)

Compute the optimal tile size.

This function computes tile sizes with an optimal ratio between tile dimensions and minimized border tile overlapping. Large dimensions (in most cases x and y) will be reduced more often than small dimensions to fit the maxSize criteria.

Parameters
regionThe region of the map
typeThe type of the map (FCELL_TYPE or DCELL_TYPE)
tileXPointer of the tile size in x direction for result storage
tileYPointer of the tile size in y direction for result storage
tileZPointer of the tile size in z direction for result storage
maxSizeThe max size of the tile in kilo bytes
Returns
void

Definition at line 306 of file tilemath.c.

References RASTER3D_Region::cols, DCELL_TYPE, RASTER3D_Region::depths, FCELL_TYPE, G_debug(), RASTER3D_Region::rows, and x.

Referenced by Rast3d_open_new_opt_tile_size().

◆ Rast3d_coord2location()

void Rast3d_coord2location ( RASTER3D_Region region,
double  x,
double  y,
double  z,
double north,
double east,
double top 
)

Converts cell-coordinates (x, y, z) into region-coordinates (north, east, top).

  • Note: x, y and z is a double:
  • x+0.0 will return the easting for the western edge of the column.
  • x+0.5 will return the easting for the center of the column.
  • x+1.0 will return the easting for the eastern edge of the column.
  • y+0.0 will return the northing for the northern edge of the row.
  • y+0.5 will return the northing for the center of the row.
  • y+1.0 will return the northing for the southern edge of the row.
  • z+0.0 will return the top for the lower edge of the depth.
  • z+0.5 will return the top for the center of the depth.
  • z+1.0 will return the top for the upper edge of the column.
Parameters
region
x
y
z
north
east
top
Returns
void

Definition at line 374 of file region.c.

References COORD_TO_LOCATION, Cell_head::east, G_debug(), Cell_head::north, Cell_head::top, and x.

Referenced by Rast3d_nearest_neighbor().

◆ Rast3d_coord2tile_coord()

void Rast3d_coord2tile_coord ( RASTER3D_Map map,
int  x,
int  y,
int  z,
int xTile,
int yTile,
int zTile,
int xOffs,
int yOffs,
int zOffs 
)

Converts cell-coordinates (x, y, z) into tile-coordinates (xTile, yTile, zTile) and the coordinate of the cell (xOffs, yOffs, zOffs) within the tile.

Parameters
map
x
y
z
xTile
yTile
zTile
xOffs
yOffs
zOffs
Returns
void

Definition at line 124 of file tilemath.c.

References RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.

Referenced by Rast3d_compare_files(), Rast3d_coord2tile_index(), Rast3d_flush_tiles_in_cube(), Rast3d_get_block_nocache(), and Rast3d_retile().

◆ Rast3d_coord2tile_index()

void Rast3d_coord2tile_index ( RASTER3D_Map map,
int  x,
int  y,
int  z,
int tileIndex,
int offset 
)

Converts cell-coordinates (x, y, z) into tileIndex and the offset of the cell within the tile.

Parameters
map
x
y
z
tileIndex
offset
Returns
void

Definition at line 152 of file tilemath.c.

References Rast3d_coord2tile_coord(), Rast3d_tile2tile_index(), RASTER3D_Map::tileX, RASTER3D_Map::tileXY, and x.

Referenced by Rast3d_get_double_region(), Rast3d_get_float_region(), Rast3d_put_double(), and Rast3d_put_float().

◆ Rast3d_coord_in_range()

int Rast3d_coord_in_range ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Returns 1 if cell-coordinate (x, y, z) is a coordinate inside the region. Returns 0 otherwise.

Parameters
map
x
y
z
Returns
int

Definition at line 178 of file tilemath.c.

References RASTER3D_Region::cols, RASTER3D_Region::depths, RASTER3D_Map::region, RASTER3D_Region::rows, and x.

◆ Rast3d_copy_double2Float()

void Rast3d_copy_double2Float ( const double src,
int  offsSrc,
float dst,
int  offsDst,
int  nElts 
)

Definition at line 36 of file raster3d/misc.c.

Referenced by Rast3d_copy_values().

◆ Rast3d_copy_float2Double()

void Rast3d_copy_float2Double ( const float src,
int  offsSrc,
double dst,
int  offsDst,
int  nElts 
)

Definition at line 22 of file raster3d/misc.c.

Referenced by Rast3d_copy_values().

◆ Rast3d_copy_from_xdr()

int Rast3d_copy_from_xdr ( int  nofNum,
void dst 
)

◆ Rast3d_copy_to_xdr()

◆ Rast3d_copy_values()

void Rast3d_copy_values ( const void src,
int  offsSrc,
int  typeSrc,
void dst,
int  offsDst,
int  typeDst,
int  nElts 
)

◆ Rast3d_dispose_cache()

int Rast3d_dispose_cache ( RASTER3D_Map map)

Definition at line 249 of file cache.c.

References RASTER3D_Map::operation, Rast3d_error(), and RASTER3D_READ_DATA.

Referenced by Rast3d_close().

◆ Rast3d_end_cycle()

int Rast3d_end_cycle ( RASTER3D_Map map)

Ends a cycle.

Parameters
map
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 423 of file tileread.c.

References Rast3d_autolock_off().

◆ Rast3d_error()

void Rast3d_error ( const char ,
  ... 
)

Referenced by Rast3d__remove_tile(), Rast3d_alloc_tiles(), Rast3d_alloc_tiles_type(), Rast3d_cache_elt_ptr(), Rast3d_cache_flush(), Rast3d_cache_flush_all(), Rast3d_cache_get_elt(), Rast3d_cache_hash_new(), Rast3d_cache_load(), Rast3d_cache_lock(), Rast3d_cache_new(), Rast3d_cache_put_elt(), Rast3d_cache_remove_all(), Rast3d_cache_remove_elt(), Rast3d_cache_unlock(), Rast3d_cache_unlock_all(), Rast3d_copy_from_xdr(), Rast3d_copy_to_xdr(), Rast3d_dispose_cache(), Rast3d_fill_header(), Rast3d_flush_all_tiles(), Rast3d_flush_index(), Rast3d_flush_tile(), Rast3d_flush_tile_cube(), Rast3d_flush_tiles_in_cube(), Rast3d_fpcompress_read_xdr_nums(), Rast3d_fpcompress_write_xdr_nums(), Rast3d_get_standard3d_params(), Rast3d_get_tile_ptr(), Rast3d_init_cache(), Rast3d_init_fp_xdr(), Rast3d_init_index(), Rast3d_key_get_double(), Rast3d_key_get_int(), Rast3d_key_get_string(), Rast3d_key_get_value(), Rast3d_key_set_value(), Rast3d_lock_tile(), Rast3d_malloc(), Rast3d_mask_close(), Rast3d_mask_open_old(), Rast3d_mask_reopen(), Rast3d_open_cell_new(), Rast3d_open_cell_old(), Rast3d_open_cell_old_no_header(), Rast3d_put_double(), Rast3d_put_float(), Rast3d_range_write(), Rast3d_read_doubles(), Rast3d_read_header(), Rast3d_read_ints(), Rast3d_read_tile(), Rast3d_read_tile_double(), Rast3d_read_tile_float(), Rast3d_read_window(), Rast3d_realloc(), Rast3d_tile_load(), Rast3d_unlock_all(), Rast3d_unlock_tile(), Rast3d_write_doubles(), Rast3d_write_header(), Rast3d_write_ints(), Rast3d_write_tile(), Rast3d_write_tile_double(), and Rast3d_write_tile_float().

◆ Rast3d_extern_length()

◆ Rast3d_extract2d_region()

void Rast3d_extract2d_region ( RASTER3D_Region region3d,
struct Cell_head region2d 
)

Returns in region2d the 2d portion of region3d.

Parameters
region3d
region2d
Returns
void

Definition at line 18 of file region.c.

◆ Rast3d_fatal_error()

◆ Rast3d_fatal_error_noargs()

void Rast3d_fatal_error_noargs ( const char msg)

Definition at line 60 of file raster3d/error.c.

References G_fatal_error().

Referenced by Rast3d_init_defaults().

◆ Rast3d_file_type_map()

int Rast3d_file_type_map ( RASTER3D_Map map)

Returns the type with which tiles of map are stored on file.

Parameters
map
Returns
int

Definition at line 263 of file headerinfo.c.

References RASTER3D_Map::type.

Referenced by open_g3d_file(), Rast3d_change_type(), Rast3d_make_aligned_volume_file(), and Rast3d_retile().

◆ Rast3d_filename()

void Rast3d_filename ( char path,
const char elementName,
const char mapName,
const char mapset 
)

◆ Rast3d_fill_header()

int Rast3d_fill_header ( RASTER3D_Map map,
int  operation,
int  compression,
int  useRle,
int  useLzw,
int  type,
int  precision,
int  cache,
int  hasIndex,
int  useXdr,
int  typeIntern,
int  nofHeaderBytes,
int  tileX,
int  tileY,
int  tileZ,
int  proj,
int  zone,
double  north,
double  south,
double  east,
double  west,
double  top,
double  bottom,
int  rows,
int  cols,
int  depths,
double  ew_res,
double  ns_res,
double  tb_res,
char unit,
int  vertical_unit,
int  version 
)

Definition at line 368 of file raster3d/header.c.

References RASTER3D_Region::bottom, RASTER3D_Map::cache, RASTER3D_Map::clipX, RASTER3D_Map::clipY, RASTER3D_Map::clipZ, RASTER3D_Region::cols, RASTER3D_Map::compression, compression, RASTER3D_Map::currentIndex, RASTER3D_Map::data, RASTER3D_Map::data_fd, DCELL_TYPE, RASTER3D_Region::depths, RASTER3D_Region::east, RASTER3D_Region::ew_res, FCELL_TYPE, RASTER3D_Map::fileEndPtr, g3d_cache_default, g3d_cache_max, G_store(), RASTER3D_Region::north, RASTER3D_Region::ns_res, RASTER3D_Map::nTiles, NULL, RASTER3D_Map::numLengthExtern, RASTER3D_Map::numLengthIntern, RASTER3D_Map::nx, RASTER3D_Map::nxy, RASTER3D_Map::ny, RASTER3D_Map::nz, RASTER3D_Map::offset, RASTER3D_Map::operation, RASTER3D_Map::precision, RASTER3D_Region::proj, Rast3d__compute_cache_size(), Rast3d_adjust_region(), Rast3d_error(), Rast3d_extern_length(), Rast3d_fatal_error(), Rast3d_init_cache(), Rast3d_init_fp_xdr(), Rast3d_init_index(), Rast3d_length(), Rast3d_malloc(), Rast3d_realloc(), RASTER3D_MAX, RASTER3D_MIN, RASTER3D_NO_CACHE, RASTER3D_NO_COMPRESSION, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_VALID_OPERATION, RASTER3D_VALID_XDR_OPTION, RASTER3D_Map::region, RLE_STATUS_BYTES, RASTER3D_Region::rows, RASTER3D_Region::south, RASTER3D_Region::tb_res, RASTER3D_Map::tileSize, RASTER3D_Map::tileX, RASTER3D_Map::tileXY, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, tmpCompress, tmpCompressLength, RASTER3D_Region::top, RASTER3D_Map::type, RASTER3D_Map::typeIntern, RASTER3D_Map::unit, RASTER3D_Map::useCache, RASTER3D_Map::useLzw, RASTER3D_Map::useRle, RASTER3D_Map::useXdr, RASTER3D_Map::version, RASTER3D_Map::vertical_unit, RASTER3D_Region::west, XDR_MISUSE_BYTES, and RASTER3D_Region::zone.

Referenced by Rast3d_open_cell_new(), and Rast3d_open_cell_old().

◆ Rast3d_flush_all_tiles()

◆ Rast3d_flush_index()

◆ Rast3d_flush_tile()

int Rast3d_flush_tile ( RASTER3D_Map map,
int  tileIndex 
)

Writes the tile with tileIndex to the file corresponding to map and removes the tile from the cache (in non-cache mode the buffer provided by the map-structure is written). If this tile has already been written before the write request is ignored. If the tile was never referred to before the invocation of Rast3d_flush_tile, a tile filled with NULL-values is written.

Parameters
map
tileIndex
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 258 of file tilewrite.c.

References NULL, Rast3d__remove_tile(), Rast3d_error(), Rast3d_get_tile_ptr(), Rast3d_write_tile(), and RASTER3D_Map::typeIntern.

Referenced by Rast3d_flush_tile_cube().

◆ Rast3d_flush_tile_cube()

int Rast3d_flush_tile_cube ( RASTER3D_Map map,
int  xMin,
int  yMin,
int  zMin,
int  xMax,
int  yMax,
int  zMax 
)

Writes the tiles with tile-coordinates contained in the axis-parallel cube with vertices (xMin, yMin, zMin) and (xMax, yMax, zMax). Tiles which are not stored in the cache are written as NULL-tiles. Write attempts for tiles which have already been written earlier are ignored.

Parameters
map
xMin
yMin
zMin
xMax
yMax
zMax
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 302 of file tilewrite.c.

References Rast3d_error(), Rast3d_fatal_error(), Rast3d_flush_tile(), Rast3d_tile2tile_index(), RASTER3D_Map::useCache, and x.

Referenced by Rast3d_flush_tiles_in_cube().

◆ Rast3d_flush_tiles_in_cube()

int Rast3d_flush_tiles_in_cube ( RASTER3D_Map map,
int  xMin,
int  yMin,
int  zMin,
int  xMax,
int  yMax,
int  zMax 
)

Writes those tiles for which every cell has coordinate contained in the axis-parallel cube defined by the vertices with cell-coordinates (xMin, yMin, zMin) and (xMax, yMax, zMax). Tiles which are not stored in the cache are written as NULL-tiles. Write attempts for tiles which have already been written earlier are ignored.

Parameters
map
xMin
yMin
zMin
xMax
yMax
zMax
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 347 of file tilewrite.c.

References MAX, MIN, Rast3d_coord2tile_coord(), Rast3d_error(), Rast3d_fatal_error(), Rast3d_flush_tile_cube(), Rast3d_get_coords_map(), and RASTER3D_Map::useCache.

◆ Rast3d_fpcompress_dissect_xdr_double()

void Rast3d_fpcompress_dissect_xdr_double ( unsigned char numPointer)

Definition at line 31 of file fpcompress.c.

References Rast3d_fpcompress_print_binary(), and sign().

◆ Rast3d_fpcompress_print_binary()

void Rast3d_fpcompress_print_binary ( char c,
int  numBits 
)

Definition at line 16 of file fpcompress.c.

Referenced by Rast3d_fpcompress_dissect_xdr_double().

◆ Rast3d_fpcompress_read_xdr_nums()

int Rast3d_fpcompress_read_xdr_nums ( int  fd,
char dst,
int  nofNum,
int  fileBytes,
int  precision,
char compressBuf,
int  isFloat 
)

◆ Rast3d_fpcompress_write_xdr_nums()

int Rast3d_fpcompress_write_xdr_nums ( int  fd,
char src,
int  nofNum,
int  precision,
char compressBuf,
int  isFloat 
)

Definition at line 685 of file fpcompress.c.

References G_write_compressed(), and Rast3d_error().

◆ Rast3d_free()

◆ Rast3d_free_tiles()

void Rast3d_free_tiles ( void tiles)

Is equivalent to Rast3d_free (tiles);

Parameters
tiles
Returns
void

Definition at line 70 of file tilealloc.c.

References Rast3d_free().

Referenced by Rast3d_change_precision(), Rast3d_change_type(), and Rast3d_get_block_nocache().

◆ Rast3d_g3d_type2cell_type()

int Rast3d_g3d_type2cell_type ( int  g3dType)

Definition at line 13 of file raster3d/misc.c.

References DCELL_TYPE, and FCELL_TYPE.

Referenced by Rast3d_range_update_from_tile().

◆ Rast3d_get_aligned_volume()

void Rast3d_get_aligned_volume ( void map,
double  originNorth,
double  originWest,
double  originBottom,
double  lengthNorth,
double  lengthWest,
double  lengthBottom,
int  nx,
int  ny,
int  nz,
void volumeBuf,
int  type 
)

Definition at line 180 of file volume.c.

References Rast3d_get_volume().

Referenced by Rast3d_make_aligned_volume_file().

◆ Rast3d_get_block()

void Rast3d_get_block ( RASTER3D_Map map,
int  x0,
int  y0,
int  z0,
int  nx,
int  ny,
int  nz,
void block,
int  type 
)

Copies the cells contained in the block (cube) with vertices (x0, y0, z0) and (x0 + nx - 1, y0 + ny - 1, z0 + nz - 1) into block. The cell-values in block are of type. The source code can be found in getblock.c.

Parameters
map
x0
y0
z0
nx
ny
nz
block
type
Returns
void

Definition at line 101 of file getblock.c.

References RASTER3D_Region::cols, RASTER3D_Region::depths, G_incr_void_ptr, Rast3d_get_block_nocache(), Rast3d_get_value_region(), Rast3d_length(), Rast3d_set_null_value(), RASTER3D_MIN, RASTER3D_Map::region, RASTER3D_Region::rows, RASTER3D_Map::useCache, and x.

◆ Rast3d_get_block_nocache()

◆ Rast3d_get_cache_limit()

int Rast3d_get_cache_limit ( void  )

Get cache limit.

Returns
int

Definition at line 184 of file defaults.c.

References g3d_cache_max.

◆ Rast3d_get_cache_size()

int Rast3d_get_cache_size ( void  )

get cache size

Returns
int

Definition at line 156 of file defaults.c.

References g3d_cache_default.

◆ Rast3d_get_compression_mode()

void Rast3d_get_compression_mode ( int doCompress,
int precision 
)

Gets compression mode.

Parameters
doCompresspointer to the integer where the compression mode will be stored
precisionpointer to the integer where the precision mode will be stored
See also
Rast3d_set_compression_mode, RASTER3D_COMPRESSION_ENV_VAR_YES, RASTER3D_COMPRESSION_ENV_VAR_YES

Definition at line 125 of file defaults.c.

References g3d_do_compression, g3d_precision, and NULL.

Referenced by Rast3d_change_precision(), Rast3d_get_standard3d_params(), and Rast3d_open_new_param().

◆ Rast3d_get_coords_map()

void Rast3d_get_coords_map ( RASTER3D_Map map,
int rows,
int cols,
int depths 
)

Returns the size of the region of map in cells.

Parameters
map
rows
cols
depths
Returns
void

Definition at line 17 of file headerinfo.c.

References RASTER3D_Region::cols, RASTER3D_Region::depths, RASTER3D_Map::region, and RASTER3D_Region::rows.

Referenced by Rast3d_compare_files(), Rast3d_flush_tiles_in_cube(), Rast3d_retile(), and Rast3d_write_ascii().

◆ Rast3d_get_coords_map_window()

void Rast3d_get_coords_map_window ( RASTER3D_Map map,
int rows,
int cols,
int depths 
)

◆ Rast3d_get_double()

double Rast3d_get_double ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Is equivalent to Rast3d_get_value (map, x, y, z, &value, DCELL_TYPE); return value.

Parameters
map
x
y
z
Returns
double

Definition at line 65 of file getvalue.c.

References DCELL_TYPE, Rast3d_get_value(), and x.

Referenced by read_g3d_slice(), read_g3d_value(), and read_g3d_vol().

◆ Rast3d_get_double_region()

double Rast3d_get_double_region ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Is equivalent to Rast3d_get_value_region (map, x, y, z, &value, DCELL_TYPE); return value.

Parameters
map
x
y
z
Returns
double

Definition at line 201 of file getvalue.c.

References RASTER3D_Region::cols, DCELL_TYPE, RASTER3D_Region::depths, FCELL_TYPE, NULL, Rast3d_coord2tile_index(), Rast3d_fatal_error(), Rast3d_get_float_region(), Rast3d_get_tile_ptr(), Rast3d_set_null_value(), RASTER3D_Map::region, RASTER3D_Region::rows, RASTER3D_Map::typeIntern, and x.

Referenced by Rast3d_get_float_region(), Rast3d_get_value_region(), and Rast3d_get_volume_a().

◆ Rast3d_get_file_type()

◆ Rast3d_get_float()

float Rast3d_get_float ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Is equivalent to Rast3d_get_value (map, x, y, z, &value, FCELL_TYPE); return value.

Parameters
map
x
y
z
Returns
float

Definition at line 42 of file getvalue.c.

References FCELL_TYPE, Rast3d_get_value(), and x.

Referenced by read_g3d_slice(), read_g3d_value(), and read_g3d_vol().

◆ Rast3d_get_float_region()

float Rast3d_get_float_region ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Is equivalent to Rast3d_get_value_region (map, x, y, z, &value, FCELL_TYPE); return value.

Parameters
map
x
y
z
Returns
float

Definition at line 159 of file getvalue.c.

References RASTER3D_Region::cols, DCELL_TYPE, RASTER3D_Region::depths, FCELL_TYPE, NULL, Rast3d_coord2tile_index(), Rast3d_fatal_error(), Rast3d_get_double_region(), Rast3d_get_tile_ptr(), Rast3d_set_null_value(), RASTER3D_Map::region, RASTER3D_Region::rows, RASTER3D_Map::typeIntern, and x.

Referenced by Rast3d_get_double_region(), Rast3d_get_value_region(), and Rast3d_get_volume_a().

◆ Rast3d_get_nearest_neighbor_fun_ptr()

void Rast3d_get_nearest_neighbor_fun_ptr ( void(**)(RASTER3D_Map *, int, int, int, void *, int nnFunPtr)

Returns in nnFunPtr a pointer to Rast3d_nearest_neighbor () (cf.{g3d:G3d.nearestNeighbor}).

Returns
void

Definition at line 88 of file resample.c.

References Rast3d_nearest_neighbor().

Referenced by Rast3d_open_cell_new(), and Rast3d_open_cell_old().

◆ Rast3d_get_nof_tiles_map()

void Rast3d_get_nof_tiles_map ( RASTER3D_Map map,
int nx,
int ny,
int nz 
)

Returns the dimensions of the tile-cube used to tile the region of map. These numbers include partial tiles.

Parameters
map
nx
ny
nz
Returns
void

Definition at line 48 of file headerinfo.c.

References RASTER3D_Map::nx, RASTER3D_Map::ny, and RASTER3D_Map::nz.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), and Rast3d_compare_files().

◆ Rast3d_get_region_map()

void Rast3d_get_region_map ( RASTER3D_Map map,
double north,
double south,
double east,
double west,
double top,
double bottom 
)

Returns the size of the region.

Parameters
map
north
south
east
west
top
bottom
Returns
void

Definition at line 71 of file headerinfo.c.

References RASTER3D_Region::bottom, RASTER3D_Region::east, RASTER3D_Region::north, RASTER3D_Map::region, RASTER3D_Region::south, RASTER3D_Region::top, and RASTER3D_Region::west.

◆ Rast3d_get_region_struct_map()

void Rast3d_get_region_struct_map ( RASTER3D_Map map,
RASTER3D_Region region 
)

Returns in region the region of map.

Parameters
map
region
Returns
void

Definition at line 108 of file headerinfo.c.

References Rast3d_region_copy(), and RASTER3D_Map::region.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_mask_open_old(), and Rast3d_retile().

◆ Rast3d_get_region_value()

void Rast3d_get_region_value ( RASTER3D_Map map,
double  north,
double  east,
double  top,
void value,
int  type 
)

Returns in value the value of the map which corresponds to region coordinates (north, east, top).

Parameters
map
north
east
top
value
type
Returns
void

Definition at line 126 of file getvalue.c.

References RASTER3D_Region::cols, RASTER3D_Region::depths, Rast3d_get_value_region(), Rast3d_location2coord(), Rast3d_set_null_value(), RASTER3D_Map::region, and RASTER3D_Region::rows.

◆ Rast3d_get_resampling_fun()

void Rast3d_get_resampling_fun ( RASTER3D_Map map,
void(**)(RASTER3D_Map *, int, int, int, void *, int resampleFun 
)

Returns in resampleFun a pointer to the resampling function used by map.

Returns
void

Definition at line 70 of file resample.c.

References RASTER3D_Map::resampleFun.

◆ Rast3d_get_standard3d_params()

int Rast3d_get_standard3d_params ( int useTypeDefault,
int type,
int useCompressionDefault,
int doCompression,
int usePrecisionDefault,
int precision,
int useDimensionDefault,
int tileX,
int tileY,
int tileZ 
)

◆ Rast3d_get_tile_dimension()

void Rast3d_get_tile_dimension ( int tileX,
int tileY,
int tileZ 
)

get Tile Dimension

Parameters
tileX
tileY
tileZ
Returns
void

Definition at line 252 of file defaults.c.

References g3d_tile_dimension.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_get_standard3d_params(), Rast3d_open_new_opt_tile_size(), Rast3d_open_new_param(), and Rast3d_retile().

◆ Rast3d_get_tile_dimensions_map()

void Rast3d_get_tile_dimensions_map ( RASTER3D_Map map,
int x,
int y,
int z 
)

Returns the tile dimensions used for map.

Parameters
map
x
y
z
Returns
void

Definition at line 133 of file headerinfo.c.

References RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_compare_files(), and Rast3d_mask_tile().

◆ Rast3d_get_tile_ptr()

void * Rast3d_get_tile_ptr ( RASTER3D_Map map,
int  tileIndex 
)

This function returns a pointer to a tile which contains the data for the tile with index tileIndex. The type of the data stored in the tile depends on the type specified at the initialization time of map. The functionality is different depending on whether map is old or new and depending on the cache-mode of map.

If map is old and the cache is not used the tile with tileIndex is read from file and stored in the buffer provided by the map structure. The pointer to this buffer is returned. If the buffer already contains the tile with tileIndex reading is skipped. Data which was stored in earlier calls to Rast3d_get_tile_ptr is destroyed. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index the buffer is filled with NULL-values.

If map is old and the cache is used the tile with tileIndex is read from file and stored in one of the cache buffers. The pointer to buffer is returned. If no free cache buffer is available an unlocked cache-buffer is freed up and the new tile is stored in its place. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index the buffer is filled with NULL-values. If one of the cache buffers already contains the tile with tileIndex reading is skipped and the pointer to this buffer is returned.

If map is new and the cache is not used the functionality is the same as if map is old and the cache is not used. If the tile with tileIndex is already stored on file, it is read into the buffer, if not, the cells are set to null-values. If the buffer corresponding to the pointer is used for writing, subsequent calls to Rast3d_get_tile_ptr may destroy the values already stored in the buffer. Use Rast3d_flush_tile to write the buffer to the file before reusing it for a different index. The use of this buffer as write buffer is discouraged.

If map is new and the cache is used the functionality is the same as if map is old and the cache is used with the following exception. If tileIndex is a valid index and the tile with this index is not found in the cache and is not stored on the file corresponding to map, then the file cache is queried next. If the file-cache contains the tile it is loaded into the cache (memory-cache). Only if the file-cache does not contain the tile it is filled with NULL-values. Tile contents of buffers are never destroyed. If a cache buffer needs to be freed up, and the tile stored in the buffer has not been written to the file corresponding to map yet, the tile is copied into the file-cache.

Care has to be taken if this function is used in non-cache mode since it is implicitly invoked every time a read or write request is issued. The only I/O-functions for which it is safe to assume that they do not invoke Rast3d_get_tile_ptr are Rast3d_read_tile() and Rast3d_write_tile() and their corresponding type-specific versions.

Parameters
map
tileIndex
Returns
void * a pointer to a buffer ... if successful, NULL ... otherwise.

Definition at line 78 of file tileio.c.

References RASTER3D_Map::cache, RASTER3D_Map::currentIndex, RASTER3D_Map::data, RASTER3D_Map::nTiles, NULL, Rast3d_cache_elt_ptr(), Rast3d_error(), Rast3d_read_tile(), RASTER3D_Map::typeIntern, and RASTER3D_Map::useCache.

Referenced by Rast3d_flush_tile(), Rast3d_get_block_nocache(), Rast3d_get_double_region(), Rast3d_get_float_region(), Rast3d_put_double(), Rast3d_put_float(), and Rast3d_tile_load().

◆ Rast3d_get_unit()

const char * Rast3d_get_unit ( RASTER3D_Map map)

Return the data unit definition of map.

Parameters
map
Returns
int

Definition at line 213 of file headerinfo.c.

References RASTER3D_Map::unit.

◆ Rast3d_get_value()

void Rast3d_get_value ( RASTER3D_Map map,
int  x,
int  y,
int  z,
void value,
int  type 
)

Returns in *value the resampled cell-value of the cell with window-coordinate (x, y, z). The value returned is of type. This function invokes a fatal error if an error occurs.

Parameters
map
x
y
z
value
type
Returns
void

Definition at line 21 of file getvalue.c.

References RASTER3D_Map::resampleFun, and x.

Referenced by N_read_rast3d_to_array_3d(), Rast3d_get_double(), and Rast3d_get_float().

◆ Rast3d_get_value_region()

void Rast3d_get_value_region ( RASTER3D_Map map,
int  x,
int  y,
int  z,
void value,
int  type 
)

Returns in *value the cell-value of the cell with region-coordinate (x, y, z). The value returned is of type. Here region means the coordinate in the cube of data in the file, i.e. ignoring geographic coordinates. In case the region coordinates are out of bounds, the Null value will be returned. This function invokes a fatal error if an error occurs.

Parameters
map
x
y
z
value
type
Returns
void

Definition at line 249 of file getvalue.c.

References FCELL_TYPE, Rast3d_get_double_region(), Rast3d_get_float_region(), and x.

Referenced by Rast3d_compare_files(), Rast3d_get_block(), Rast3d_get_region_value(), Rast3d_nearest_neighbor(), Rast3d_retile(), and Rast3d_write_ascii().

◆ Rast3d_get_vertical_unit()

const char * Rast3d_get_vertical_unit ( RASTER3D_Map map)

Return the name of the unit of map. Units are defined in gis.h.

Vertical units may have temporal type

Parameters
map
Returns
int

Definition at line 248 of file headerinfo.c.

References G_get_units_name(), and RASTER3D_Map::vertical_unit.

◆ Rast3d_get_vertical_unit2()

int Rast3d_get_vertical_unit2 ( RASTER3D_Map map)

Returns the vertical unit of map as integer. Units are defined in gis.h.

Vertical units may have temporal type

Parameters
map
Returns
int

Definition at line 231 of file headerinfo.c.

References RASTER3D_Map::vertical_unit.

◆ Rast3d_get_volume()

void Rast3d_get_volume ( void map,
double  originNorth,
double  originWest,
double  originBottom,
double  vxNorth,
double  vxWest,
double  vxBottom,
double  vyNorth,
double  vyWest,
double  vyBottom,
double  vzNorth,
double  vzWest,
double  vzBottom,
int  nx,
int  ny,
int  nz,
void volumeBuf,
int  type 
)

Definition at line 134 of file volume.c.

References Rast3d_get_volume_a().

Referenced by Rast3d_get_aligned_volume().

◆ Rast3d_get_volume_a()

void Rast3d_get_volume_a ( void map,
double  u[2][2][2][3],
int  nx,
int  ny,
int  nz,
void volumeBuf,
int  type 
)

◆ Rast3d_get_window()

void Rast3d_get_window ( RASTER3D_Region window)

Stores the current default window in window.

Parameters
window
Returns
void

Definition at line 55 of file raster3d/window.c.

References g3d_window, and Rast3d_region_copy().

Referenced by GVL_libinit(), N_read_rast3d_to_array_3d(), and N_write_array_3d_to_rast3d().

◆ Rast3d_get_window_map()

void Rast3d_get_window_map ( RASTER3D_Map map,
double north,
double south,
double east,
double west,
double top,
double bottom 
)

◆ Rast3d_get_window_params()

char * Rast3d_get_window_params ( void  )

Definition at line 133 of file param.c.

References G_store(), NULL, and RASTER3D_WINDOW_ELEMENT.

Referenced by Rast3d_init_defaults().

◆ Rast3d_get_window_value()

void Rast3d_get_window_value ( RASTER3D_Map map,
double  north,
double  east,
double  top,
void value,
int  type 
)

Returns in value the value of the map which corresponds to window coordinates (north, east, top). The value is resampled using the resampling function specified for map. The value is of type.

Parameters
map
north
east
top
value
type
Returns
void

Definition at line 91 of file getvalue.c.

References RASTER3D_Region::cols, RASTER3D_Region::depths, Rast3d_location2coord(), Rast3d_set_null_value(), RASTER3D_Map::resampleFun, RASTER3D_Region::rows, and RASTER3D_Map::window.

◆ Rast3d_gradient_double()

void Rast3d_gradient_double ( RASTER3D_Array_double array,
double step,
RASTER3D_Array_double grad_x,
RASTER3D_Array_double grad_y,
RASTER3D_Array_double grad_z 
)

Gradient computation.

Gradient computation (second order approximation) using central differencing scheme (plus forward and backward difference of second order approximation). When one or more of the cells, from which the gradient for a particular cell is computed, is null, gradient for that particular cell is set to 0.

Parameters
arraypointer to RASTER3D_Array with input values
steparray of x, y, z steps for gradient (resolution values)
[out]grad_xpointer to RASTER3D_Array_double with gradient in x direction
[out]grad_ypointer to RASTER3D_Array_double with gradient in y direction
[out]grad_zpointer to RASTER3D_Array_double with gradient in z direction

Definition at line 34 of file gradient.c.

References DCELL_TYPE, Rast_is_d_null_value, Rast_set_null_value(), RASTER3D_ARRAY_ACCESS, RASTER3D_Array_double::sx, RASTER3D_Array_double::sy, and RASTER3D_Array_double::sz.

◆ Rast3d_incorporate2d_region()

void Rast3d_incorporate2d_region ( struct Cell_head region2d,
RASTER3D_Region region3d 
)

Replaces the 2d portion of region3d with the values stored in region2d.

Parameters
region2d
region3d
Returns
void

Definition at line 83 of file region.c.

◆ Rast3d_init_cache()

int Rast3d_init_cache ( RASTER3D_Map map,
int  nCached 
)

Definition at line 221 of file cache.c.

References RASTER3D_Map::operation, Rast3d_error(), and RASTER3D_READ_DATA.

Referenced by Rast3d_fill_header().

◆ Rast3d_init_copy_from_xdr()

int Rast3d_init_copy_from_xdr ( RASTER3D_Map map,
int  dType 
)

◆ Rast3d_init_copy_to_xdr()

int Rast3d_init_copy_to_xdr ( RASTER3D_Map map,
int  sType 
)

◆ Rast3d_init_defaults()

void Rast3d_init_defaults ( void  )

Initializes the default values described in RASTER3D Defaults. Applications have to use this function only if they need to query the default values before the first file (either old or new) has been opened.

Returns
void

Definition at line 282 of file defaults.c.

References DCELL_TYPE, FCELL_TYPE, g3d_cache_default, g3d_cache_max, g3d_do_compression, g3d_error_fun, g3d_file_type, g3d_precision, g3d_tile_dimension, g3d_unit_default, g3d_vertical_unit_default, G_store(), NULL, Rast3d_fatal_error(), Rast3d_fatal_error_noargs(), Rast3d_get_window_params(), Rast3d_print_error(), Rast3d_read_window(), Rast3d_set_window(), RASTER3D_CACHE_SIZE_DEFAULT, RASTER3D_CACHE_SIZE_ENV_VAR, RASTER3D_CACHE_SIZE_MAX_DEFAULT, RASTER3D_CACHE_SIZE_MAX_ENV_VAR, RASTER3D_COMPRESSION, RASTER3D_COMPRESSION_DEFAULT, RASTER3D_COMPRESSION_ENV_VAR_NO, RASTER3D_COMPRESSION_ENV_VAR_YES, RASTER3D_DEFAULT_WINDOW3D, RASTER3D_ERROR_FUN_DEFAULT, RASTER3D_FATAL_ERROR_ENV_VAR, RASTER3D_FILE_DOUBLE_ENV_VAR, RASTER3D_FILE_FLOAT_ENV_VAR, RASTER3D_FILE_TYPE_DEFAULT, RASTER3D_MAX_PRECISION, RASTER3D_NO_COMPRESSION, RASTER3D_NO_DEFAULT, RASTER3D_PRECISION_DEFAULT, RASTER3D_PRECISION_ENV_VAR, RASTER3D_PRECISION_ENV_VAR_MAX, RASTER3D_PRINT_ERROR_ENV_VAR, RASTER3D_TILE_DIM_X_ENV_VAR, RASTER3D_TILE_DIM_Y_ENV_VAR, RASTER3D_TILE_DIM_Z_ENV_VAR, RASTER3D_TILE_X_DEFAULT, RASTER3D_TILE_Y_DEFAULT, RASTER3D_TILE_Z_DEFAULT, RASTER3D_UNIT_DEFAULT, RASTER3D_VERTICAL_UNIT_DEFAULT, and U_UNDEFINED.

Referenced by GVL_libinit(), Rast3d_get_standard3d_params(), Rast3d_open_cell_new(), Rast3d_open_cell_old_no_header(), Rast3d_open_new_opt_tile_size(), and Rast3d_open_new_param().

◆ Rast3d_init_fp_xdr()

◆ Rast3d_init_index()

◆ Rast3d_is_masked()

int Rast3d_is_masked ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Returns 1 if the cell with cell-coordinates (x, y, z) is masked out. Returns 0 otherwise.

Parameters
x
y
z
Returns
int

Definition at line 172 of file mask.c.

References FCELL_TYPE, Rast3d_is_null_value_num(), and x.

◆ Rast3d_is_null_value_num()

◆ Rast3d_is_valid_location()

int Rast3d_is_valid_location ( RASTER3D_Region region,
double  north,
double  east,
double  top 
)

Returns 1 if region-coordinates (north, east, top) are inside the region of map. Returns 0 otherwise.

Parameters
region
north
east
top
Returns
int

Definition at line 249 of file region.c.

References Cell_head::bottom, RASTER3D_Region::bottom, Cell_head::east, Cell_head::north, RASTER3D_Region::south, Cell_head::top, RASTER3D_Region::top, and RASTER3D_Region::west.

Referenced by Rast3d_location2coord2().

◆ Rast3d_is_xdr_null_double()

int Rast3d_is_xdr_null_double ( const double d)

Definition at line 31 of file fpxdr.c.

References Rast3d_is_xdr_null_num().

◆ Rast3d_is_xdr_null_float()

int Rast3d_is_xdr_null_float ( const float f)

Definition at line 24 of file fpxdr.c.

References Rast3d_is_xdr_null_num().

◆ Rast3d_is_xdr_null_num()

void int Rast3d_is_xdr_null_num ( const void num,
int  isFloat 
)

◆ Rast3d_key_get_double()

int Rast3d_key_get_double ( struct Key_Value keys,
const char key,
double d 
)

Definition at line 27 of file keys.c.

References G_find_key_value(), NULL, and Rast3d_error().

◆ Rast3d_key_get_int()

int Rast3d_key_get_int ( struct Key_Value keys,
const char key,
int i 
)

Definition at line 7 of file keys.c.

References G_find_key_value(), NULL, and Rast3d_error().

◆ Rast3d_key_get_string()

int Rast3d_key_get_string ( struct Key_Value keys,
const char key,
char **  returnStr 
)

Definition at line 48 of file keys.c.

References G_find_key_value(), G_store(), NULL, and Rast3d_error().

◆ Rast3d_key_get_value()

int Rast3d_key_get_value ( struct Key_Value keys,
const char key,
char val1,
char val2,
int  result1,
int  result2,
int resultVar 
)

Definition at line 66 of file keys.c.

References G_find_key_value(), NULL, and Rast3d_error().

◆ Rast3d_key_set_double()

int Rast3d_key_set_double ( struct Key_Value keys,
const char key,
const double d 
)

Definition at line 104 of file keys.c.

References G_set_key_value().

◆ Rast3d_key_set_int()

int Rast3d_key_set_int ( struct Key_Value keys,
const char key,
const int i 
)

Definition at line 93 of file keys.c.

References G_set_key_value().

◆ Rast3d_key_set_string()

int Rast3d_key_set_string ( struct Key_Value keys,
const char key,
char *const keyValStr 
)

Definition at line 116 of file keys.c.

References G_set_key_value().

◆ Rast3d_key_set_value()

int Rast3d_key_set_value ( struct Key_Value keys,
const char key,
const char val1,
const char val2,
int  keyval1,
int  keyval2,
const int keyvalVar 
)

Definition at line 125 of file keys.c.

References G_set_key_value(), and Rast3d_error().

◆ Rast3d_length()

◆ Rast3d_location2coord()

void Rast3d_location2coord ( RASTER3D_Region region,
double  north,
double  east,
double  top,
int x,
int y,
int z 
)

Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z).

Parameters
region
north
east
top
x
y
z
Returns
void

Definition at line 275 of file region.c.

References Cell_head::east, LOCATION_TO_COORD, Cell_head::north, Cell_head::top, and x.

Referenced by Rast3d_get_region_value(), Rast3d_get_window_value(), and Rast3d_nearest_neighbor().

◆ Rast3d_location2coord2()

void Rast3d_location2coord2 ( RASTER3D_Region region,
double  north,
double  east,
double  top,
int x,
int y,
int z 
)

Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z). This function calls Rast3d_fatal_error in case location is not in window.

Parameters
region
north
east
top
x
y
z
Returns
void

Definition at line 330 of file region.c.

References Cell_head::east, LOCATION_TO_COORD, Cell_head::north, Rast3d_fatal_error(), Rast3d_is_valid_location(), Cell_head::top, and x.

Referenced by Rast3d_get_volume_a().

◆ Rast3d_location2coord_double()

void Rast3d_location2coord_double ( RASTER3D_Region region,
double  north,
double  east,
double  top,
double x,
double y,
double z 
)

Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z).

Note: The results are double numbers. Casting them to int will give the column, row and depth number.

Parameters
region
north
east
top
x
y
z
Returns
void

Definition at line 305 of file region.c.

References Cell_head::east, G_debug(), LOCATION_TO_COORD, Cell_head::north, Cell_head::top, and x.

◆ Rast3d_lock_tile()

int Rast3d_lock_tile ( RASTER3D_Map map,
int  tileIndex 
)

Locks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles are unlocked, the lock request is ignored.

Parameters
map
tileIndex
Returns
1 ... if successful, -1 ... if request is ignored, 0 ... otherwise.

Definition at line 258 of file tileread.c.

References RASTER3D_Map::cache, Rast3d_cache_lock(), Rast3d_error(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.

◆ Rast3d_long_decode()

void Rast3d_long_decode ( unsigned char source,
long dst,
int  nofNums,
int  longNbytes 
)

Definition at line 35 of file long.c.

References Rast3d_fatal_error(), and RASTER3D_LONG_LENGTH.

Referenced by Rast3d_open_cell_old().

◆ Rast3d_long_encode()

int Rast3d_long_encode ( long source,
unsigned char dst,
int  nofNums 
)

Definition at line 5 of file long.c.

References RASTER3D_LONG_LENGTH, and RASTER3D_MIN.

Referenced by Rast3d_flush_index().

◆ Rast3d_make_aligned_volume_file()

◆ Rast3d_make_mapset_map_directory()

void Rast3d_make_mapset_map_directory ( const char mapName)

Definition at line 9 of file raster3d/mapset.c.

References G_make_mapset_dir_object(), and RASTER3D_DIRECTORY.

Referenced by Rast3d_open_cell_new(), and Rast3d_write_header().

◆ Rast3d_malloc()

void * Rast3d_malloc ( int  nBytes)

Same as malloc (nBytes), except that in case of error Rast3d_error() is invoked.

Parameters
nBytes
Returns
void *: a pointer ... if successful, NULL ... otherwise.

Definition at line 20 of file raster3d/alloc.c.

References malloc(), NULL, and Rast3d_error().

Referenced by Rast3d_alloc_tiles_type(), Rast3d_cache_hash_new(), Rast3d_cache_new(), Rast3d_fill_header(), Rast3d_flush_index(), Rast3d_init_fp_xdr(), Rast3d_init_index(), Rast3d_make_aligned_volume_file(), Rast3d_open_cell_new(), Rast3d_open_cell_old(), Rast3d_open_cell_old_no_header(), and Rast3d_set_standard3d_input_params().

◆ Rast3d_mask_close()

int Rast3d_mask_close ( void  )

Definition at line 37 of file mask.c.

References Rast3d_close(), and Rast3d_error().

Referenced by Rast3d_mask_reopen().

◆ Rast3d_mask_d_select()

int Rast3d_mask_d_select ( DCELL x,
d_Mask mask 
)

Definition at line 45 of file maskfn.c.

References NULL, Rast3d_mask_match_d_interval(), and x.

◆ Rast3d_mask_double()

void Rast3d_mask_double ( RASTER3D_Map map,
int  x,
int  y,
int  z,
double value 
)

Same as Rast3d_mask_num (x, y, z, value, DCELL_TYPE).

Parameters
map
x
y
z
value
Returns
void

Definition at line 241 of file mask.c.

References DCELL_TYPE, RASTER3D_MASKNUM, and x.

◆ Rast3d_mask_file()

const char * Rast3d_mask_file ( void  )

Returns the name of the 3d mask file.

Returns
char *

Definition at line 378 of file mask.c.

References RASTER3D_MASK_MAP.

◆ Rast3d_mask_file_exists()

int Rast3d_mask_file_exists ( void  )

Returns 1 if the 3d mask file exists.

Returns
int

Definition at line 63 of file mask.c.

References G_find_file_misc(), G_mapset(), NULL, RASTER3D_CELL_ELEMENT, RASTER3D_DIRECTORY, and RASTER3D_MASK_MAP.

Referenced by N_read_rast3d_to_array_3d(), N_write_array_3d_to_rast3d(), and Rast3d_mask_open_old().

◆ Rast3d_mask_float()

void Rast3d_mask_float ( RASTER3D_Map map,
int  x,
int  y,
int  z,
float value 
)

Same as Rast3d_mask_num (x, y, z, value, FCELL_TYPE).

Parameters
map
x
y
z
value
Returns
void

Definition at line 220 of file mask.c.

References FCELL_TYPE, RASTER3D_MASKNUM, and x.

◆ Rast3d_mask_is_off()

int Rast3d_mask_is_off ( RASTER3D_Map map)

Returns 1 if the mask for map is turned off. Returns 0 otherwise.

Parameters
map
Returns
int

Definition at line 366 of file mask.c.

References RASTER3D_Map::useMask.

Referenced by N_read_rast3d_to_array_3d(), N_write_array_3d_to_rast3d(), and Rast3d_read_tile().

◆ Rast3d_mask_is_on()

int Rast3d_mask_is_on ( RASTER3D_Map map)

Returns 1 if the mask for map is turned on. Returns 0 otherwise.

Parameters
map
Returns
int

Definition at line 353 of file mask.c.

References RASTER3D_Map::useMask.

Referenced by N_read_rast3d_to_array_3d(), and N_write_array_3d_to_rast3d().

◆ Rast3d_mask_map_exists()

int Rast3d_mask_map_exists ( void  )

Returns 1 if the 3d mask is loaded.

Returns
int

Definition at line 390 of file mask.c.

◆ Rast3d_mask_match_d_interval()

DCELL Rast3d_mask_match_d_interval ( DCELL  x,
d_Interval I 
)

Definition at line 58 of file maskfn.c.

References x.

Referenced by Rast3d_mask_d_select().

◆ Rast3d_mask_num()

void Rast3d_mask_num ( RASTER3D_Map map,
int  x,
int  y,
int  z,
void value,
int  type 
)

Replaces the value stored in value with the NULL-value if Rast3d_is_masked (x, y, z) returns 1. Does nothing otherwise. value is assumed to be oftype.

Parameters
map
x
y
z
value
type
Returns
void

Definition at line 198 of file mask.c.

References RASTER3D_MASKNUM, and x.

◆ Rast3d_mask_off()

void Rast3d_mask_off ( RASTER3D_Map map)

Turns off the mask for map. This is the default. Do not invoke this function after the first tile has been read since the result might be inconsistent cell-values.

Parameters
map
Returns
void

Definition at line 339 of file mask.c.

References RASTER3D_Map::useMask.

Referenced by N_read_rast3d_to_array_3d(), N_write_array_3d_to_rast3d(), Rast3d_open_cell_new(), and Rast3d_open_cell_old_no_header().

◆ Rast3d_mask_on()

void Rast3d_mask_on ( RASTER3D_Map map)

Turns on the mask for map. Do not invoke this function after the first tile has been read since the result might be inconsistent cell-values.

Parameters
map
Returns
void

Definition at line 324 of file mask.c.

References RASTER3D_Map::useMask.

Referenced by N_read_rast3d_to_array_3d(), and N_write_array_3d_to_rast3d().

◆ Rast3d_mask_open_old()

◆ Rast3d_mask_reopen()

int Rast3d_mask_reopen ( int  cache)

This function should be used to adjust the cache size used for the 3d-mask. First the open 3d-mask is closed and then opened again with a cache size as specified with cache.

Parameters
cache
Returns
1 ... if successful 0 ... otherwise.

Definition at line 135 of file mask.c.

References Rast3d_error(), Rast3d_mask_close(), and Rast3d_mask_open_old().

◆ Rast3d_mask_tile()

void Rast3d_mask_tile ( RASTER3D_Map map,
int  tileIndex,
void tile,
int  type 
)

Replaces the values stored in tile (with tileIndex) for which Rast3d_is_masked returns 1 with NULL-values. Does not change the remaining values. The values are assumed to be of type. Whether replacement is performed or not only depends on location of the cells of the tile and not on the status of the mask for map (i.e. turned on or off).

Parameters
map
tileIndex
tile
type
Returns
void

Definition at line 266 of file mask.c.

References Rast3d_compute_clipped_tile_dimensions(), Rast3d_get_tile_dimensions_map(), Rast3d_length(), Rast3d_tile_index_origin(), RASTER3D_MASKNUM, RASTER3D_Map::tileSize, RASTER3D_Map::tileX, and x.

Referenced by Rast3d_read_tile().

◆ Rast3d_min_unlocked()

void Rast3d_min_unlocked ( RASTER3D_Map map,
int  minUnlocked 
)

Sets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination with Rast3d_unlock_all () in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles. minUnlocked must be one of RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode() (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which explicitly specifies the number of tiles.

Parameters
map
minUnlocked
Returns
void

Definition at line 380 of file tileread.c.

References RASTER3D_Map::cache, Rast3d__compute_cache_size(), Rast3d_cache_set_min_unlock(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.

Referenced by Rast3d_compare_files().

◆ Rast3d_nearest_neighbor()

void Rast3d_nearest_neighbor ( RASTER3D_Map map,
int  x,
int  y,
int  z,
void value,
int  type 
)

The default resampling function which uses nearest neighbor resampling. This method converts the window coordinates x, y, and z into region coordinates and returned the nearest neighbor.

Parameters
map
x
y
z
value
type
Returns
void

Definition at line 22 of file resample.c.

References Rast3d_coord2location(), Rast3d_get_value_region(), Rast3d_location2coord(), RASTER3D_Map::region, RASTER3D_Map::window, and x.

Referenced by Rast3d_get_nearest_neighbor_fun_ptr().

◆ Rast3d_open_cell_new()

void * Rast3d_open_cell_new ( const char name,
int  typeIntern,
int  cache,
RASTER3D_Region region 
)

Opens new g3d-file with name in the current mapset. Tiles are stored in memory with type which must be one of FCELL_TYPE, DCELL_TYPE, or RASTER3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region. Returns a pointer to the cell structure ... if successful, NULL ... otherwise.

Parameters
name
typeIntern
cache
region
Returns
void *

Definition at line 210 of file raster3d/open.c.

References _, RASTER3D_Region::bottom, RASTER3D_Region::cols, compression, RASTER3D_Map::data_fd, DCELL_TYPE, RASTER3D_Region::depths, RASTER3D_Region::east, err(), RASTER3D_Region::ew_res, FCELL_TYPE, RASTER3D_Map::fileName, g3d_do_compression, g3d_file_type, g3d_precision, g3d_tile_dimension, g3d_unit_default, g3d_vertical_unit_default, G_mapset(), G_store(), G_tempfile(), G_unqualified_name(), G_warning(), GMAPSET_MAX, GNAME_MAX, RASTER3D_Map::indexLongNbytes, RASTER3D_Map::mapset, name, RASTER3D_Region::north, RASTER3D_Region::ns_res, NULL, open, RASTER3D_Region::proj, Rast3d_adjust_region(), Rast3d_error(), Rast3d_fill_header(), Rast3d_get_nearest_neighbor_fun_ptr(), Rast3d_init_defaults(), Rast3d_make_mapset_map_directory(), Rast3d_malloc(), Rast3d_mask_off(), Rast3d_mask_open_old(), Rast3d_range_init(), Rast3d_region_copy(), Rast3d_write_ints(), RASTER3D_HAS_INDEX, RASTER3D_MAP_VERSION, RASTER3D_MAX_PRECISION, RASTER3D_MIN, RASTER3D_NO_COMPRESSION, RASTER3D_NO_XDR, RASTER3D_WRITE_DATA, RASTER3D_Map::resampleFun, RASTER3D_Region::rows, RASTER3D_Region::south, RASTER3D_Region::tb_res, RASTER3D_Map::tempName, RASTER3D_Region::top, RASTER3D_Map::useXdr, RASTER3D_Region::west, RASTER3D_Map::window, write, and RASTER3D_Region::zone.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_make_aligned_volume_file(), Rast3d_open_new_opt_tile_size(), Rast3d_open_new_param(), and Rast3d_retile().

◆ Rast3d_open_cell_old()

void * Rast3d_open_cell_old ( const char name,
const char mapset,
RASTER3D_Region window,
int  typeIntern,
int  cache 
)

Opens existing g3d-file name in mapset. Tiles are stored in memory with type which must be any of FCELL_TYPE, DCELL_TYPE, or RASTER3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. window sets the window-region for the map. It is either a pointer to a window structure or RASTER3D_DEFAULT_WINDOW, which uses the window stored at initialization time or set via Rast3d_set_window () (cf.{g3d:G3d.setWindow}). To modify the window for the map after it has already been opened use Rast3d_set_window_map () (cf.{g3d:G3d.setWindowMap}). Returns a pointer to the cell structure ... if successful, NULL ... otherwise.

Parameters
name
mapset
window
typeIntern
cache
Returns
void *

Definition at line 82 of file raster3d/open.c.

References _, compression, RASTER3D_Map::data_fd, RASTER3D_Map::indexLongNbytes, RASTER3D_Map::indexNbytesUsed, RASTER3D_Map::indexOffset, name, NULL, RASTER3D_Region::proj, Rast3d_adjust_region(), Rast3d_error(), Rast3d_fatal_error(), Rast3d_fill_header(), Rast3d_free(), Rast3d_get_nearest_neighbor_fun_ptr(), Rast3d_long_decode(), Rast3d_malloc(), Rast3d_open_cell_old_no_header(), Rast3d_read_header(), Rast3d_read_ints(), Rast3d_region_copy(), Rast3d_window_ptr(), RASTER3D_DEFAULT_WINDOW, RASTER3D_READ_DATA, RASTER3D_TILE_SAME_AS_FILE, read, RASTER3D_Map::resampleFun, RASTER3D_Map::useXdr, RASTER3D_Map::window, and RASTER3D_Region::zone.

Referenced by N_read_rast3d_to_array_3d(), open_g3d_file(), Rast3d_compare_files(), and Rast3d_mask_open_old().

◆ Rast3d_open_cell_old_no_header()

◆ Rast3d_open_new_opt_tile_size()

void * Rast3d_open_new_opt_tile_size ( const char name,
int  cache,
RASTER3D_Region region,
int  type,
int  maxSize 
)

Opens new g3d-file with name in the current mapset. This method tries to compute optimal tile size based on the number of rows, cols and depths and the maximum allowed tile size in KB. Tiles are stored in memory using RASTER3D_TILE_SAME_AS_FILE method. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region. The map is created using the type which must be of FCELL_TYPE or DCELL_TYPE. Returns a pointer to the cell structure ... if successful, NULL ... otherwise.

Parameters
nameThe name of the map
cacheThe type of the caching
regionThe region of the map
typeThe type of the map (FCELL_TYPE, or DCELL_TYPE)
maxSizeThe maximum size of a tile in kilo bytes
Returns
void *

Definition at line 95 of file open2.c.

References G_debug(), name, Rast3d_compute_optimal_tile_dimension(), Rast3d_get_file_type(), Rast3d_get_tile_dimension(), Rast3d_init_defaults(), Rast3d_open_cell_new(), Rast3d_set_file_type(), Rast3d_set_tile_dimension(), and RASTER3D_TILE_SAME_AS_FILE.

Referenced by N_write_array_3d_to_rast3d().

◆ Rast3d_open_new_param()

void * Rast3d_open_new_param ( const char name,
int  typeIntern,
int  cache,
RASTER3D_Region region,
int  type,
int  compression,
int  precision,
int  tileX,
int  tileY,
int  tileZ 
)

Opens new g3d-file with name in the current mapset. Tiles are stored in memory with typeIntern which must be one of FCELL_TYPE, DCELL_TYPE, or RASTER3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either RASTER3D_NO_CACHE, RASTER3D_USE_CACHE_DEFAULT, RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode () (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region. The map is created using the type which must be of FCELL_TYPE or DCELL_TYPE. The methods for compression can be specified LZW or RLE. The digits of the floating point mantissa can be specified. In case of FCELL_TYPE 0-23 and 0-52 in case of DCELL_TYPE. The number cells in X, Y and Z direction defines the size of each tile. Returns a pointer to the cell structure ... if successful, NULL ... otherwise.

Parameters
nameThe name of the map
typeInternThe internal storage type for in memory cached tiles
cacheThe type of the caching
regionThe region of the map
typeThe type of the map (FCELL_TYPE, or DCELL_TYPE)
compression
doLzwUse the LZW compression algorithm
doRleUse the Run-Length-Encoding algorithm for compression
precisionThe precision used for the mantissa (0 - 52) or RASTER3D_MAX_PRECISION
tileXThe number of cells in X direction of a tile
tileYThe number of cells in Y direction of a tile
tileZThe number of cells in Z direction of a tile
Returns
void *

Definition at line 41 of file open2.c.

References compression, name, Rast3d_get_compression_mode(), Rast3d_get_file_type(), Rast3d_get_tile_dimension(), Rast3d_init_defaults(), Rast3d_open_cell_new(), Rast3d_set_compression_mode(), Rast3d_set_file_type(), and Rast3d_set_tile_dimension().

◆ Rast3d_parse_vallist()

void Rast3d_parse_vallist ( char **  vallist,
d_Mask **  d_mask 
)

Definition at line 100 of file maskfn.c.

References G_malloc, G_usage(), NULL, and x.

◆ Rast3d_print_error()

void Rast3d_print_error ( const char msg)

Prints error message.

This function prints the error message msg to stderr and returns.

Parameters
msg
Returns
void

Definition at line 32 of file raster3d/error.c.

Referenced by Rast3d_init_defaults().

◆ Rast3d_print_header()

◆ Rast3d_put_double()

int Rast3d_put_double ( RASTER3D_Map map,
int  x,
int  y,
int  z,
double  value 
)

Is equivalent to Rast3d_put_value (map, x, y, z, &value, DCELL_TYPE).

Parameters
map
x
y
z
value
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 51 of file putvalue.c.

References FCELL_TYPE, NULL, Rast3d_coord2tile_index(), Rast3d_error(), Rast3d_get_tile_ptr(), Rast3d_put_float(), RASTER3D_Map::typeIntern, and x.

Referenced by N_write_array_3d_to_rast3d(), Rast3d_put_float(), and Rast3d_put_value().

◆ Rast3d_put_float()

int Rast3d_put_float ( RASTER3D_Map map,
int  x,
int  y,
int  z,
float  value 
)

Is equivalent to Rast3d_put_value (map, x, y, z, &value, FCELL_TYPE).

Parameters
map
x
y
z
value
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 17 of file putvalue.c.

References DCELL_TYPE, NULL, Rast3d_coord2tile_index(), Rast3d_error(), Rast3d_get_tile_ptr(), Rast3d_put_double(), RASTER3D_Map::typeIntern, and x.

Referenced by N_write_array_3d_to_rast3d(), Rast3d_put_double(), and Rast3d_put_value().

◆ Rast3d_put_value()

int Rast3d_put_value ( RASTER3D_Map map,
int  x,
int  y,
int  z,
const void value,
int  type 
)

After converting *value of type into the type specified at the initialization time (i.e. typeIntern) this function writes the value into the tile buffer corresponding to cell-coordinate (x, y, z).

Parameters
map
x
y
z
value
type
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 89 of file putvalue.c.

References FCELL_TYPE, Rast3d_put_double(), Rast3d_put_float(), and x.

Referenced by Rast3d_make_aligned_volume_file(), and Rast3d_retile().

◆ Rast3d_range_init()

int Rast3d_range_init ( RASTER3D_Map map)

◆ Rast3d_range_load()

int Rast3d_range_load ( RASTER3D_Map map)

Loads the range into the range structure of map.

Parameters
mapa pointer to a raster 3D map object
Returns
1 ... if successful 0 ... otherwise.

Definition at line 108 of file raster3d/range.c.

References RASTER3D_Map::fileName, RASTER3D_Map::mapset, RASTER3D_Map::operation, RASTER3D_Map::range, Rast3d_read_range(), and RASTER3D_WRITE_DATA.

Referenced by open_g3d_file().

◆ Rast3d_range_min_max()

void Rast3d_range_min_max ( RASTER3D_Map map,
double min,
double max 
)

Returns in min and max the minimum and maximum values of the range.

Parameters
mapa pointer to a raster 3D map object
mina pointer to a double to store minumim
maxa pointer to a double to store maximum

Definition at line 129 of file raster3d/range.c.

References max, min, RASTER3D_Map::range, and Rast_get_fp_range_min_max().

Referenced by open_g3d_file(), and Rast3d_print_header().

◆ Rast3d_range_update_from_tile()

void Rast3d_range_update_from_tile ( RASTER3D_Map map,
const void tile,
int  rows,
int  cols,
int  depths,
int  xRedundant,
int  yRedundant,
int  zRedundant,
int  nofNum,
int  type 
)

◆ Rast3d_range_write()

int Rast3d_range_write ( RASTER3D_Map map)

Writes the range which is stored in the range structure of map. (This function is invoked automatically when a new file is closed).

Parameters
map
Returns
1 ... if successful 0 ... otherwise.

Definition at line 184 of file raster3d/range.c.

References RASTER3D_Map::fileName, GPATH_MAX, RASTER3D_Map::mapset, RASTER3D_Map::range, Rast3d_error(), Rast3d_filename(), and RASTER3D_RANGE_ELEMENT.

◆ Rast3d_read_cats()

int Rast3d_read_cats ( const char name,
const char mapset,
struct Categories pcats 
)

Reads the categories file for map name in mapset and stores the categories in the pcats structure. See Rast_read_cats (Raster_Category_File) for details and return values.

Parameters
name
mapset
pcats
Returns
int

Definition at line 173 of file raster3d/cats.c.

References G_warning(), and name.

◆ Rast3d_read_colors()

int Rast3d_read_colors ( const char name,
const char mapset,
struct Colors colors 
)

Reads color file for map name in mapset into the Colors structure.

Parameters
name3D raster map name
mapsetmapset name
colorscolors to be associated with a map
See also
Rast3d_write_colors, Rast_read_colors

Definition at line 44 of file raster3d/color.c.

References DEFAULT_COLOR_TABLE, err(), G_warning(), name, Rast3d_read_range(), Rast_get_fp_range_min_max(), Rast_init_colors(), Rast_is_d_null_value, Rast_make_fp_colors(), and Rast_mark_colors_as_fp().

Referenced by Gvl_load_colors_data().

◆ Rast3d_read_doubles()

int Rast3d_read_doubles ( int  fd,
int  useXdr,
double i,
int  nofNum 
)

◆ Rast3d_read_header()

int Rast3d_read_header ( RASTER3D_Map map,
int proj,
int zone,
double north,
double south,
double east,
double west,
double top,
double bottom,
int rows,
int cols,
int depths,
double ew_res,
double ns_res,
double tb_res,
int tileX,
int tileY,
int tileZ,
int type,
int compression,
int useRle,
int useLzw,
int precision,
int dataOffset,
int useXdr,
int hasIndex,
char **  unit,
int vertical_unit,
int version 
)

◆ Rast3d_read_history()

int Rast3d_read_history ( const char name,
const char mapset,
struct History hist 
)

read raster3d History file

This routine reads the History file for the raster3d file name in mapset into the History structure. A diagnostic message is printed and -1 is returned if there is an error reading the History file. Otherwise, 0 is returned. A warning message is printed if the file is incorrect.

Parameters
name
mapset
hist
Returns
int

Definition at line 62 of file raster3d/history.c.

References G_fopen_old_misc(), G_zero(), name, Rast__read_history(), RASTER3D_DIRECTORY, RASTER3D_HISTORY_ELEMENT, and SimpleErrorMessage().

◆ Rast3d_read_ints()

int Rast3d_read_ints ( int  fd,
int  useXdr,
int i,
int  nofNum 
)

◆ Rast3d_read_range()

◆ Rast3d_read_region_map()

int Rast3d_read_region_map ( const char name,
const char mapset,
RASTER3D_Region region 
)

◆ Rast3d_read_tile()

int Rast3d_read_tile ( RASTER3D_Map map,
int  tileIndex,
void tile,
int  type 
)

Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must be one of FCELL_TYPE and DCELL_TYPE. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index tile is filled with NULL-values.

Parameters
map
tileIndex
tile
type
Returns
1 ... if successful, 0 ... otherwise

Definition at line 150 of file tileread.c.

References RASTER3D_Map::compression, RASTER3D_Map::data_fd, RASTER3D_Map::index, RASTER3D_Map::nTiles, Rast3d_compute_clipped_tile_dimensions(), Rast3d_error(), Rast3d_fatal_error(), Rast3d_mask_is_off(), Rast3d_mask_tile(), Rast3d_set_null_tile_type(), and RASTER3D_NO_COMPRESSION.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_get_block_nocache(), Rast3d_get_tile_ptr(), Rast3d_read_tile_double(), and Rast3d_read_tile_float().

◆ Rast3d_read_tile_double()

int Rast3d_read_tile_double ( RASTER3D_Map map,
int  tileIndex,
void tile 
)

Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE).

Parameters
map
tileIndex
tile
Returns
int

Definition at line 230 of file tileread.c.

References DCELL_TYPE, Rast3d_error(), and Rast3d_read_tile().

◆ Rast3d_read_tile_float()

int Rast3d_read_tile_float ( RASTER3D_Map map,
int  tileIndex,
void tile 
)

Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE).

Parameters
map
tileIndex
tile
Returns
int

Definition at line 208 of file tileread.c.

References FCELL_TYPE, Rast3d_error(), and Rast3d_read_tile().

◆ Rast3d_read_window()

int Rast3d_read_window ( RASTER3D_Region window,
const char windowName 
)

Reads window from the file specified by windowName. The name is converted by the rules defined in window defaults. A NULL pointer indicates the WIND3 file in the current mapset.

Parameters
window
windowName
Returns
1 ... if successful 0 ... otherwise.

Definition at line 132 of file windowio.c.

References access, RASTER3D_Region::bottom, RASTER3D_Region::cols, RASTER3D_Region::depths, RASTER3D_Region::east, RASTER3D_Region::ew_res, G_free_key_value(), G_get_window(), G_read_key_value_file(), G_warning(), GPATH_MAX, RASTER3D_Region::north, RASTER3D_Region::ns_res, NULL, RASTER3D_Region::proj, R_OK, Rast3d_error(), RASTER3D_Region::rows, RASTER3D_Region::south, RASTER3D_Region::tb_res, RASTER3D_Region::top, RASTER3D_Region::west, and RASTER3D_Region::zone.

Referenced by GVL_init_region(), Rast3d_init_defaults(), and Rast3d_read_region_map().

◆ Rast3d_realloc()

void * Rast3d_realloc ( void ptr,
int  nBytes 
)

Same as realloc (ptr, nBytes), except that in case of error Rast3d_error() is invoked.

Parameters
ptr
nBytes
Returns
void *: a pointer ... if successful, NULL ... otherwise.

Definition at line 44 of file raster3d/alloc.c.

References NULL, and Rast3d_error().

Referenced by Rast3d_fill_header(), and Rast3d_init_fp_xdr().

◆ Rast3d_region_copy()

void Rast3d_region_copy ( RASTER3D_Region regionDest,
RASTER3D_Region regionSrc 
)

Copies the values of regionSrc into regionDst.

Parameters
regionDest
regionSrc
Returns
void

Definition at line 196 of file region.c.

Referenced by Rast3d_get_region_struct_map(), Rast3d_get_window(), Rast3d_getWindowStructMap(), Rast3d_open_cell_new(), Rast3d_open_cell_old(), Rast3d_set_window(), and Rast3d_set_window_map().

◆ Rast3d_region_from_to_cell_head()

void Rast3d_region_from_to_cell_head ( struct Cell_head region2d,
RASTER3D_Region region3d 
)

Replaces the 2d portion of region3d with the values stored in region2d.

Parameters
region2d
region3d
Returns
void

Definition at line 111 of file region.c.

Referenced by Rast3d_adjust_region(), and Rast3d_adjust_region_res().

◆ Rast3d_region_to_cell_head()

void Rast3d_region_to_cell_head ( RASTER3D_Region region3d,
struct Cell_head region2d 
)

Returns in region2d the 2d portion of region3d.

Parameters
region3d
region2d
Returns
void

Definition at line 45 of file region.c.

Referenced by N_init_geom_data_3d(), Rast3d_adjust_region(), and Rast3d_adjust_region_res().

◆ Rast3d_remove_color()

int Rast3d_remove_color ( const char name)

Removes the primary and/or secondary color file.

Todo:
Is primary and/or secondary color file still valid for 7?
See also
G_remove_colr

Definition at line 26 of file raster3d/color.c.

References G_remove_misc(), name, RASTER3D_COLOR_ELEMENT, and RASTER3D_DIRECTORY.

◆ Rast3d_retile()

void Rast3d_retile ( void map,
const char nameOut,
int  tileX,
int  tileY,
int  tileZ 
)

◆ Rast3d_rewrite_header()

◆ Rast3d_rle_count_only()

int Rast3d_rle_count_only ( char src,
int  nofElts,
int  eltLength 
)

Definition at line 141 of file rle.c.

References Rast3d_fatal_error().

◆ Rast3d_rle_decode()

void Rast3d_rle_decode ( char src,
char dst,
int  nofElts,
int  eltLength,
int lengthEncode,
int lengthDecode 
)

Definition at line 236 of file rle.c.

References Rast3d_fatal_error().

Referenced by Rast3d_fpcompress_read_xdr_nums().

◆ Rast3d_rle_encode()

void Rast3d_rle_encode ( char src,
char dst,
int  nofElts,
int  eltLength 
)

Definition at line 184 of file rle.c.

References Rast3d_fatal_error().

◆ Rast3d_set_cache_limit()

void Rast3d_set_cache_limit ( int  nBytes)

Set cache limit.

Parameters
nBytes
Returns
void

Definition at line 169 of file defaults.c.

References g3d_cache_max, and Rast3d_fatal_error().

◆ Rast3d_set_cache_size()

void Rast3d_set_cache_size ( int  nTiles)

set cache size

Parameters
nTiles
Returns
void

Definition at line 141 of file defaults.c.

References g3d_cache_default, and Rast3d_fatal_error().

◆ Rast3d_set_compression_mode()

void Rast3d_set_compression_mode ( int  doCompress,
int  precision 
)

set compression mode

doCompress should be one of RASTER3D_NO_COMPRESSION and RASTER3D_COMPRESSION. precision should be either RASTER3D_MAX_PRECISION or a positive integer.

Note
Note that older parameters doLzw and doRle (RASTER3D_NO_RLE or RASTER3D_USE_RLE) are no longer in the API.

Calls Rast3d_fatal_error() if a wrong parameter value is provided.

Parameters
doCompressspecifies if a compression should be performed
precisiona precision of compression

Definition at line 93 of file defaults.c.

References g3d_do_compression, g3d_precision, Rast3d_fatal_error(), RASTER3D_COMPRESSION, and RASTER3D_NO_COMPRESSION.

Referenced by Rast3d_change_precision(), and Rast3d_open_new_param().

◆ Rast3d_set_error_fun()

void Rast3d_set_error_fun ( void(*)(const char *)  fun)

set error function

Parameters
fun
Returns
void

Definition at line 267 of file defaults.c.

References g3d_error_fun.

◆ Rast3d_set_file_type()

void Rast3d_set_file_type ( int  type)

set G3d file type

Parameters
type
Returns
void

Definition at line 197 of file defaults.c.

References DCELL_TYPE, FCELL_TYPE, g3d_file_type, and Rast3d_fatal_error().

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_open_new_opt_tile_size(), Rast3d_open_new_param(), and Rast3d_retile().

◆ Rast3d_set_null_tile()

void Rast3d_set_null_tile ( RASTER3D_Map map,
void tile 
)

Is equivalent to Rast3d_set_null_tile_type (map, tile, Rast3d_file_type_map (map)).

Parameters
map
tile
Returns
void

Definition at line 38 of file tilenull.c.

References Rast3d_set_null_tile_type(), and RASTER3D_Map::typeIntern.

Referenced by Rast3d_get_block_nocache().

◆ Rast3d_set_null_tile_type()

void Rast3d_set_null_tile_type ( RASTER3D_Map map,
void tile,
int  type 
)

Assumes that tile is a tile with the same dimensions as the tiles of map. Fills tile with NULL-values of type.

Parameters
map
tile
type
Returns
void

Definition at line 21 of file tilenull.c.

References Rast3d_set_null_value(), and RASTER3D_Map::tileSize.

Referenced by Rast3d_read_tile(), and Rast3d_set_null_tile().

◆ Rast3d_set_null_value()

void Rast3d_set_null_value ( void c,
int  nofElts,
int  type 
)

Fills the vector pointed to by c with nofElts NULL-values of type.

Parameters
c
nofElts
type
Returns
void

Definition at line 33 of file null.c.

References FCELL_TYPE, Rast_set_d_null_value(), and Rast_set_f_null_value().

Referenced by N_copy_array_3d(), N_put_array_3d_value_null(), Rast3d_copy_from_xdr(), Rast3d_get_block(), Rast3d_get_double_region(), Rast3d_get_float_region(), Rast3d_get_region_value(), Rast3d_get_window_value(), and Rast3d_set_null_tile_type().

◆ Rast3d_set_resampling_fun()

void Rast3d_set_resampling_fun ( RASTER3D_Map map,
void(*)(RASTER3D_Map *, int, int, int, void *, int resampleFun 
)

Sets the resampling function to be used by Rast3d_get_value () (cf.{g3d:G3d.getValue}). This function is defined as follows:

Parameters
map
resampleFun
Returns
void

Definition at line 52 of file resample.c.

References RASTER3D_Map::resampleFun.

◆ Rast3d_set_standard3d_input_params()

void Rast3d_set_standard3d_input_params ( void  )

Initializes a parameter structure for the subset of command line arguments which lets the user overwrite the default properties of the new file. Applications are encouraged to use this function in order to provide a uniform style. The command line arguments provided are the type of the cell values, the precision, the properties of the compression, and the dimension of the tiles (tiledimension). Every of these values defaults to the value described in RASTER3D Defaults. This function has to be used in conjunction with Rast3d_getStandard3dInputParams() (cf.{g3d:G3d.getStandard3dInputParams}).

Returns
void

Definition at line 38 of file param.c.

References G_define_standard_option(), G_OPT_R3_COMPRESSION, G_OPT_R3_PRECISION, G_OPT_R3_TILE_DIMENSION, G_OPT_R3_TYPE, and Rast3d_malloc().

◆ Rast3d_set_tile_dimension()

void Rast3d_set_tile_dimension ( int  tileX,
int  tileY,
int  tileZ 
)

set Tile Dimension

Parameters
tileX
tileY
tileZ
Returns
void

Definition at line 227 of file defaults.c.

References g3d_tile_dimension, and Rast3d_fatal_error().

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_open_new_opt_tile_size(), Rast3d_open_new_param(), and Rast3d_retile().

◆ Rast3d_set_unit()

void Rast3d_set_unit ( RASTER3D_Map map,
const char unit 
)

Set the data unit defintiong.

Parameters
map
unit
Returns
void

Definition at line 166 of file headerinfo.c.

References G_store(), and RASTER3D_Map::unit.

◆ Rast3d_set_vertical_unit()

void Rast3d_set_vertical_unit ( RASTER3D_Map map,
const char vertical_unit 
)

set Vertical unit from string

Parameters
map
vertical_unit
Returns
void

Definition at line 198 of file headerinfo.c.

References G_units(), and RASTER3D_Map::vertical_unit.

◆ Rast3d_set_vertical_unit2()

void Rast3d_set_vertical_unit2 ( RASTER3D_Map map,
int  vertical_unit 
)

set Vertical unit from integer value defined in gis.h (U_METERS, ...)

Parameters
map
vertical_unit
Returns
void

Definition at line 182 of file headerinfo.c.

References RASTER3D_Map::vertical_unit.

◆ Rast3d_set_window()

void Rast3d_set_window ( RASTER3D_Region window)

Sets the default window used for every map opened later in the program. Can be used multiple times in the same program.

Parameters
window
Returns
void

Definition at line 39 of file raster3d/window.c.

References g3d_window, Rast3d_adjust_region(), and Rast3d_region_copy().

Referenced by Rast3d_init_defaults().

◆ Rast3d_set_window_map()

void Rast3d_set_window_map ( RASTER3D_Map map,
RASTER3D_Region window 
)

Sets the window for map to window. Can be used multiple times for the same map.

Parameters
map
window
Returns
void

Definition at line 22 of file raster3d/window.c.

References Rast3d_adjust_region(), Rast3d_region_copy(), and RASTER3D_Map::window.

Referenced by Rast3d_mask_open_old().

◆ Rast3d_set_window_params()

void Rast3d_set_window_params ( void  )

Definition at line 120 of file param.c.

References _, G_define_option(), NO, NULL, and TYPE_STRING.

Referenced by Rast3d_use_window_params().

◆ Rast3d_set_xdr_null_double()

void Rast3d_set_xdr_null_double ( double d)

Definition at line 49 of file fpxdr.c.

References Rast3d_set_xdr_null_num().

◆ Rast3d_set_xdr_null_float()

void Rast3d_set_xdr_null_float ( float f)

Definition at line 56 of file fpxdr.c.

References Rast3d_set_xdr_null_num().

◆ Rast3d_set_xdr_null_num()

void Rast3d_set_xdr_null_num ( void num,
int  isFloat 
)

◆ Rast3d_skip_error()

void Rast3d_skip_error ( const char msg)

This function ignores the error.

Parameters
msg
Returns
void

Definition at line 19 of file raster3d/error.c.

◆ Rast3d_tile2tile_index()

int Rast3d_tile2tile_index ( RASTER3D_Map map,
int  xTile,
int  yTile,
int  zTile 
)

Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).

Parameters
map
xTile
yTile
zTile
Returns
int

Definition at line 47 of file tilemath.c.

References RASTER3D_Map::nx, and RASTER3D_Map::nxy.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_coord2tile_index(), Rast3d_flush_tile_cube(), and Rast3d_get_block_nocache().

◆ Rast3d_tile_coord_origin()

void Rast3d_tile_coord_origin ( RASTER3D_Map map,
int  xTile,
int  yTile,
int  zTile,
int x,
int y,
int z 
)

Computes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tile-coordinates (xTile, yTile, zTile).

Parameters
map
xTile
yTile
zTile
x
y
z
Returns
void

Definition at line 70 of file tilemath.c.

References RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.

Referenced by Rast3d_tile_index_origin().

◆ Rast3d_tile_in_range()

int Rast3d_tile_in_range ( RASTER3D_Map map,
int  x,
int  y,
int  z 
)

Returns 1 if tile-coordinate (x, y, z) is a coordinate inside tile cube. Returns 0 otherwise.

Parameters
map
x
y
z
Returns
int

Definition at line 216 of file tilemath.c.

References RASTER3D_Map::nx, RASTER3D_Map::ny, RASTER3D_Map::nz, and x.

◆ Rast3d_tile_index2tile()

void Rast3d_tile_index2tile ( RASTER3D_Map map,
int  tileIndex,
int xTile,
int yTile,
int zTile 
)

Converts index tileIndex into tile-coordinates (xTile, yTile, zTile).

Parameters
map
tileIndex
xTile
yTile
zTile
Returns
void

Definition at line 22 of file tilemath.c.

References RASTER3D_Map::nx, and RASTER3D_Map::nxy.

Referenced by Rast3d_compute_clipped_tile_dimensions(), and Rast3d_tile_index_origin().

◆ Rast3d_tile_index_in_range()

int Rast3d_tile_index_in_range ( RASTER3D_Map map,
int  tileIndex 
)

Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise.

Parameters
map
tileIndex
Returns
int

Definition at line 196 of file tilemath.c.

Referenced by Rast3d_get_block_nocache().

◆ Rast3d_tile_index_origin()

void Rast3d_tile_index_origin ( RASTER3D_Map map,
int  tileIndex,
int x,
int y,
int z 
)

Computes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tileIndex.

Parameters
map
tileIndex
x
y
z
Returns
void

Definition at line 93 of file tilemath.c.

References Rast3d_tile_coord_origin(), Rast3d_tile_index2tile(), and x.

Referenced by Rast3d_mask_tile().

◆ Rast3d_tile_load()

int Rast3d_tile_load ( RASTER3D_Map map,
int  tileIndex 
)

Same functionality as Rast3d_get_tile_ptr() but does not return the pointer.

Parameters
map
tileIndex
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 121 of file tileio.c.

References NULL, Rast3d_error(), and Rast3d_get_tile_ptr().

◆ Rast3d_tile_precision_map()

int Rast3d_tile_precision_map ( RASTER3D_Map map)

Returns the precision used to store map.

Parameters
map
Returns
int

Definition at line 278 of file headerinfo.c.

References RASTER3D_Map::precision.

Referenced by Rast3d_compare_files().

◆ Rast3d_tile_type_map()

int Rast3d_tile_type_map ( RASTER3D_Map map)

Returns the type in which tiles of map are stored in memory.

Parameters
map
Returns
int

Definition at line 150 of file headerinfo.c.

References RASTER3D_Map::typeIntern.

Referenced by N_read_rast3d_to_array_3d(), Rast3d_change_precision(), Rast3d_change_type(), Rast3d_compare_files(), Rast3d_retile(), and Rast3d_write_ascii().

◆ Rast3d_tile_use_cache_map()

int Rast3d_tile_use_cache_map ( RASTER3D_Map map)

Returns 1 if map uses cache, returns 0 otherwise.

Parameters
map
Returns
int

Definition at line 293 of file headerinfo.c.

References RASTER3D_Map::useCache.

Referenced by Rast3d_compare_files(), and Rast3d_retile().

◆ Rast3d_unlock_all()

int Rast3d_unlock_all ( RASTER3D_Map map)

Unlocks every tile in cache of map.

Parameters
map
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 309 of file tileread.c.

References RASTER3D_Map::cache, Rast3d_cache_unlock_all(), Rast3d_error(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.

Referenced by Rast3d_begin_cycle(), and Rast3d_compare_files().

◆ Rast3d_unlock_tile()

int Rast3d_unlock_tile ( RASTER3D_Map map,
int  tileIndex 
)

Unlocks tile with tileIndex.

Parameters
map
tileIndex
Returns
1 ... if successful, 0 ... otherwise.

Definition at line 284 of file tileread.c.

References RASTER3D_Map::cache, Rast3d_cache_unlock(), Rast3d_error(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.

◆ Rast3d_use_window_params()

void Rast3d_use_window_params ( void  )

Writes window to the file specified by windowName. The name is converted by the rules defined in window defaults. A NULL pointer indicates the WIND3 file in the current mapset.

Parameters
window
windowName
Returns
1 ... if successful 0 ... otherwise.

Allows the window to be set at run-time via the region3 command line argument. This function has to be called before G_parser (). See also window defaults.

Returns
void

Definition at line 263 of file windowio.c.

References Rast3d_set_window_params().

◆ Rast3d_window_ptr()

RASTER3D_Region * Rast3d_window_ptr ( void  )

Definition at line 62 of file raster3d/window.c.

References g3d_window.

Referenced by Rast3d_open_cell_old().

◆ Rast3d_write_ascii()

void Rast3d_write_ascii ( void map,
const char fname 
)

Writes the cell-values of map in ascii format to file fname. The values are organized by horizontal slices.

Parameters
map
fname
Returns
void

Definition at line 18 of file writeascii.c.

References FCELL_TYPE, NULL, Rast3d_fatal_error(), Rast3d_get_coords_map(), Rast3d_get_value_region(), Rast3d_tile_type_map(), and x.

◆ Rast3d_write_cats()

int Rast3d_write_cats ( const char name,
struct Categories cats 
)

Writes the categories stored in the cats structure into the categories file for map name in the current mapset. See Rast_write_cats (Raster_Category_File) for details and return values.

Parameters
name
cats
Returns
int

Definition at line 25 of file raster3d/cats.c.

References Categories::a1, Categories::a2, Categories::fmt, G_fopen_new_misc(), G_trim_decimal(), Categories::m1, Categories::m2, name, NULL, Categories::num, Categories::q, Rast_get_ith_d_cat(), Rast_quant_nof_rules(), RASTER3D_CATS_ELEMENT, RASTER3D_DIRECTORY, and Categories::title.

◆ Rast3d_write_colors()

int Rast3d_write_colors ( const char name,
const char mapset,
struct Colors colors 
)

Writes the colors for map name in mapset into a color file.

Parameters
name3D raster map name
mapsetmapset name
colorscolors to be associated with a map
See also
Rast3d_read_colors, Rast3d_remove_color, Rast_write_colors

Definition at line 351 of file raster3d/color.c.

References _, G_fopen_new_misc(), G_mapset(), G_warning(), name, Rast__write_colors(), RASTER3D_COLOR_ELEMENT, and RASTER3D_DIRECTORY.

◆ Rast3d_write_doubles()

int Rast3d_write_doubles ( int  fd,
int  useXdr,
const double i,
int  nofNum 
)

◆ Rast3d_write_header()

int Rast3d_write_header ( RASTER3D_Map map,
int  proj,
int  zone,
double  north,
double  south,
double  east,
double  west,
double  top,
double  bottom,
int  rows,
int  cols,
int  depths,
double  ew_res,
double  ns_res,
double  tb_res,
int  tileX,
int  tileY,
int  tileZ,
int  type,
int  compression,
int  useRle,
int  useLzw,
int  precision,
int  dataOffset,
int  useXdr,
int  hasIndex,
char unit,
int  vertical_unit,
int  version 
)

◆ Rast3d_write_history()

int Rast3d_write_history ( const char name,
struct History hist 
)

write raster3d History file

This routine writes the History file for the raster3d file name in the current mapset from the History structure. A diagnostic message is printed and -1 is returned if there is an error writing the History file. Otherwise, 0 is returned. Note. The history structure should first be initialized using Rast_short_history.

Parameters
name
history
Returns
int

Definition at line 95 of file raster3d/history.c.

References G_fopen_new_misc(), name, Rast__write_history(), RASTER3D_DIRECTORY, and RASTER3D_HISTORY_ELEMENT.

◆ Rast3d_write_ints()

int Rast3d_write_ints ( int  fd,
int  useXdr,
const int i,
int  nofNum 
)

◆ Rast3d_write_tile()

int Rast3d_write_tile ( RASTER3D_Map map,
int  tileIndex,
const void tile,
int  type 
)

Writes tile with index tileIndex to the file corresponding to map. It is assumed that the cells in tile are of type which must be one of FCELL_TYPE and DCELL_TYPE. The actual type used to write the tile depends on the type specified at the time when map is initialized. A tile can only be written once. Subsequent attempts to write the same tile are ignored.

Parameters
map
tileIndex
tile
type
Returns
1 ... if successful, 2 ... if write request was ignored, 0 ... otherwise.

Definition at line 129 of file tilewrite.c.

References _, RASTER3D_Map::compression, RASTER3D_Map::data_fd, err(), G_fatal_error(), RASTER3D_Map::index, RASTER3D_Map::nTiles, Rast3d_compute_clipped_tile_dimensions(), Rast3d_error(), Rast3d_fatal_error(), Rast3d_range_update_from_tile(), RASTER3D_NO_COMPRESSION, and RASTER3D_Map::tileLength.

Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_flush_tile(), Rast3d_write_tile_double(), and Rast3d_write_tile_float().

◆ Rast3d_write_tile_double()

int Rast3d_write_tile_double ( RASTER3D_Map map,
int  tileIndex,
const void tile 
)

Is equivalent to Rast3d_write_tile (map, tileIndex, tile, DCELL_TYPE).

Parameters
map
tileIndex
tile
Returns
int

Definition at line 226 of file tilewrite.c.

References DCELL_TYPE, Rast3d_error(), and Rast3d_write_tile().

◆ Rast3d_write_tile_float()

int Rast3d_write_tile_float ( RASTER3D_Map map,
int  tileIndex,
const void tile 
)

Is equivalent to Rast3d_write_tile (map, tileIndex, tile, FCELL_TYPE).

Parameters
map
tileIndex
tile
Returns
int

Definition at line 202 of file tilewrite.c.

References FCELL_TYPE, Rast3d_error(), and Rast3d_write_tile().