GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
raster3d/header.c File Reference
#include <stdio.h>
#include <stdlib.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/header.c:

Go to the source code of this file.

Macros

#define RASTER3D_HEADER_TILEX   "TileDimensionX"
 
#define RASTER3D_HEADER_TILEY   "TileDimensionY"
 
#define RASTER3D_HEADER_TILEZ   "TileDimensionZ"
 
#define RASTER3D_HEADER_TYPE   "CellType"
 
#define RASTER3D_HEADER_COMPRESSION   "useCompression"
 
#define RASTER3D_HEADER_USERLE   "useRle"
 
#define RASTER3D_HEADER_USELZW   "useLzw"
 
#define RASTER3D_HEADER_PRECISION   "Precision"
 
#define RASTER3D_HEADER_DATA_OFFSET   "nofHeaderBytes"
 
#define RASTER3D_HEADER_USEXDR   "useXdr"
 
#define RASTER3D_HEADER_HASINDEX   "hasIndex"
 
#define RASTER3D_HEADER_UNIT   "Units"
 
#define RASTER3D_HEADER_VERTICAL_UNIT   "VerticalUnits"
 
#define RASTER3D_HEADER_VERSION   "Version"
 
#define RLE_STATUS_BYTES   2
 
#define XDR_MISUSE_BYTES   10
 

Functions

int Rast3d_read_header (RASTER3D_Map *map, int *proj, int *zone, double *north, double *south, double *east, double *west, double *top, double *bottom, int *rows, int *cols, int *depths, double *ew_res, double *ns_res, double *tb_res, int *tileX, int *tileY, int *tileZ, int *type, int *compression, int *useRle, int *useLzw, int *precision, int *dataOffset, int *useXdr, int *hasIndex, char **unit, int *vertical_unit, int *version)
 
int Rast3d_write_header (RASTER3D_Map *map, int proj, int zone, double north, double south, double east, double west, double top, double bottom, int rows, int cols, int depths, double ew_res, double ns_res, double tb_res, int tileX, int tileY, int tileZ, int type, int compression, int useRle, int useLzw, int precision, int dataOffset, int useXdr, int hasIndex, char *unit, int vertical_unit, int version)
 
int Rast3d_rewrite_header (RASTER3D_Map *map)
 
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. More...
 
int Rast3d__compute_cache_size (RASTER3D_Map *map, int cacheCode)
 
int Rast3d_fill_header (RASTER3D_Map *map, int operation, int compression, int useRle, int useLzw, int type, int precision, int cache, int hasIndex, int useXdr, int typeIntern, int nofHeaderBytes, int tileX, int tileY, int tileZ, int proj, int zone, double north, double south, double east, double west, double top, double bottom, int rows, int cols, int depths, double ew_res, double ns_res, double tb_res, char *unit, int vertical_unit, int version)
 

Variables

void * tmpCompress
 
int tmpCompressLength
 
void * xdr
 
int xdrLength
 

Macro Definition Documentation

◆ RASTER3D_HEADER_COMPRESSION

#define RASTER3D_HEADER_COMPRESSION   "useCompression"

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

◆ RASTER3D_HEADER_DATA_OFFSET

#define RASTER3D_HEADER_DATA_OFFSET   "nofHeaderBytes"

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

◆ RASTER3D_HEADER_HASINDEX

#define RASTER3D_HEADER_HASINDEX   "hasIndex"

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

◆ RASTER3D_HEADER_PRECISION

#define RASTER3D_HEADER_PRECISION   "Precision"

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

◆ RASTER3D_HEADER_TILEX

#define RASTER3D_HEADER_TILEX   "TileDimensionX"

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

◆ RASTER3D_HEADER_TILEY

#define RASTER3D_HEADER_TILEY   "TileDimensionY"

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

◆ RASTER3D_HEADER_TILEZ

#define RASTER3D_HEADER_TILEZ   "TileDimensionZ"

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

◆ RASTER3D_HEADER_TYPE

#define RASTER3D_HEADER_TYPE   "CellType"

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

◆ RASTER3D_HEADER_UNIT

#define RASTER3D_HEADER_UNIT   "Units"

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

◆ RASTER3D_HEADER_USELZW

#define RASTER3D_HEADER_USELZW   "useLzw"

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

◆ RASTER3D_HEADER_USERLE

#define RASTER3D_HEADER_USERLE   "useRle"

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

◆ RASTER3D_HEADER_USEXDR

#define RASTER3D_HEADER_USEXDR   "useXdr"

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

◆ RASTER3D_HEADER_VERSION

#define RASTER3D_HEADER_VERSION   "Version"

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

◆ RASTER3D_HEADER_VERTICAL_UNIT

#define RASTER3D_HEADER_VERTICAL_UNIT   "VerticalUnits"

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

◆ RLE_STATUS_BYTES

#define RLE_STATUS_BYTES   2

◆ XDR_MISUSE_BYTES

#define XDR_MISUSE_BYTES   10

Function Documentation

◆ Rast3d__compute_cache_size()

◆ 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_fill_header()

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

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

◆ Rast3d_read_header()

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

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

◆ Rast3d_rewrite_header()

◆ Rast3d_write_header()

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

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

Referenced by Rast3d_rewrite_header().

Variable Documentation

◆ tmpCompress

void* tmpCompress

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

◆ tmpCompressLength

int tmpCompressLength

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

◆ xdr

void* xdr

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

Referenced by Rast3d_init_fp_xdr().

◆ xdrLength

int xdrLength

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

Referenced by Rast3d_init_fp_xdr().