26 static double scancatlabel(
const char *);
51 double north,
double east,
70 G_fatal_error(
"Rast_get_sample: %s",
_(
"Unknown interpolation type"));
94 double north,
double east,
int usedesc)
121 result = scancatlabel(buf);
124 result = maprow[col];
151 double north,
double east,
int usedesc)
157 double frow, fcol, trow, tcol;
164 row = (int)floor(frow - 0.5);
165 col = (int)floor(fcol - 0.5);
167 trow = frow - row - 0.5;
168 tcol = fcol - col - 0.5;
197 grid[0][0] = scancatlabel(buf);
199 grid[0][1] = scancatlabel(buf);
201 grid[1][0] = scancatlabel(buf);
203 grid[1][1] = scancatlabel(buf);
206 grid[0][0] = arow[col];
207 grid[0][1] = arow[col + 1];
208 grid[1][0] = brow[col];
209 grid[1][1] = brow[col + 1];
213 grid[0][0], grid[0][1], grid[1][0],
241 double north,
double east,
int usedesc)
246 double frow, fcol, trow, tcol;
249 for (i = 0; i < 4; i++)
256 row = (int)floor(frow - 1.5);
257 col = (int)floor(fcol - 1.5);
259 trow = frow - row - 1.5;
260 tcol = fcol - col - 1.5;
268 for (i = 0; i < 4; i++)
271 for (i = 0; i < 4; i++)
272 for (j = 0; j < 4; j++)
289 for (i = 0; i < 4; i++) {
290 for (j = 0; j < 4; j++) {
294 grid[i][j] = scancatlabel(buf);
299 for (i = 0; i < 4; i++)
300 for (j = 0; j < 4; j++)
301 grid[i][j] = rows[i][col + j];
305 grid[0][0], grid[0][1], grid[0][2],
306 grid[0][3], grid[1][0], grid[1][1],
307 grid[1][2], grid[1][3], grid[2][0],
308 grid[2][1], grid[2][2], grid[2][3],
309 grid[3][0], grid[3][1], grid[3][2],
313 for (i = 0; i < 4; i++)
320 static double scancatlabel(
const char *str)
324 if (strcmp(str,
"no data") != 0)
325 sscanf(str,
"%lf", &val);
327 G_warning(
_(
"\"no data\" label found; setting to zero"));
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
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).
2D/3D raster map header (used also for region)
#define Rast_is_d_null_value(dcellVal)
void Rast_get_d_row(int, DCELL *, int)
Get raster row (DCELL type)
double Rast_northing_to_row(double, const struct Cell_head *)
Northing to row.
void G_free(void *)
Free allocated memory.
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)
double Rast_easting_to_col(double, const struct Cell_head *)
Easting to column.
char * Rast_get_c_cat(CELL *, struct Categories *)
Get a raster category label (CELL)
DCELL * Rast_allocate_d_buf(void)
Allocates memory for a raster map of type DCELL.
DCELL Rast_interp_bicubic(double, double, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL)
int Rast_window_rows(void)
Number of rows in active window.
int Rast_window_cols(void)
Number of columns in active window.
void G_warning(const char *,...) __attribute__((format(printf
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.
DCELL Rast_interp_bilinear(double, double, DCELL, DCELL, DCELL, DCELL)
void G_squeeze(char *)
Remove superfluous white space.
void Rast_set_d_null_value(DCELL *, int)
To set a number of DCELL raster values to NULL.
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).