void *Opens existing g3d-file name in mapset. Tiles are stored in memory with type which must be any of G3D_FLOAT, G3D_DOUBLE, or G3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either G3D_NO_CACHE, G3D_USE_CACHE_DEFAULT, G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, G3D_USE_CACHE_XYZ, the result of 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 G3D_DEFAULT_WINDOW, which uses the window stored at initialization time or set via G3d_setWindow (). To modify the window for the map after it has already been opened use G3d_setWindowMap ().G3d_openCellOld (name, mapset, window, type, cache)
char *name, *mapset; G3D_Region *window; int type, cache;
Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
void *Opens new g3d-file with name in the current mapset. Tiles are stored in memory with type which must be one of G3D_FLOAT, G3D_DOUBLE, or G3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either G3D_NO_CACHE, G3D_USE_CACHE_DEFAULT, G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, G3D_USE_CACHE_XYZ, the result of G3d_cacheSizeEncode (), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region.G3d_openCellNew (name, type, cache, region)
char *name; int type, cache; G3D_Region *region;
Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
void *Opens new g3d-file with name in the current mapset. Tiles are stored in memory with typeIntern which must be one of G3D_FLOAT, G3D_DOUBLE, or G3D_TILE_SAME_AS_FILE. cache specifies the cache-mode used and must be either G3D_NO_CACHE, G3D_USE_CACHE_DEFAULT, G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, G3D_USE_CACHE_XYZ, the result of G3d_cacheSizeEncode (), or any positive integer which specifies the number of tiles buffered in the cache. region specifies the 3d region.G3d_openCellNewParam (name, typeIntern, cache, region, type, doLzw, doRle, precision, tileX, tileY, tileZ)
char *name; int typeIntern, cache; G3D_Region *region; int type, doLzw, doRle, precision, tileX, tileY, tileZ;
In addition the properties of the new file have to be specified. It is assumed by default that compression is used. This function first sets the global default values to the specified values, and then restores the original global defaults. This function can be used in conjunction with G3d_setStandart3dInputParams () and G3d_getStandart3dParams ().
Returns a pointer to the cell structure ... if successful, NULL ... otherwise.
intCloses g3d-file. If map is new and cache-mode is used for map then every tile which is not flushed before closing is flushed.G3d_closeCell (map)
void *map;
Returns 1 ... if successful, 0 ... otherwise.
intReads tile with index tileIndex into the tile buffer. The cells are stored with type type which must be one of G3D_FLOAT and G3D_DOUBLE. 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.G3d_readTile (map, tileIndex, tile, type)
void *map; char *tile; int tileIndex, type;
Returns 1 ... if successful, 0 ... otherwise.
intIs equivalent to G3d_readTile (map, tileIndex, tile, G3D_FLOAT).G3d_readTileFloat (map, tileIndex, tile)
intIs equivalent to G3d_readTile (map, tileIndex, tile, G3D_DOUBLE).G3d_readTileDouble (map, tileIndex, tile)
intWrites 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 G3D_FLOAT and G3D_DOUBLE. 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.G3d_writeTile (map, tileIndex, tile, type)
void *map; char *tile; int tileIndex, type;
Returns 1 ... if successful, 2 ... if write request was ignored, 0 ... otherwise.
intIs equivalent to G3d_writeTile (map, tileIndex, tile, G3D_FLOAT).G3d_writeTileFloat (map, tileIndex, tile)
intIs equivalent to G3d_writeTile (map, tileIndex, tile, G3D_DOUBLE).G3d_writeTileDouble (map, tileIndex, tile)
voidReturns in *value the cell-value of the cell with window-coordinate (x, y, z). The value returned is of type.G3d_getValue (map, x, y, z, value, type)
void *map; int x, y, z; char *value; int type;
This function invokes a fatal error if an error occurs.
float
G3d_getFloat (map, x, y, z)
Is equivalent to G3d_getValue (map, x, y, z, &value, G3D_FLOAT); return value.
doubleG3d_getDouble (map, x, y, z)
Is equivalent to G3d_getValue (map, x, y, z, &value, G3D_DOUBLE); return value.
voidReturns 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.G3d_getValueRegion (map, x, y, z, value, type)
void *map; int x, y, z; char *value; int type;
This function invokes a fatal error if an error occurs.
float
G3d_getFloatRegion (map, x, y, z)
Is equivalent to G3d_getValueRegion (map, x, y, z, &value, G3D_FLOAT); return value.
doubleG3d_getDoubleRegion (map, x, y, z)
Is equivalent to G3d_getValueRegion (map, x, y, z, &value, G3D_DOUBLE); return value.
intAfter 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).G3d_putValue (map, x, y, z, value, type)
void *map; int x, y, z; char *value; int type;
Returns 1 ... if successful, 0 ... otherwise.
intIs equivalent to G3d_putValue (map, x, y, z, &value, G3D_FLOAT).G3d_putFloat (map, x, y, z, value)
void *map; int x, y, z; float value;
intIs equivalent to G3d_putValue (map, x, y, z, &value, G3D_DOUBLE).G3d_putDouble (map, x, y, z, value)
void *map; int x, y, z; double value;
char *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.G3d_getTilePtr (map, tileIndex)
void *map; int tileIndex;
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 G3d_getTilePtr 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 G3d_getTilePtr may destroy the values already stored in the buffer. Use G3d_flushTile 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 G3d_getTilePtr are G3d_readTile () and G3d_writeTile () and their corresponding type-specific versions.
Returns a pointer to a buffer ... if successful, NULL ... otherwise.
intSame functionality as G3d_getTilePtr () but does not return the pointer.G3d_tileLoad (map, tileIndex)
void *map; int tileIndex;
Returns 1 ... if successful, 0 ... otherwise.
intRemoves a tile from memory-cache if tile is in memory-cache. For new maps the application does not know whether the tile is in the memory-cache or in the file-cache. Therefore, for new maps this function should be preceded by G3d_tileLoad (). (Question: Is this a useful function?)G3d_removeTile (map, tileIndex)
void *map; int tileIndex;
Returns 1 ... if successful, 0 ... otherwise.
intWrites 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 G3d_flushTile, a tile filled with NULL-values is written.G3d_flushTile (map, tileIndex)
void *map; int tileIndex;
Returns 1 ... if successful, 0 ... otherwise.
intWrites 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.G3d_flushTileCube (map, xMin, yMin, zMin, xMax, yMax, zMax)
void *map; int xMin, yMin, zMin; /* Tile Coordinates */ int xMax, yMax, zMax;
Returns 1 ... if successful, 0 ... otherwise.
intWrites 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.G3d_flushTilesInCube (map, xMin, yMin, zMin, xMax, yMax, zMax)
void *map; int xMin, yMin, zMin; /* Cell Coordinates */ int xMax, yMax, zMax;
Returns 1 ... if successful, 0 ... otherwise.
intLocks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles are unlocked, the lock request is ignored.G3d_lockTile (map, tileIndex)
void *map; int tileIndex;
Returns 1 ... if successful, -1 ... if request is ignored, 0 ... otherwise.
intUnlocks tile with tileIndex.G3d_unlockTile (map, tileIndex)
void *map; int tileIndex;
Returns 1 ... if successful, 0 ... otherwise.
intUnlocks every tile in cache of map.G3d_unlockAll (map)
void *map;
Returns 1 ... if successful, 0 ... otherwise.
voidTurns autolock mode on.G3d_autolockOn (map)
void *map;
voidTurns autolock mode Off.G3d_autolockOff (map)
void *map;
voidSets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination with G3d_unlockAll () in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles.G3d_minUnlocked (map, minUnlocked)
void *map; int minUnlocked;
minUnlocked must be one of G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, G3D_USE_CACHE_XYZ, the result of G3d_cacheSizeEncode (), or any positive integer which explicitly specifies the number of tiles.
intStarts a new cycle.G3d_beginCycle (map)
void *map;
Returns 1 ... if successful, 0 ... otherwise.
intEnds a cycle.G3d_endCycle (map)
void *map;
Returns 1 ... if successful, 0 ... otherwise.
intReturns a number which encodes multiplicity n of cacheCode. This value can be used to specify the size of the cache.G3d_cacheSizeEncode (cacheCode, n)
int cacheCode, n;
If cacheCode is the size (in tiles) of the cache the function returns cacheCode * n.
If cacheCode is G3D_USE_CACHE_DEFAULT the function returns G3D_USE_CACHE_DEFAULT.
If cacheCode is G3D_USE_CACHE_??? the function returns a value encoding G3D_USE_CACHE_??? and n. Here G3D_USE_CACHE_??? is one of G3D_USE_CACHE_X, G3D_USE_CACHE_Y, G3D_USE_CACHE_Z, G3D_USE_CACHE_XY, G3D_USE_CACHE_XZ, G3D_USE_CACHE_YZ, or G3D_USE_CACHE_XYZ, where e.g. G3D_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 G3D_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.
intResamples the cube defined by origin and the 3 vertices vx, vy, and vz which are incident to the 3 edges adjacent to origin. The resampled cube is stored in volumeBuf which is a cube with dimensions (nx, ny, nz). The method of sampling is nearest neighbor sampling. The values stored are of type.G3d_getVolume (map, originNorth, originWest, originBottom, vxNorth, vxWest, vxBottom, vyNorth, vyWest, vyBottom, vzNorth, vzWest, vzBottom, nx, ny, nz, volumeBuf, type)
void *map; double originNorth, originWest, originBottom; double vxNorth, vxWest, vxBottom; double vyNorth, vyWest, vyBottom; double vzNorth, vzWest, vzBottom; double originNorth, originWest, originBottom; int nx, ny, nz; char *volumeBuf; int type;
Returns 1 ... if successful, 0 ... otherwise.
intResamples the axis-parallel cube defined by origin and the lengths of the 3 edges adjacent to origin. The resampled cube is stored in volumeBuf which is a cube with dimensions (nx, ny, nz). The method of sampling is nearest neighbor sampling. The values stored are of type.G3d_getAllignedVolume (map, originNorth, originWest, originBottom, lengthNorth, lengthWest, lengthBottom, nx, ny, nz, volumeBuf, type)
void *map; double originNorth, originWest, originBottom; double lengthNorth, lengthWest, lengthBottom; int nx, ny, nz; char *volumeBuf; int type;
Returns 1 ... if successful, 0 ... otherwise.
void *Same as malloc (nBytes), except that in case of error G3d_error () is invoked.G3d_malloc (nBytes)
int nBytes;
Returns a pointer ... if successful, NULL ... otherwise.
void *Same as realloc (ptr, nBytes), except that in case of error G3d_error () is invoked.G3d_realloc (ptr, nBytes)
void *ptr; int nBytes;
Returns a pointer ... if successful, NULL ... otherwise.
voidSame as free (ptr).G3d_free (ptr)
void *ptr;
char *Allocates a vector of nofTiles tiles with the same dimensions as the tiles of map and large enough to store cell-values of type.G3d_allocTilesType (map, nofTiles, type)
void *mao; int nofTiles, type;
Returns a pointer to the vector ... if successful, NULL ... otherwise.
char *Is equivalent to G3d_allocTilesType (map, nofTiles, G3d_fileTypeMap (map)).G3d_allocTiles (map, nofTiles)
void *mao; int nofTiles;
voidIs equivalent to G3d_free (tiles);G3d_freeTiles (tiles)
char *tiles;
voidReturns 1 if the value of *n is a NULL-value. Returns 0 otherwise.G3d_isNullValueNum (n, type)
void *n; int type;
voidFills the vector pointed to by c with nofElts NULL-values of type.G3d_setNullValue (c, nofElts, type)
void *c; int nofElts, type;
voidAssumes that tile is a tile with the same dimensions as the tiles of map. Fills tile with NULL-values of type.G3d_setNullTileType (map, tile, type)
void *map; int tile, type;
voidIs equivalent to G3d_setNullTileType (map, tile, G3d_fileTypeMap (map)).G3d_setNullTile (map, tile)
void *map; int tile;
voidReturns the size of the region of map in cells.G3d_getCoordsMap (map, rows, cols, depths)
void *map; int *rows, *cols, *depths;
voidReturns the size of the region.G3d_getRegionMap (map, north, south, east, west, top, bottom)
void *map; int *north, *south, *east, *west, *top, *bottom;
voidReturns in region the region of map.G3d_getRegionStructMap (map, region)
void *map; G3D_Region *region;
voidReturns the tile dimensions used for map.G3d_getTileDimensionsMap (map, x, y, z)
void *map; int *x, *y, *z;
voidReturns the dimensions of the tile-cube used to tile the region of map. These numbers include partial tiles.G3d_getNofTilesMap (map, nx, ny, nz)
void *map; int *nx, *ny, *nz;
intReturns the type in which tiles of map are stored in memory.G3d_tileTypeMap (map)
void *map;
intReturns the type with which tiles of map are stored on file.G3d_fileTypeMap (map)
void *map;
intReturns the precision used to store map.G3d_tilePrecisionMap (map)
void *map;
intReturns 1 if map uses cache, returns 0 otherwise.G3d_tileUseCacheMap (map)
void *map;
voidPrints the header information of map.G3d_printHeader (map)
void *map;
voidConverts index tileIndex into tile-coordinates (xTile, yTile, zTile).G3d_tileIndex2tile (map, tileIndex, xTile, yTile, zTile)
void *map; int tileIndex; int *xTile, *yTile, *zTile;
intReturns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).G3d_tile2tileIndex (map, xTile, yTile, zTile)
void *map; int xTile, yTile, zTile;
voidConverts cell-coordinates (x, y, z) into tile-coordinates (xTile, yTile, zTile) and the coordinate of the cell (xOffs, yOffs, zOffs) within the tile.G3d_coord2tileCoord (map, x, y, z, xTile, yTile, zTile, xOffs, yOffs, zOffs)
void *map; int x, y, z; int *xTile, *yTile, *zTile, *xOffs, *yOffs, *zOffs;
voidComputes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tile-coordinates (xTile, yTile, zTile).G3d_tileCoordOrigin (map, xTile, yTile, zTile, x, y, z)
void *map; int xTile, yTile, zTile; int *x, *y, *z;
voidComputes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tileIndex.G3d_tileIndexOrigin (map, tileIndex, x, y, z)
void *map; int tileIndex; int *x, *y, *z;
voidConverts cell-coordinates (x, y, z) into tileIndex and the offset of the cell within the tile.G3d_coord2tileIndex (map, x, y, z, tileIndex, offset)
void *map; int x, y, z; int *tileIndex, *offset;
intReturns 1 if cell-coordinate (x, y, z) is a coordinate inside the region. Returns 0 otherwise.G3d_coordInRange (map, x, y, z)
void *map; int x, y, z; /* cell coordinates */
intReturns 1 if tile-coordinate (x, y, z) is a coordinate inside tile cube. Returns 0 otherwise.G3d_tileInRange (map, x, y, z)
void *map; int x, y, z; /* tile coordinates */
intReturns 1 if tileIndex is a valid index for map. Returns 0 otherwise.G3d_tileIndexInRange (map, tileIndex)
void *map; int tileIndex;
intReturns 1 if region-coordinates (north, west, bottom) are inside the region of map. Returns 0 otherwise.G3d_isValidLocation (map, north, west, bottom)
void *map; double north, west, bottom;
voidConverts region-coordinates (north, west, bottom) into cell-coordinates (x, y, z).G3d_location2coord (map, tileIndex)
void *map; double north, west, bottom; int *x, *y, *z;
intComputes 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.G3d_computeClippedTileDimensions (map, tileIndex, rows, cols, depths, xRedundant, yRedundant, zRedundant)
void *map; int tileIndex; int *rows, *cols, *depths; int *xRedundant, *yRedundant, *zRedundant;
intLoads the range into the range structure of map.G3d_range_load (map)
void *map;
Returns 1 ... if successful 0 ... otherwise.
voidReturns in min and max the minimum and maximum values of the range.G3d_range_min_max (map, min, max)
void *map; double *min, *max;
intWrites the range which is stored in the range structure of map. (This function is invoked automatically when a new file is closed).G3d_range_write (map)
void *map;
Returns 1 ... if successful 0 ... otherwise.
intRemoves the primary and/or secondary color file. See G_remove_colr for details.G3d_removeColor (name)
char *name;
Returns always 0.
intReads color file for map name in mapset into the colors structure. See G_read_colors for details and return values.G3d_readColors (name, mapset, colors)
char *name; char *mapset; struct Colors *colors;
intWrites colors stored in colors structure into the color file for map name in mapset. See G_write_colors for details and return values.G3d_writeColors (name, mapset, colors)
char *name; char *mapset; struct Colors *colors;
intReads the categories file for map name in mapset and stores the categories in the pcats structure. See G_read_cats for details and return values.G3d_readCats (name, mapset, cats)
char *name; char *mapset; struct Categories *pcats;
intWrites the categories stored in the cats structure into the categories file for map name in the current mapset. See G_write_cats for details and return values.G3d_writeCats (name, cats)
char *name; struct Categories *cats;
voidTurns 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.G3d_maskOn (map)
void *map;
voidTurns 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.G3d_maskOff (map)
void *map;
intReturns 1 if the mask for map is turned on. Returns 0 otherwise.G3d_maskIsOn (map)
void *map;
intReturns 1 if the mask for map is turned off. Returns 0 otherwise.G3d_maskIsOff (map)
void *map;
intThis 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.G3d_maskReopen (cache)
int cache;
Returns 1 ... if successful 0 ... otherwise.
intReturns 1 if the 3d mask file exists.G3d_maskFileExists ()
intReturns 1 if the 3d mask is loaded.G3d_maskMapExists ()
char *Returns the name of the 3d mask file.G3d_maskFile ()
intReturns 1 if the cell with cell-coordinates (x, y, z) is masked out. Returns 0 otherwise.G3d_isMasked (x, y, z)
int x, y, z;
voidReplaces the value stored in value with the NULL-value if G3d_isMasked (x, y, z) returns 1. Does nothing otherwise. value is assumed to be oftype.G3d_maskNum (x, y, z, value, type)
int x, y, z; void *value; int type;
voidSame as G3d_maskNum (x, y, z, value, G3D_FLOAT).G3d_maskFloat (x, y, z, value)
int x, y, z; float *value;
voidSame as G3d_maskNum (x, y, z, value, G3D_DOUBLE).G3d_maskDouble (x, y, z, value)
int x, y, z; double *value;
voidReplaces the values stored in tile (with tileIndex) for which G3d_isMasked 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).G3d_maskTile (map, tileIndex, tile, type)
void *map; int tileIndex; char *tile; int type;
voidSets the window for map to window. Can be used multiple times for the same map.G3d_setWindowMap (map, window)
void *map; G3D_Region *window;
voidSets the default window used for every map opened later in the program. Can be used multiple times in the same program.G3d_setWindow (window)
G3D_Region *window;
voidStores the current default window in window.G3d_getWindow (window)
G3D_Region *window;
G3D_Region *Returns a pointer to the current default window. This pointer should not be (ab)used to modify the current window structure directly. It is provided to pass a window pointer when opening a map.G3d_windowPtr ()
intReads 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.G3d_readWindow (window, windowName)
G3D_Region *window; char *windowName;
Returns 1 ... if successful 0 ... otherwise.
intWrites 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.G3d_writeWindow (window, windowName)
G3D_Region *window; char *windowName;
Returns 1 ... if successful 0 ... otherwise.
voidAllows 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.G3d_useWindowParams ()
voidSets the resampling function to be used by G3d_getValue (). This function is defined as follows:G3d_setResamplingFun (map, resampleFun)
void *map; void (*resampleFun) ();
void G3d_customResampleFun (map, row, col, depth, value, type) void *map; int row, col, depth; char *value; int type;row, col, and depth are in region coordinates. The result is returned in value as type which is one of G3D_FLOAT or G3D_DOUBLE. Possible choices include G3d_nearestNeighbor () and G3d_getValueRegion ().
voidThe default resampling function which uses nearest neighbor resampling.G3d_nearestNeighbor (map, row, col, depth, value, type)
void *map; int row, col, depth; char *value; int type;
voidReturns in resampleFun a pointer to the resampling function used by map.G3d_getResamplingFun (map, resampleFun)
void *map; void (**resampleFun) ();
voidReturns in nnFunPtr a pointer to G3d_nearestNeighbor ().G3d_getNearestNeighborFunPtr (nnFunPtr)
void (**nnFunPtr) ();
voidReturns in region2d the 2d portion of region3d.G3d_extract2dRegion (region3d, region2d)
G3D_Region *region3d; struct Cell_head *region2d;
voidReplaces the 2d portion of region3d with the values stored in region2d.G3d_incorporate2dRegion (region2d, region3d)
struct Cell_head *region2d; G3D_Region *region3d;
voidComputes an adjusts the resolutions in the region structure from the region boundaries and number of cells per dimension.G3d_adjustRegion (region)
G3D_Region *region;
voidComputes an adjusts the number of cells per dimension in the region structure from the region boundaries and resolutions.G3d_adjustRegionRes (region)
G3D_Region *region;
voidCopies the values of regionSrc into regionDst. (The unfortunate order of parameters was chosen in order to conform to the order used in G_copy ()).G3d_regionCopy (regionDest, regionSrc)
G3D_Region *regionDest, *regionSrc;
voidReturns in value the value of the map which corresponds to region coordinates (north, east, top). The value is resampled using the resampling function specified for map. The value is of type.G3d_getRegionValue (map, north, east, top, value, type)
void *map; double north, east, top; char *value; int type;
voidReturns in region the region information for 3d cell name@mapset.G3d_readRegionMap (name, mapset, region)
char *name, *mapset; G3D_Region *region;
voidReturns the GRASS floating point type which is equivalent to the G3D type of g3dType.G3d_g3dType2cellType (g3dType)
int g3dType;
voidInitializes the default values described in G3D 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.G3d_initDefaults ()
voidInitializes 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 G3D Defaults.G3d_setStandart3dInputParams ()
This function has to be used in conjunction with G3d_getStandart3dInputParams ().
intReturns the properties of the new file as chosen by the user via command line arguments. If the default is chosen the values of useXxxxDefault is 1, it is 0 otherwise. In addition, the corresponding parameters contain the default value if useXxxxDefault is 1, or the value specified by the user if useXxxxDefault is 0.G3d_getStandart3dInputParams (useTypeDefault, type, useLzwDefault, doLzw, useRleDefault, doRle, usePrecisionDefault, precision, useDimensionDefault, tileX, tileY, tileZ)
int *useTypeDefault, *type, *useLzwDefault, *doLzw; int *useRleDefault, *doRle, *usePrecisionDefault, *precision; int *useDimensionDefault, *tileX, *tileY, *tileZ;
Function G3d_setStandart3dInputParams () has to be used to initialize the internal parameter structure.
Returns 1 ... if successful, 0 ... otherwise.
intCreates the 3d mapset element for map mapName.G3d_makeMapsetMapDirectory (mapName)
char *mapName;
intReturns in path the path for element elementName for map mapName in mapset. Note, an error occurs if mapName is fully qualified.G3d_filename (path, elementName, mapName, mapset)
char *path, *elementName, *mapName, *mapset;