GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
R.h
Go to the documentation of this file.
1
#include <
grass/config.h
>
2
#include <
grass/gis.h
>
3
#ifdef HAVE_GDAL
4
#include <gdal.h>
5
#endif
6
7
#define XDR_FLOAT_NBYTES 4
8
#define XDR_DOUBLE_NBYTES 8
9
#define NULL_ROWS_INMEM 8
10
11
/* if short is 16 bits, then
12
* short will allow 32767 cols
13
* unsigned short will allow 65536 cols
14
* use int if you need more columns (but this will take more memory).
15
*
16
*/
17
typedef
int
COLUMN_MAPPING
;
18
19
struct
GDAL_link
{
20
char
*
filename
;
21
int
band_num
;
22
DCELL
null_val
;
23
int
hflip
;
24
int
vflip
;
25
#ifdef HAVE_GDAL
26
GDALDatasetH
data
;
27
GDALRasterBandH
band
;
28
GDALDataType
type
;
29
#endif
30
};
31
32
#ifdef HAVE_GDAL
33
extern
CPLErr
Rast_gdal_raster_IO
(GDALRasterBandH, GDALRWFlag,
int
,
int
,
int
,
34
int
,
void
*,
int
,
int
, GDALDataType,
int
,
35
int
);
36
#endif
37
38
struct
tileinfo
/* Information for tiles */
39
{
40
char
*
name
;
/* Name of open file */
41
char
*
mapset
;
/* Mapset of open file */
42
struct
Cell_head
cellhd
;
/* Cell header */
43
struct
ilist
*
clist
;
/* columns inside current region */
44
};
45
46
struct
R_vrt
{
47
int
tilecount
;
48
struct
tileinfo
*
tileinfo
;
49
struct
ilist
*
tlist
;
50
};
51
52
struct
fileinfo
/* Information for opened cell files */
53
{
54
int
open_mode
;
/* see defines below */
55
struct
Cell_head
cellhd
;
/* Cell header */
56
struct
Reclass
reclass
;
/* Table reclass */
57
struct
Cell_stats
statf
;
/* Cell stats */
58
struct
Range
range
;
/* Range structure */
59
struct
FPRange
fp_range
;
/* float Range structure */
60
int
want_histogram
;
61
int
reclass_flag
;
/* Automatic reclass flag */
62
off_t *
row_ptr
;
/* File row addresses */
63
COLUMN_MAPPING
*
col_map
;
/* Data to window col mapping */
64
double
C1
,
C2
;
/* Data to window row constants */
65
int
cur_row
;
/* Current data row in memory */
66
int
null_cur_row
;
/* Current null row in memory */
67
int
cur_nbytes
;
/* nbytes per cell for current row */
68
unsigned
char
*
data
;
/* Decompressed data buffer */
69
int
null_fd
;
/* Null bitmap fd */
70
unsigned
char
*
null_bits
;
/* Null bitmap buffer */
71
int
nbytes
;
/* bytes per cell */
72
RASTER_MAP_TYPE
map_type
;
/* type: int, float or double map */
73
char
*
temp_name
;
/* Temporary name for NEW files */
74
char
*
null_temp_name
;
/* Temporary name for NEW NULL files */
75
int
null_file_exists
;
/* for existing raster maps */
76
char
*
name
;
/* Name of open file */
77
char
*
mapset
;
/* Mapset of open file */
78
int
io_error
;
/* io error warning given */
79
struct
Quant
quant
;
80
struct
GDAL_link
*
gdal
;
81
int
data_fd
;
/* Raster data fd */
82
off_t *
null_row_ptr
;
/* Null file row addresses */
83
struct
R_vrt
*
vrt
;
84
};
85
86
struct
R__
/* Structure of library globals */
87
{
88
RASTER_MAP_TYPE
fp_type
;
/* type for writing floating maps */
89
int
mask_fd
;
/* File descriptor for automatic mask */
90
int
auto_mask
;
/* Flag denoting automatic masking */
91
int
want_histogram
;
92
int
nbytes
;
93
int
compression_type
;
94
int
compress_nulls
;
95
int
window_set
;
/* Flag: window set? */
96
int
split_window
;
/* Separate windows for input and output */
97
struct
Cell_head
rd_window
;
/* Window used for input */
98
struct
Cell_head
wr_window
;
/* Window used for output */
99
100
int
fileinfo_count
;
101
struct
fileinfo
*
fileinfo
;
102
};
103
104
extern
struct
R__
R__
;
/* allocated in init */
105
106
#define OPEN_OLD 1
107
#define OPEN_NEW_COMPRESSED 2
108
#define OPEN_NEW_UNCOMPRESSED 3
COLUMN_MAPPING
int COLUMN_MAPPING
Definition:
R.h:17
Rast_gdal_raster_IO
CPLErr Rast_gdal_raster_IO(GDALRasterBandH, GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int)
config.h
gis.h
DCELL
double DCELL
Definition:
gis.h:629
RASTER_MAP_TYPE
int RASTER_MAP_TYPE
Definition:
raster.h:25
Cell_head
2D/3D raster map header (used also for region)
Definition:
gis.h:440
Cell_stats
Definition:
raster.h:181
FPRange
Definition:
raster.h:218
GDAL_link
Definition:
R.h:19
GDAL_link::band
GDALRasterBandH band
Definition:
R.h:27
GDAL_link::null_val
DCELL null_val
Definition:
R.h:22
GDAL_link::data
GDALDatasetH data
Definition:
R.h:26
GDAL_link::vflip
int vflip
Definition:
R.h:24
GDAL_link::filename
char * filename
Definition:
R.h:20
GDAL_link::type
GDALDataType type
Definition:
R.h:28
GDAL_link::hflip
int hflip
Definition:
R.h:23
GDAL_link::band_num
int band_num
Definition:
R.h:21
Quant
Definition:
raster.h:80
R__
Definition:
R.h:87
R__::compress_nulls
int compress_nulls
Definition:
R.h:94
R__::fileinfo
struct fileinfo * fileinfo
Definition:
R.h:101
R__::auto_mask
int auto_mask
Definition:
R.h:90
R__::compression_type
int compression_type
Definition:
R.h:93
R__::window_set
int window_set
Definition:
R.h:95
R__::want_histogram
int want_histogram
Definition:
R.h:91
R__::fileinfo_count
int fileinfo_count
Definition:
R.h:100
R__::fp_type
RASTER_MAP_TYPE fp_type
Definition:
R.h:88
R__::nbytes
int nbytes
Definition:
R.h:92
R__::split_window
int split_window
Definition:
R.h:96
R__::mask_fd
int mask_fd
Definition:
R.h:89
R__::wr_window
struct Cell_head wr_window
Definition:
R.h:98
R__::rd_window
struct Cell_head rd_window
Definition:
R.h:97
R_vrt
Definition:
R.h:46
R_vrt::tileinfo
struct tileinfo * tileinfo
Definition:
R.h:48
R_vrt::tlist
struct ilist * tlist
Definition:
R.h:49
R_vrt::tilecount
int tilecount
Definition:
R.h:47
Range
Definition:
raster.h:211
Reclass
Definition:
raster.h:31
fileinfo
Definition:
R.h:53
fileinfo::row_ptr
off_t * row_ptr
Definition:
R.h:62
fileinfo::data_fd
int data_fd
Definition:
R.h:81
fileinfo::mapset
char * mapset
Definition:
R.h:77
fileinfo::quant
struct Quant quant
Definition:
R.h:79
fileinfo::map_type
RASTER_MAP_TYPE map_type
Definition:
R.h:72
fileinfo::cur_nbytes
int cur_nbytes
Definition:
R.h:67
fileinfo::want_histogram
int want_histogram
Definition:
R.h:60
fileinfo::null_bits
unsigned char * null_bits
Definition:
R.h:70
fileinfo::vrt
struct R_vrt * vrt
Definition:
R.h:83
fileinfo::fp_range
struct FPRange fp_range
Definition:
R.h:59
fileinfo::null_fd
int null_fd
Definition:
R.h:69
fileinfo::cellhd
struct Cell_head cellhd
Definition:
R.h:55
fileinfo::col_map
COLUMN_MAPPING * col_map
Definition:
R.h:63
fileinfo::null_row_ptr
off_t * null_row_ptr
Definition:
R.h:82
fileinfo::reclass
struct Reclass reclass
Definition:
R.h:56
fileinfo::cur_row
int cur_row
Definition:
R.h:65
fileinfo::reclass_flag
int reclass_flag
Definition:
R.h:61
fileinfo::gdal
struct GDAL_link * gdal
Definition:
R.h:80
fileinfo::io_error
int io_error
Definition:
R.h:78
fileinfo::open_mode
int open_mode
Definition:
R.h:54
fileinfo::null_file_exists
int null_file_exists
Definition:
R.h:75
fileinfo::data
unsigned char * data
Definition:
R.h:68
fileinfo::name
char * name
Definition:
R.h:76
fileinfo::temp_name
char * temp_name
Definition:
R.h:73
fileinfo::statf
struct Cell_stats statf
Definition:
R.h:57
fileinfo::C2
double C2
Definition:
R.h:64
fileinfo::C1
double C1
Definition:
R.h:64
fileinfo::null_cur_row
int null_cur_row
Definition:
R.h:66
fileinfo::null_temp_name
char * null_temp_name
Definition:
R.h:74
fileinfo::range
struct Range range
Definition:
R.h:58
fileinfo::nbytes
int nbytes
Definition:
R.h:71
ilist
List of integers.
Definition:
gis.h:709
tileinfo
Definition:
R.h:39
tileinfo::cellhd
struct Cell_head cellhd
Definition:
R.h:42
tileinfo::name
char * name
Definition:
R.h:40
tileinfo::clist
struct ilist * clist
Definition:
R.h:43
tileinfo::mapset
char * mapset
Definition:
R.h:41
lib
raster
R.h
Generated on Sun Dec 22 2024 07:38:19 for GRASS GIS 8 Programmer's Manual by
1.9.1