|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-fc1694ea64
|
#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <unistd.h>#include "raster3d_intern.h"
Go to the source code of this file.
Functions | |
| void | Rast3d_tile_index2tile (RASTER3D_Map *map, int tileIndex, int *xTile, int *yTile, int *zTile) |
| Converts index tileIndex into tile-coordinates (xTile, yTile, zTile). | |
| int | Rast3d_tile2tile_index (RASTER3D_Map *map, int xTile, int yTile, int zTile) |
| Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile). | |
| 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). | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| int | Rast3d_tile_index_in_range (RASTER3D_Map *map, int tileIndex) |
| Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise. | |
| 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. | |
| 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. | |
| void | Rast3d_compute_optimal_tile_dimension (RASTER3D_Region *region, int type, int *tileX, int *tileY, int *tileZ, int maxSize) |
| Compute the optimal tile size. | |
| 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.
| map | |
| tileIndex | |
| rows | |
| cols | |
| depths | |
| xRedundant | |
| yRedundant | |
| zRedundant |
Definition at line 243 of file tilemath.c.
References RASTER3D_Map::clipX, RASTER3D_Map::clipY, RASTER3D_Map::clipZ, RASTER3D_Region::cols, RASTER3D_Region::depths, Rast3d_tile_index2tile(), RASTER3D_Map::region, RASTER3D_Region::rows, RASTER3D_Map::tileSize, RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.
Referenced by Rast3d_init_index(), Rast3d_mask_tile(), Rast3d_read_tile(), and Rast3d_write_tile().
| 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.
| region | The region of the map |
| type | The type of the map (FCELL_TYPE or DCELL_TYPE) |
| tileX | Pointer of the tile size in x direction for result storage |
| tileY | Pointer of the tile size in y direction for result storage |
| tileZ | Pointer of the tile size in z direction for result storage |
| maxSize | The max size of the tile in kilo bytes |
Definition at line 306 of file tilemath.c.
References RASTER3D_Region::cols, DCELL_TYPE, RASTER3D_Region::depths, FCELL_TYPE, G_debug(), RASTER3D_Region::rows, and x.
Referenced by Rast3d_open_new_opt_tile_size().
| 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.
| map | |
| x | |
| y | |
| z | |
| xTile | |
| yTile | |
| zTile | |
| xOffs | |
| yOffs | |
| zOffs |
Definition at line 124 of file tilemath.c.
References RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.
Referenced by Rast3d_compare_files(), Rast3d_coord2tile_index(), Rast3d_flush_tiles_in_cube(), Rast3d_get_block_nocache(), and Rast3d_retile().
| 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.
| map | |
| x | |
| y | |
| z | |
| tileIndex | |
| offset |
Definition at line 152 of file tilemath.c.
References Rast3d_coord2tile_coord(), Rast3d_tile2tile_index(), RASTER3D_Map::tileX, RASTER3D_Map::tileXY, and x.
Referenced by Rast3d_get_double_region(), Rast3d_get_float_region(), Rast3d_put_double(), and Rast3d_put_float().
| 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.
| map | |
| x | |
| y | |
| z |
Definition at line 178 of file tilemath.c.
References RASTER3D_Region::cols, RASTER3D_Region::depths, RASTER3D_Map::region, RASTER3D_Region::rows, and x.
| int Rast3d_tile2tile_index | ( | RASTER3D_Map * | map, |
| int | xTile, | ||
| int | yTile, | ||
| int | zTile | ||
| ) |
Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).
| map | |
| xTile | |
| yTile | |
| zTile |
Definition at line 47 of file tilemath.c.
References RASTER3D_Map::nx, and RASTER3D_Map::nxy.
Referenced by Rast3d_change_precision(), Rast3d_change_type(), Rast3d_coord2tile_index(), Rast3d_flush_tile_cube(), and Rast3d_get_block_nocache().
| 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).
| map | |
| xTile | |
| yTile | |
| zTile | |
| x | |
| y | |
| z |
Definition at line 70 of file tilemath.c.
References RASTER3D_Map::tileX, RASTER3D_Map::tileY, RASTER3D_Map::tileZ, and x.
Referenced by Rast3d_tile_index_origin().
| 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.
| map | |
| x | |
| y | |
| z |
Definition at line 216 of file tilemath.c.
References RASTER3D_Map::nx, RASTER3D_Map::ny, RASTER3D_Map::nz, and x.
| void Rast3d_tile_index2tile | ( | RASTER3D_Map * | map, |
| int | tileIndex, | ||
| int * | xTile, | ||
| int * | yTile, | ||
| int * | zTile | ||
| ) |
Converts index tileIndex into tile-coordinates (xTile, yTile, zTile).
| map | |
| tileIndex | |
| xTile | |
| yTile | |
| zTile |
Definition at line 22 of file tilemath.c.
References RASTER3D_Map::nx, and RASTER3D_Map::nxy.
Referenced by Rast3d_compute_clipped_tile_dimensions(), and Rast3d_tile_index_origin().
| int Rast3d_tile_index_in_range | ( | RASTER3D_Map * | map, |
| int | tileIndex | ||
| ) |
Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise.
| map | |
| tileIndex |
Definition at line 196 of file tilemath.c.
Referenced by Rast3d_get_block_nocache().
Computes the cell-coordinates (x, y, z) which correspond to the origin of the tile with tileIndex.
| map | |
| tileIndex | |
| x | |
| y | |
| z |
Definition at line 93 of file tilemath.c.
References Rast3d_tile_coord_origin(), Rast3d_tile_index2tile(), and x.
Referenced by Rast3d_mask_tile().