27 static double scancatlabel(
const char *);
50 struct Categories *cats,
double north,
double east,
68 G_fatal_error(
"Rast_get_sample: %s",
_(
"Unknown interpolation type"));
91 double east,
int usedesc)
118 result = scancatlabel(buf);
121 result = maprow[col];
146 double east,
int usedesc)
152 double frow, fcol, trow, tcol;
159 row = (int)floor(frow - 0.5);
160 col = (int)floor(fcol - 0.5);
162 trow = frow - row - 0.5;
163 tcol = fcol - col - 0.5;
192 grid[0][0] = scancatlabel(buf);
194 grid[0][1] = scancatlabel(buf);
196 grid[1][0] = scancatlabel(buf);
198 grid[1][1] = scancatlabel(buf);
201 grid[0][0] = arow[col];
202 grid[0][1] = arow[col + 1];
203 grid[1][0] = brow[col];
204 grid[1][1] = brow[col + 1];
208 grid[1][0], grid[1][1]);
233 struct Categories *cats,
double north,
double east,
239 double frow, fcol, trow, tcol;
242 for (i = 0; i < 4; i++)
249 row = (int)floor(frow - 1.5);
250 col = (int)floor(fcol - 1.5);
252 trow = frow - row - 1.5;
253 tcol = fcol - col - 1.5;
261 for (i = 0; i < 4; i++)
264 for (i = 0; i < 4; i++)
265 for (j = 0; j < 4; j++)
282 for (i = 0; i < 4; i++) {
283 for (j = 0; j < 4; j++) {
286 grid[i][j] = scancatlabel(buf);
291 for (i = 0; i < 4; i++)
292 for (j = 0; j < 4; j++)
293 grid[i][j] = rows[i][col + j];
297 tcol, trow, grid[0][0], grid[0][1], grid[0][2], grid[0][3], grid[1][0],
298 grid[1][1], grid[1][2], grid[1][3], grid[2][0], grid[2][1], grid[2][2],
299 grid[2][3], grid[3][0], grid[3][1], grid[3][2], grid[3][3]);
302 for (i = 0; i < 4; i++)
308 static double scancatlabel(
const char *str)
312 if (strcmp(str,
"no data") != 0)
313 sscanf(str,
"%lf", &val);
315 G_warning(
_(
"\"no data\" label found; setting to zero"));
void G_free(void *)
Free allocated memory.
void G_squeeze(char *)
Remove superfluous white space.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
DCELL Rast_interp_bilinear(double, double, DCELL, DCELL, DCELL, DCELL)
double Rast_easting_to_col(double, const struct Cell_head *)
Easting to column.
DCELL Rast_interp_bicubic(double, double, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL)
void Rast_set_d_null_value(DCELL *, int)
To set a number of DCELL raster values to NULL.
void Rast_get_d_row(int, DCELL *, int)
Get raster row (DCELL type)
DCELL * Rast_allocate_d_buf(void)
Allocates memory for a raster map of type DCELL.
char * Rast_get_c_cat(CELL *, struct Categories *)
Get a raster category label (CELL)
int Rast_window_cols(void)
Number of columns in active window.
int Rast_window_rows(void)
Number of rows in active window.
double Rast_northing_to_row(double, const struct Cell_head *)
Northing to row.
#define Rast_is_d_null_value(dcellVal)
DCELL Rast_get_sample_cubic(int fd, const struct Cell_head *window, struct Categories *cats, double north, double east, int usedesc)
Extract a cell value from raster map (cubic interpolation).
DCELL Rast_get_sample_nearest(int fd, const struct Cell_head *window, struct Categories *cats, double north, double east, int usedesc)
Extract a cell value from raster map (neighbor interpolation)
DCELL Rast_get_sample_bilinear(int fd, const struct Cell_head *window, struct Categories *cats, double north, double east, int usedesc)
Extract a cell value from raster map (bilinear interpolation).
DCELL Rast_get_sample(int fd, const struct Cell_head *window, struct Categories *cats, double north, double east, int usedesc, INTERP_TYPE itype)
Extract a cell value from raster map.
2D/3D raster map header (used also for region)