GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-f9ed0ac2b
defs/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 *)
 
void * Rast3d_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 *)
 
void * Rast3d_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 *)
 
void * Rast3d_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 *)
 
void * Rast3d_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. More...
 
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. More...
 
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. More...
 
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)
 
void * Rast3d_malloc (int)
 Same as malloc (nBytes), except that in case of error Rast3d_error() is invoked. More...
 
void * Rast3d_realloc (void *, int)
 Same as realloc (ptr, nBytes), except that in case of error Rast3d_error() is invoked. More...
 
void Rast3d_free (void *)
 Same as free (ptr). More...
 
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. More...
 
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. More...
 
int Rast3d_close (RASTER3D_Map *)
 Close 3D raster map files. More...
 
int Rast3d_remove_color (const char *)
 Removes the primary and/or secondary color file. More...
 
int Rast3d_read_colors (const char *, const char *, struct Colors *)
 Reads color file for map name in mapset into the Colors structure. More...
 
int Rast3d_write_colors (const char *, const char *, struct Colors *)
 Writes the colors for map name in mapset into a color file. More...
 
void Rast3d_set_compression_mode (int, int)
 set compression mode More...
 
void Rast3d_get_compression_mode (int *, int *)
 Gets compression mode. More...
 
void Rast3d_set_cache_size (int)
 set cache size More...
 
int Rast3d_get_cache_size (void)
 get cache size More...
 
void Rast3d_set_cache_limit (int)
 Set cache limit. More...
 
int Rast3d_get_cache_limit (void)
 Get cache limit. More...
 
void Rast3d_set_file_type (int)
 set G3d file type More...
 
int Rast3d_get_file_type (void)
 get G3d file type More...
 
void Rast3d_set_tile_dimension (int, int, int)
 set Tile Dimension More...
 
void Rast3d_get_tile_dimension (int *, int *, int *)
 get Tile Dimension More...
 
void Rast3d_set_error_fun (void(*)(const char *))
 set error function More...
 
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. More...
 
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. More...
 
void Rast3d_print_error (const char *)
 Prints error message. More...
 
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. More...
 
int Rast3d_write_history (const char *, struct History *)
 write raster3d History file More...
 
int Rast3d_read_history (const char *, const char *, struct History *)
 read raster3d History file More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void Rast3d_mask_float (RASTER3D_Map *, int, int, int, float *)
 Same as Rast3d_mask_num (x, y, z, value, FCELL_TYPE). More...
 
void Rast3d_mask_double (RASTER3D_Map *, int, int, int, double *)
 Same as Rast3d_mask_num (x, y, z, value, DCELL_TYPE). More...
 
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). More...
 
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. More...
 
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. More...
 
int Rast3d_mask_is_on (RASTER3D_Map *)
 Returns 1 if the mask for map is turned on. Returns 0 otherwise. More...
 
int Rast3d_mask_is_off (RASTER3D_Map *)
 Returns 1 if the mask for map is turned off. Returns 0 otherwise. More...
 
const char * Rast3d_mask_file (void)
 Returns the name of the 3d mask file. More...
 
int Rast3d_mask_map_exists (void)
 Returns 1 if the 3d mask is loaded. More...
 
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. More...
 
void * Rast3d_open_new_param (const char *, int, int, RASTER3D_Region *, int, int, int, int, int, int)
 Opens new g3d-file with name in the current mapset. Tiles are stored in memory with typeIntern which 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. More...
 
void * Rast3d_open_cell_old_no_header (const char *, const char *)
 
void * Rast3d_open_cell_old (const char *, const char *, RASTER3D_Region *, int, int)
 Opens existing g3d-file name in mapset. Tiles are stored in memory with type which must be any of 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. More...
 
void * Rast3d_open_cell_new (const char *, int, int, RASTER3D_Region *)
 Opens new g3d-file with name in the current mapset. Tiles are stored in memory with type which must 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. More...
 
void * Rast3d_open_new_opt_tile_size (const char *, int, RASTER3D_Region *, int, int)
 Opens new g3d-file with name in the current mapset. This method tries to compute optimal tile size 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. More...
 
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}). More...
 
int Rast3d_get_standard3d_params (int *, int *, int *, int *, int *, int *, int *, int *, int *, int *)
 
void Rast3d_set_window_params (void)
 
char * Rast3d_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. More...
 
void Rast3d_range_min_max (RASTER3D_Map *, double *, double *)
 Returns in min and max the minimum and maximum values of the range. More...
 
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). More...
 
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). More...
 
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. More...
 
void Rast3d_region_copy (RASTER3D_Region *, RASTER3D_Region *)
 Copies the values of regionSrc into regionDst. More...
 
void Rast3d_incorporate2d_region (struct Cell_head *, RASTER3D_Region *)
 Replaces the 2d portion of region3d with the values stored in region2d. More...
 
void Rast3d_region_from_to_cell_head (struct Cell_head *, RASTER3D_Region *)
 Replaces the 2d portion of region3d with the values stored in region2d. More...
 
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. More...
 
void Rast3d_extract2d_region (RASTER3D_Region *, struct Cell_head *)
 Returns in region2d the 2d portion of region3d. More...
 
void Rast3d_region_to_cell_head (RASTER3D_Region *, struct Cell_head *)
 Returns in region2d the 2d portion of region3d. More...
 
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. More...
 
void Rast3d_location2coord (RASTER3D_Region *, double, double, double, int *, int *, int *)
 Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z). More...
 
void Rast3d_location2coord_double (RASTER3D_Region *, double, double, double, double *, double *, double *)
 Converts region-coordinates (north, east, top) into cell-coordinates (x, y, z). More...
 
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. More...
 
void Rast3d_coord2location (RASTER3D_Region *, double, double, double, double *, double *, double *)
 Converts cell-coordinates (x, y, z) into region-coordinates (north, east, top). More...
 
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. More...
 
void Rast3d_set_resampling_fun (RASTER3D_Map *, void(*)())
 Sets the resampling function to be used by Rast3d_get_value () (cf.{g3d:G3d.getValue}). This function is defined as follows: More...
 
void Rast3d_get_resampling_fun (RASTER3D_Map *, void(**)())
 Returns in resampleFun a pointer to the resampling function used by map. More...
 
void Rast3d_get_nearest_neighbor_fun_ptr (void(**)())
 Returns in nnFunPtr a pointer to Rast3d_nearest_neighbor () (cf.{g3d:G3d.nearestNeighbor}). More...
 
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. More...
 
float Rast3d_get_float (RASTER3D_Map *, int, int, int)
 Is equivalent to Rast3d_get_value (map, x, y, z, &value, FCELL_TYPE); return value. More...
 
double Rast3d_get_double (RASTER3D_Map *, int, int, int)
 Is equivalent to Rast3d_get_value (map, x, y, z, &value, DCELL_TYPE); return value. More...
 
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. More...
 
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. More...
 
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. More...
 
void Rast3d_get_window (RASTER3D_Region *)
 Stores the current default window in window. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void Rast3d_get_region_map (RASTER3D_Map *, double *, double *, double *, double *, double *, double *)
 Returns the size of the region. More...
 
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. More...
 
int Rast3d_tile_type_map (RASTER3D_Map *)
 Returns the type in which tiles of map are stored in memory. More...
 
int Rast3d_file_type_map (RASTER3D_Map *)
 Returns the type with which tiles of map are stored on file. More...
 
int Rast3d_tile_precision_map (RASTER3D_Map *)
 Returns the precision used to store map. More...
 
int Rast3d_tile_use_cache_map (RASTER3D_Map *)
 Returns 1 if map uses cache, returns 0 otherwise. More...
 
void Rast3d_print_header (RASTER3D_Map *)
 Prints the header information of map. More...
 
void Rast3d_get_region_struct_map (RASTER3D_Map *, RASTER3D_Region *)
 Returns in region the region of map. More...
 
const char * Rast3d_get_unit (RASTER3D_Map *map)
 Return the data unit definition of map. More...
 
int Rast3d_get_vertical_unit2 (RASTER3D_Map *map)
 Returns the vertical unit of map as integer. Units are defined in gis.h. More...
 
const char * Rast3d_get_vertical_unit (RASTER3D_Map *map)
 Return the name of the unit of map. Units are defined in gis.h. More...
 
void Rast3d_set_unit (RASTER3D_Map *map, const char *)
 Set the data unit defintiong. More...
 
void Rast3d_set_vertical_unit (RASTER3D_Map *map, const char *)
 set Vertical unit from string More...
 
void Rast3d_set_vertical_unit2 (RASTER3D_Map *map, int)
 set Vertical unit from integer value defined in gis.h (U_METERS, ...) More...
 
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. More...
 
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 *)
 
void * Rast3d_alloc_tiles_type (RASTER3D_Map *, int, int)
 Allocates a vector of nofTiles tiles with the same dimensions as the tiles of map and large enough to store cell-values of type. More...
 
void * Rast3d_alloc_tiles (RASTER3D_Map *, int)
 Is equivalent to Rast3d_alloc_tiles_type (map, nofTiles, Rast3d_file_type_map (map)). More...
 
void Rast3d_free_tiles (void *)
 Is equivalent to Rast3d_free (tiles); More...
 
void * Rast3d_get_tile_ptr (RASTER3D_Map *, int)
 This function returns a pointer to a tile which contains the data for the tile with index tileIndex. 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.
More...
 
int Rast3d_tile_load (RASTER3D_Map *, int)
 Same functionality as Rast3d_get_tile_ptr() but does not return the pointer. More...
 
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. More...
 
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. More...
 
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. More...
 
void Rast3d_compute_optimal_tile_dimension (RASTER3D_Region *, int, int *, int *, int *, int)
 Compute the optimal tile size. More...
 
void Rast3d_tile_index2tile (RASTER3D_Map *, int, int *, int *, int *)
 Converts index tileIndex into tile-coordinates (xTile, yTile, zTile). More...
 
int Rast3d_tile2tile_index (RASTER3D_Map *, int, int, int)
 Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile). More...
 
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). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int Rast3d_tile_index_in_range (RASTER3D_Map *, int)
 Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise. More...
 
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. More...
 
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. More...
 
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. More...
 
void Rast3d_set_null_tile (RASTER3D_Map *, void *)
 Is equivalent to Rast3d_set_null_tile_type (map, tile, Rast3d_file_type_map (map)). More...
 
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. More...
 
int Rast3d_read_tile_float (RASTER3D_Map *, int, void *)
 Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE). More...
 
int Rast3d_read_tile_double (RASTER3D_Map *, int, void *)
 Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE). More...
 
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. More...
 
int Rast3d_unlock_tile (RASTER3D_Map *, int)
 Unlocks tile with tileIndex. More...
 
int Rast3d_unlock_all (RASTER3D_Map *)
 Unlocks every tile in cache of map. More...
 
void Rast3d_autolock_on (RASTER3D_Map *)
 Turns autolock mode on. More...
 
void Rast3d_autolock_off (RASTER3D_Map *)
 Turns autolock mode Off. More...
 
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. More...
 
int Rast3d_begin_cycle (RASTER3D_Map *)
 Starts a new cycle. More...
 
int Rast3d_end_cycle (RASTER3D_Map *)
 Ends a cycle. More...
 
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. More...
 
int Rast3d_write_tile_float (RASTER3D_Map *, int, const void *)
 Is equivalent to Rast3d_write_tile (map, tileIndex, tile, FCELL_TYPE). More...
 
int Rast3d_write_tile_double (RASTER3D_Map *, int, const void *)
 Is equivalent to Rast3d_write_tile (map, tileIndex, tile, DCELL_TYPE). More...
 
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 invokation of Rast3d_flush_tile, a tile filled with NULL-values is written. More...
 
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. More...
 
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. More...
 
int Rast3d_put_float (RASTER3D_Map *, int, int, int, float)
 Is equivalent to Rast3d_put_value (map, x, y, z, &value, FCELL_TYPE). More...
 
int Rast3d_put_double (RASTER3D_Map *, int, int, int, double)
 Is equivalent to Rast3d_put_value (map, x, y, z, &value, DCELL_TYPE). More...
 
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). More...
 
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. More...
 

Function Documentation

◆ __attribute__()

void __attribute__ ( (noreturn)  )

◆ Rast3d__compute_cache_size()

◆ Rast3d__remove_tile()

int Rast3d__remove_tile ( RASTER3D_Map ,
int   
)

◆ 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 151 of file region.c.

◆ 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 177 of file region.c.

◆ 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 50 of file tilealloc.c.

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

◆ 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 24 of file tilealloc.c.

Referenced by Rast3d_alloc_tiles().

◆ Rast3d_autolock_off()

void Rast3d_autolock_off ( RASTER3D_Map map)

Turns autolock mode Off.

Parameters
map
Returns
void

Definition at line 357 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 337 of file tileread.c.

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

Referenced by Rast3d_begin_cycle().

◆ 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 408 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 )

Definition at line 359 of file cache1.c.

References RASTER3D_cache::autoLock.

Referenced by Rast3d_autolock_off().

◆ Rast3d_cache_autolock_on()

void Rast3d_cache_autolock_on ( RASTER3D_cache )

Definition at line 352 of file cache1.c.

References RASTER3D_cache::autoLock.

Referenced by Rast3d_autolock_on().

◆ Rast3d_cache_dispose()

void Rast3d_cache_dispose ( RASTER3D_cache )

Definition at line 65 of file cache1.c.

◆ Rast3d_cache_elt_ptr()

◆ Rast3d_cache_flush()

int Rast3d_cache_flush ( RASTER3D_cache ,
int   
)

Definition at line 420 of file cache1.c.

Referenced by Rast3d_cache_flush_all().

◆ Rast3d_cache_flush_all()

int Rast3d_cache_flush_all ( RASTER3D_cache )

◆ Rast3d_cache_get_elt()

int Rast3d_cache_get_elt ( RASTER3D_cache ,
int  ,
void *   
)

Definition at line 527 of file cache1.c.

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

◆ Rast3d_cache_hash_dispose()

void Rast3d_cache_hash_dispose ( Rast3d_cache_hash )

Definition at line 37 of file cachehash.c.

◆ Rast3d_cache_hash_load_name()

void Rast3d_cache_hash_load_name ( Rast3d_cache_hash ,
int  ,
int   
)

Definition at line 92 of file cachehash.c.

Referenced by Rast3d_cache_elt_ptr().

◆ Rast3d_cache_hash_name2index()

int Rast3d_cache_hash_name2index ( Rast3d_cache_hash ,
int   
)

Definition at line 106 of file cachehash.c.

Referenced by Rast3d_cache_elt_ptr(), Rast3d_cache_lock(), and Rast3d_cache_unlock().

◆ Rast3d_cache_hash_new()

void* Rast3d_cache_hash_new ( int  )

Definition at line 51 of file cachehash.c.

◆ Rast3d_cache_hash_remove_name()

void Rast3d_cache_hash_remove_name ( Rast3d_cache_hash ,
int   
)

Definition at line 77 of file cachehash.c.

Referenced by Rast3d_cache_elt_ptr().

◆ Rast3d_cache_hash_reset()

void Rast3d_cache_hash_reset ( Rast3d_cache_hash )

Definition at line 25 of file cachehash.c.

◆ Rast3d_cache_load()

int Rast3d_cache_load ( RASTER3D_cache ,
int   
)

Definition at line 515 of file cache1.c.

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

◆ Rast3d_cache_lock()

int Rast3d_cache_lock ( RASTER3D_cache ,
int   
)

◆ Rast3d_cache_lock_all()

int Rast3d_cache_lock_all ( RASTER3D_cache )

Definition at line 339 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 ,
int   
)

Definition at line 291 of file cache1.c.

References IS_LOCKED_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  ,
int  ,
int  ,
read_fn ,
void *   
)

Definition at line 161 of file cache1.c.

References Rast3d_cache_new().

◆ Rast3d_cache_put_elt()

int Rast3d_cache_put_elt ( RASTER3D_cache ,
int  ,
const void *   
)

Definition at line 544 of file cache1.c.

◆ Rast3d_cache_remove_all()

int Rast3d_cache_remove_all ( RASTER3D_cache )

◆ Rast3d_cache_remove_elt()

int Rast3d_cache_remove_elt ( RASTER3D_cache ,
int   
)

Definition at line 408 of file cache1.c.

Referenced by Rast3d__remove_tile(), and Rast3d_cache_remove_all().

◆ Rast3d_cache_reset()

void Rast3d_cache_reset ( RASTER3D_cache )

Definition at line 34 of file cache1.c.

◆ 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 ,
int   
)

Definition at line 366 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 251 of file raster3d/header.c.

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

◆ Rast3d_cache_unlock()

int Rast3d_cache_unlock ( RASTER3D_cache ,
int   
)

◆ Rast3d_cache_unlock_all()

int Rast3d_cache_unlock_all ( RASTER3D_cache )

◆ Rast3d_change_precision()

void Rast3d_change_precision ( void *  map,
int  precision,
const char *  nameOut 
)

Makes a copy of map with name nameOut which is written with precision. The source code can be found in changeprecision.c.

Parameters
map
precision
nameOut
Returns
void

Definition at line 23 of file changeprecision.c.

References x.

◆ Rast3d_change_type()

void Rast3d_change_type ( void *  map,
const char *  nameOut 
)

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.

Parameters
map
nameOut
Returns
void

Definition at line 24 of file changetype.c.

References x.

◆ Rast3d_close()

int Rast3d_close ( RASTER3D_Map map)

Close 3D raster map files.

Closes g3d-file. If map is new and cache-mode is used for map then every tile which is not flushed before closing is flushed.

Parameters
mappointer to RASTER3D_Map to be closed
Returns
1 success
0 failure

Definition at line 149 of file raster3d/close.c.

References RASTER3D_Map::operation, and RASTER3D_WRITE_DATA.

Referenced by close_g3d_file().

◆ 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 364 of file filecompare.c.

References NULL, Rast3d_fatal_error(), Rast3d_get_coords_map(), Rast3d_get_nof_tiles_map(), Rast3d_get_tile_dimensions_map(), Rast3d_open_cell_old(), Rast3d_print_header(), Rast3d_tile_precision_map(), Rast3d_tile_type_map(), Rast3d_tile_use_cache_map(), 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 267 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_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 332 of file tilemath.c.

◆ 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 392 of file region.c.

◆ 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 136 of file tilemath.c.

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

Referenced by Rast3d_coord2tile_index(), and Rast3d_flush_tiles_in_cube().

◆ 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 167 of file tilemath.c.

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

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 195 of file tilemath.c.

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

◆ Rast3d_copy_double2Float()

void Rast3d_copy_double2Float ( const double *  ,
int  ,
float *  ,
int  ,
int   
)

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

◆ Rast3d_copy_float2Double()

void Rast3d_copy_float2Double ( const float *  ,
int  ,
double *  ,
int  ,
int   
)

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

◆ Rast3d_copy_from_xdr()

int Rast3d_copy_from_xdr ( int  ,
void *   
)

Definition at line 225 of file fpxdr.c.

◆ Rast3d_copy_to_xdr()

int Rast3d_copy_to_xdr ( const void *  ,
int   
)

Definition at line 143 of file fpxdr.c.

◆ Rast3d_copy_values()

void Rast3d_copy_values ( const void *  ,
int  ,
int  ,
void *  ,
int  ,
int  ,
int   
)

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

◆ Rast3d_dispose_cache()

int Rast3d_dispose_cache ( RASTER3D_Map )

Definition at line 245 of file cache.c.

References RASTER3D_Map::operation, and RASTER3D_READ_DATA.

◆ Rast3d_end_cycle()

int Rast3d_end_cycle ( RASTER3D_Map map)

Ends a cycle.

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

Definition at line 432 of file tileread.c.

References Rast3d_autolock_off().

◆ Rast3d_error()

◆ Rast3d_extern_length()

int Rast3d_extern_length ( int  )

◆ Rast3d_extract2d_region()

◆ Rast3d_fatal_error()

◆ Rast3d_fatal_error_noargs()

void Rast3d_fatal_error_noargs ( const char *  )

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

◆ 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 281 of file headerinfo.c.

References RASTER3D_Map::type.

◆ Rast3d_filename()

void Rast3d_filename ( char *  ,
const char *  ,
const char *  ,
const char *   
)

Definition at line 10 of file filename.c.

References G_file_name_misc(), and RASTER3D_DIRECTORY.

Referenced by Rast3d_range_write().

◆ Rast3d_fill_header()

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   
)

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

◆ Rast3d_flush_all_tiles()

◆ Rast3d_flush_index()

int Rast3d_flush_index ( RASTER3D_Map )

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

◆ 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 invokation of Rast3d_flush_tile, a tile filled with NULL-values is written.

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

Definition at line 254 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 306 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 352 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 *  )

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 *  ,
int   
)

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  ,
char *  ,
int  ,
int  ,
int  ,
char *  ,
int   
)

Definition at line 720 of file fpcompress.c.

◆ Rast3d_fpcompress_write_xdr_nums()

int Rast3d_fpcompress_write_xdr_nums ( int  ,
char *  ,
int  ,
int  ,
char *  ,
int   
)

Definition at line 690 of file fpcompress.c.

◆ Rast3d_free()

void Rast3d_free ( void *  buf)

Same as free (ptr).

Parameters
buf
Returns
void

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

References free().

Referenced by Rast3d_free_tiles().

◆ Rast3d_free_tiles()

void Rast3d_free_tiles ( void *  tiles)

Is equivalent to Rast3d_free (tiles);

Parameters
tiles
Returns
void

Definition at line 75 of file tilealloc.c.

References Rast3d_free().

◆ Rast3d_g3d_type2cell_type()

int Rast3d_g3d_type2cell_type ( int  )

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

References DCELL_TYPE, and FCELL_TYPE.

◆ Rast3d_get_aligned_volume()

void Rast3d_get_aligned_volume ( void *  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
int  ,
int  ,
int  ,
void *  ,
int   
)

Definition at line 186 of file volume.c.

◆ 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 105 of file getblock.c.

◆ Rast3d_get_block_nocache()

void Rast3d_get_block_nocache ( RASTER3D_Map ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
void *  ,
int   
)

Definition at line 12 of file getblock.c.

◆ Rast3d_get_cache_limit()

int Rast3d_get_cache_limit ( void  )

Get cache limit.

Returns
int

Definition at line 195 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 163 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 128 of file defaults.c.

References g3d_do_compression, g3d_precision, and NULL.

◆ 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 19 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(), and Rast3d_write_ascii().

◆ Rast3d_get_coords_map_window()

void Rast3d_get_coords_map_window ( RASTER3D_Map ,
int *  ,
int *  ,
int *   
)

◆ 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 66 of file getvalue.c.

References DCELL_TYPE, and Rast3d_get_value().

◆ 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 207 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, and RASTER3D_Map::typeIntern.

Referenced by Rast3d_get_float_region().

◆ Rast3d_get_file_type()

int Rast3d_get_file_type ( void  )

get G3d file type

Returns
int

Definition at line 227 of file defaults.c.

References g3d_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 43 of file getvalue.c.

References FCELL_TYPE, and Rast3d_get_value().

◆ 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 165 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, and RASTER3D_Map::typeIntern.

Referenced by Rast3d_get_double_region().

◆ Rast3d_get_nearest_neighbor_fun_ptr()

void Rast3d_get_nearest_neighbor_fun_ptr ( void(**)()  nnFunPtr)

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

Returns
void

Definition at line 90 of file resample.c.

References Rast3d_nearest_neighbor().

◆ 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 51 of file headerinfo.c.

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

Referenced by 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 77 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 115 of file headerinfo.c.

◆ 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 131 of file getvalue.c.

◆ Rast3d_get_resampling_fun()

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

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

Returns
void

Definition at line 73 of file resample.c.

References RASTER3D_Map::resampleFun.

◆ Rast3d_get_standard3d_params()

int Rast3d_get_standard3d_params ( int *  ,
int *  ,
int *  ,
int *  ,
int *  ,
int *  ,
int *  ,
int *  ,
int *  ,
int *   
)

Definition at line 56 of file param.c.

◆ 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 271 of file defaults.c.

References g3d_tile_dimension.

◆ 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 142 of file headerinfo.c.

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

Referenced by Rast3d_compare_files().

◆ 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_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 228 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 22 of file getvalue.c.

Referenced by 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 256 of file getvalue.c.

Referenced by 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 264 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 246 of file headerinfo.c.

References RASTER3D_Map::vertical_unit.

◆ Rast3d_get_volume()

void Rast3d_get_volume ( void *  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
int  ,
int  ,
int  ,
void *  ,
int   
)

Definition at line 139 of file volume.c.

◆ Rast3d_get_volume_a()

void Rast3d_get_volume_a ( void *  ,
double  [2][2][2][3],
int  ,
int  ,
int  ,
void *  ,
int   
)

Definition at line 46 of file volume.c.

◆ Rast3d_get_window()

void Rast3d_get_window ( RASTER3D_Region window)

Stores the current default window in window.

Parameters
window
Returns
void

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

Referenced by GVL_libinit().

◆ Rast3d_get_window_map()

void Rast3d_get_window_map ( RASTER3D_Map ,
double *  ,
double *  ,
double *  ,
double *  ,
double *  ,
double *   
)

◆ Rast3d_get_window_params()

char* Rast3d_get_window_params ( void  )

Definition at line 134 of file param.c.

References Option::answer, G_store(), NULL, and RASTER3D_WINDOW_ELEMENT.

◆ 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 94 of file getvalue.c.

◆ 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.

◆ Rast3d_incorporate2d_region()

void Rast3d_incorporate2d_region ( struct Cell_head region2d,
RASTER3D_Region region3d 
)

◆ Rast3d_init_cache()

int Rast3d_init_cache ( RASTER3D_Map ,
int   
)

Definition at line 217 of file cache.c.

References RASTER3D_Map::operation, and RASTER3D_READ_DATA.

◆ Rast3d_init_copy_from_xdr()

int Rast3d_init_copy_from_xdr ( RASTER3D_Map ,
int   
)

Definition at line 186 of file fpxdr.c.

◆ Rast3d_init_copy_to_xdr()

int Rast3d_init_copy_to_xdr ( RASTER3D_Map ,
int   
)

Definition at line 104 of file fpxdr.c.

◆ 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 305 of file defaults.c.

Referenced by GVL_libinit(), and Rast3d_open_cell_old_no_header().

◆ 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 173 of file mask.c.

◆ Rast3d_is_null_value_num()

int Rast3d_is_null_value_num ( const void *  ,
int   
)

Definition at line 12 of file null.c.

Referenced by N_copy_array_3d(), and Rast3d_print_header().

◆ 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 263 of file region.c.

◆ Rast3d_is_xdr_null_double()

int Rast3d_is_xdr_null_double ( const double *  )

Definition at line 31 of file fpxdr.c.

◆ Rast3d_is_xdr_null_float()

int Rast3d_is_xdr_null_float ( const float *  )

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 *  ,
int   
)

Definition at line 13 of file fpxdr.c.

Referenced by Rast3d_is_xdr_null_float().

◆ Rast3d_key_get_double()

int Rast3d_key_get_double ( struct Key_Value ,
const char *  ,
double *   
)

Definition at line 26 of file keys.c.

◆ Rast3d_key_get_int()

int Rast3d_key_get_int ( struct Key_Value ,
const char *  ,
int *   
)

Definition at line 7 of file keys.c.

◆ Rast3d_key_get_string()

int Rast3d_key_get_string ( struct Key_Value ,
const char *  ,
char **   
)

Definition at line 47 of file keys.c.

◆ Rast3d_key_get_value()

int Rast3d_key_get_value ( struct Key_Value ,
const char *  ,
char *  ,
char *  ,
int  ,
int  ,
int *   
)

Definition at line 64 of file keys.c.

◆ Rast3d_key_set_double()

int Rast3d_key_set_double ( struct Key_Value ,
const char *  ,
const double *   
)

Definition at line 102 of file keys.c.

◆ Rast3d_key_set_int()

int Rast3d_key_set_int ( struct Key_Value ,
const char *  ,
const int *   
)

Definition at line 91 of file keys.c.

◆ Rast3d_key_set_string()

int Rast3d_key_set_string ( struct Key_Value ,
const char *  ,
char *const *   
)

Definition at line 114 of file keys.c.

◆ Rast3d_key_set_value()

int Rast3d_key_set_value ( struct Key_Value ,
const char *  ,
const char *  ,
const char *  ,
int  ,
int  ,
const int *   
)

Definition at line 124 of file keys.c.

◆ Rast3d_length()

int Rast3d_length ( int  )

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

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

◆ 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 290 of file region.c.

◆ 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 347 of file region.c.

◆ 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 321 of file region.c.

◆ 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 259 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 *  ,
long *  ,
int  ,
int   
)

Definition at line 36 of file long.c.

References dest.

◆ Rast3d_long_encode()

int Rast3d_long_encode ( long *  ,
unsigned char *  ,
int   
)

Definition at line 5 of file long.c.

◆ Rast3d_make_aligned_volume_file()

void Rast3d_make_aligned_volume_file ( void *  ,
const char *  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
int  ,
int  ,
int   
)

Definition at line 203 of file volume.c.

References x.

◆ Rast3d_make_mapset_map_directory()

void Rast3d_make_mapset_map_directory ( const char *  )

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

References G_make_mapset_element(), GNAME_MAX, and RASTER3D_DIRECTORY.

◆ 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 22 of file raster3d/alloc.c.

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

Referenced by Rast3d_init_fp_xdr(), Rast3d_init_index(), and Rast3d_open_cell_old_no_header().

◆ Rast3d_mask_close()

int Rast3d_mask_close ( void  )

Definition at line 36 of file mask.c.

◆ Rast3d_mask_d_select()

int Rast3d_mask_d_select ( DCELL ,
d_Mask  
)

Definition at line 46 of file maskfn.c.

References _d_mask::list, _d_interval::next, NULL, and Rast3d_mask_match_d_interval().

◆ 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
x
y
z
value
Returns
void

Definition at line 244 of file mask.c.

◆ Rast3d_mask_file()

const char* Rast3d_mask_file ( void  )

Returns the name of the 3d mask file.

Returns
char *

Definition at line 394 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 64 of file mask.c.

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

◆ 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
x
y
z
value
Returns
void

Definition at line 222 of file mask.c.

◆ 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 380 of file mask.c.

References RASTER3D_Map::useMask.

◆ 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 365 of file mask.c.

References RASTER3D_Map::useMask.

◆ Rast3d_mask_map_exists()

int Rast3d_mask_map_exists ( void  )

Returns 1 if the 3d mask is loaded.

Returns
int

Definition at line 408 of file mask.c.

◆ Rast3d_mask_match_d_interval()

DCELL Rast3d_mask_match_d_interval ( DCELL  ,
d_Interval  
)

Definition at line 59 of file maskfn.c.

References _d_interval::high, _d_interval::inf, and _d_interval::low.

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
x
y
z
value
type
Returns
void

Definition at line 200 of file mask.c.

◆ 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 349 of file mask.c.

References RASTER3D_Map::useMask.

Referenced by 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 332 of file mask.c.

References RASTER3D_Map::useMask.

◆ Rast3d_mask_open_old()

int Rast3d_mask_open_old ( void  )

Definition at line 73 of file mask.c.

Referenced by Rast3d_open_cell_old_no_header().

◆ 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 134 of file mask.c.

◆ 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 271 of file mask.c.

◆ 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 386 of file tileread.c.

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

◆ 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
col
row
depth
value
type
Returns
void

Definition at line 25 of file resample.c.

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
type
cache
region
Returns
void *

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

◆ 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
type
cache
Returns
void *

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

Referenced by Rast3d_compare_files().

◆ 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 98 of file open2.c.

◆ 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 chached tiles
cacheThe type of the caching
regionThe region of the map
typeThe type of the map (FCELL_TYPE, or DCELL_TYPE)
doLzwUse the LZW compression algorithm
doRleUse the Run-Length-Encoding algroithm 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.

◆ Rast3d_parse_vallist()

void Rast3d_parse_vallist ( char **  ,
d_Mask **   
)

Definition at line 101 of file maskfn.c.

References G_malloc, 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 36 of file raster3d/error.c.

◆ 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 57 of file putvalue.c.

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

Referenced by Rast3d_put_float().

◆ 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 21 of file putvalue.c.

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

Referenced by Rast3d_put_double().

◆ 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 96 of file putvalue.c.

◆ Rast3d_range_init()

int Rast3d_range_init ( RASTER3D_Map )

Definition at line 206 of file d/range.c.

References RASTER3D_Map::range, and Rast_init_fp_range().

Referenced by Rast3d_open_cell_old_no_header().

◆ 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 112 of file d/range.c.

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

◆ 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 135 of file d/range.c.

References RASTER3D_Map::range, and Rast_get_fp_range_min_max().

Referenced by Rast3d_print_header().

◆ Rast3d_range_update_from_tile()

void Rast3d_range_update_from_tile ( RASTER3D_Map ,
const void *  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int   
)

Definition at line 15 of file d/range.c.

Referenced by Rast3d_write_tile().

◆ 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 189 of file d/range.c.

References RASTER3D_Map::fileName, GPATH_MAX, RASTER3D_Map::mapset, 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 177 of file raster3d/cats.c.

◆ 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.

◆ Rast3d_read_doubles()

int Rast3d_read_doubles ( int  ,
int  ,
double *  ,
int   
)

Definition at line 51 of file doubleio.c.

◆ Rast3d_read_header()

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 *   
)

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

◆ 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
history
Returns
int

Definition at line 64 of file d/history.c.

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

◆ Rast3d_read_ints()

int Rast3d_read_ints ( int  ,
int  ,
int *  ,
int   
)

Definition at line 51 of file intio.c.

◆ Rast3d_read_range()

int Rast3d_read_range ( const char *  ,
const char *  ,
struct FPRange  
)

◆ Rast3d_read_region_map()

int Rast3d_read_region_map ( const char *  ,
const char *  ,
RASTER3D_Region  
)

Definition at line 232 of file region.c.

◆ 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 145 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_set_null_tile_type(), and RASTER3D_NO_COMPRESSION.

Referenced by 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 229 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 205 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 139 of file windowio.c.

Referenced by GVL_init_region().

◆ 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 48 of file raster3d/alloc.c.

References NULL, and Rast3d_error().

Referenced by Rast3d_init_fp_xdr().

◆ Rast3d_region_copy()

◆ Rast3d_region_from_to_cell_head()

◆ Rast3d_region_to_cell_head()

◆ 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 27 of file raster3d/color.c.

References G_remove_misc(), RASTER3D_COLOR_ELEMENT, and RASTER3D_DIRECTORY.

◆ Rast3d_retile()

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

Makes a copy of map with name nameOut which has tile dimensions tileX, tileY, tileZ. The source code can be found in retile.c.

Parameters
map
nameOut
tileX
tileY
tileZ
Returns
void

Definition at line 79 of file retile.c.

References x.

◆ Rast3d_rewrite_header()

◆ Rast3d_rle_count_only()

int Rast3d_rle_count_only ( char *  ,
int  ,
int   
)

Definition at line 135 of file rle.c.

◆ Rast3d_rle_decode()

void Rast3d_rle_decode ( char *  ,
char *  ,
int  ,
int  ,
int *  ,
int *   
)

Definition at line 235 of file rle.c.

◆ Rast3d_rle_encode()

void Rast3d_rle_encode ( char *  ,
char *  ,
int  ,
int   
)

Definition at line 178 of file rle.c.

◆ Rast3d_set_cache_limit()

void Rast3d_set_cache_limit ( int  nBytes)

Set cache limit.

Parameters
nBytes
Returns
void

Definition at line 178 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 146 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 96 of file defaults.c.

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

◆ Rast3d_set_error_fun()

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

set error function

Parameters
fun
Returns
void

Definition at line 288 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 210 of file defaults.c.

◆ 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 41 of file tilenull.c.

References Rast3d_set_null_tile_type(), and RASTER3D_Map::typeIntern.

◆ 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 23 of file tilenull.c.

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 35 of file null.c.

Referenced by N_copy_array_3d(), Rast3d_get_double_region(), and Rast3d_get_float_region().

◆ Rast3d_set_resampling_fun()

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

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

Returns
void

Definition at line 55 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 41 of file param.c.

◆ 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 244 of file defaults.c.

References g3d_tile_dimension, and Rast3d_fatal_error().

◆ 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 178 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
unit
Returns
void

Definition at line 212 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
unit
Returns
void

Definition at line 195 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 43 of file raster3d/window.c.

◆ 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 24 of file raster3d/window.c.

◆ Rast3d_set_window_params()

void Rast3d_set_window_params ( void  )

◆ Rast3d_set_xdr_null_double()

void Rast3d_set_xdr_null_double ( double *  )

Definition at line 49 of file fpxdr.c.

◆ Rast3d_set_xdr_null_float()

void Rast3d_set_xdr_null_float ( float *  )

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 *  ,
int   
)

Definition at line 38 of file fpxdr.c.

Referenced by Rast3d_set_xdr_null_float().

◆ Rast3d_skip_error()

void Rast3d_skip_error ( const char *  msg)

This function ignores the error.

Parameters
msg
Returns
void

Definition at line 21 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 52 of file tilemath.c.

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

Referenced by Rast3d_coord2tile_index(), and Rast3d_flush_tile_cube().

◆ 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 78 of file tilemath.c.

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

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 237 of file tilemath.c.

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

◆ 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 25 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 215 of file tilemath.c.

◆ 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 103 of file tilemath.c.

References Rast3d_tile_coord_origin(), and Rast3d_tile_index2tile().

◆ 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 124 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 298 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 161 of file headerinfo.c.

References RASTER3D_Map::typeIntern.

Referenced by Rast3d_compare_files(), 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 315 of file headerinfo.c.

References RASTER3D_Map::useCache.

Referenced by Rast3d_compare_files().

◆ 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 312 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().

◆ 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 286 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 276 of file windowio.c.

References Rast3d_set_window_params().

◆ Rast3d_window_ptr()

RASTER3D_Region* Rast3d_window_ptr ( void  )

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

References g3d_window.

◆ 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 19 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 27 of file raster3d/cats.c.

References Categories::a1, Categories::a2, Categories::fmt, G_fopen_new_misc(), G_trim_decimal(), Categories::m1, Categories::m2, 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 348 of file raster3d/color.c.

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

◆ Rast3d_write_doubles()

int Rast3d_write_doubles ( int  ,
int  ,
const double *  ,
int   
)

Definition at line 9 of file doubleio.c.

◆ Rast3d_write_header()

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   
)

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

Referenced by Rast3d_rewrite_header().

◆ 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 97 of file d/history.c.

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

◆ Rast3d_write_ints()

int Rast3d_write_ints ( int  ,
int  ,
const int *  ,
int   
)

Definition at line 9 of file intio.c.

◆ 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 127 of file tilewrite.c.

References RASTER3D_Map::data_fd, RASTER3D_Map::index, RASTER3D_Map::nTiles, Rast3d_compute_clipped_tile_dimensions(), Rast3d_error(), Rast3d_fatal_error(), and Rast3d_range_update_from_tile().

Referenced by 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 219 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 194 of file tilewrite.c.

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