GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r73101
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
raster3d/open.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include <grass/raster3d.h>
#include <grass/glocale.h>
#include "raster3d_intern.h"
Include dependency graph for raster3d/open.c:

Go to the source code of this file.

Functions

void * Rast3d_open_cell_old_no_header (const char *name, const char *mapset)
 
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. More...
 
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. More...
 

Function Documentation

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 209 of file raster3d/open.c.

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

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

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.

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

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