GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
sample.c File Reference

Raster library - Sampling methods (extract a cell value from raster map) More...

#include <string.h>
#include <unistd.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/glocale.h>
Include dependency graph for sample.c:

Go to the source code of this file.

Functions

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. More...
 
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) More...
 
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). More...
 
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). More...
 

Detailed Description

Raster library - Sampling methods (extract a cell value from raster map)

1/2006: moved to libgis from v.sample/v.drape for clone removal

(C) 2001-2009 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
James Darrell McCauley <darrell mccauley-usa.com>, http://mccauley-usa.com/

Definition in file sample.c.

Function Documentation

◆ Rast_get_sample()

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.

Extract a cell value from raster map at given northing and easting with a sampled 3x3 window using a specified interpolation method.

  • NEAREST neighbor interpolation
  • BILINEAR bilinear interpolation
  • CUBIC cubic interpolation
Parameters
fdfile descriptor
windowregion settings
catscategories
northnorthing position
easteasting position
usedescflag to scan category label
itypeinterpolation method
Returns
cell value at given position

Definition at line 48 of file sample.c.

◆ Rast_get_sample_bilinear()

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).

Extract a cell value from raster map at given northing and easting with a sampled 3x3 window using a bilinear interpolation.

Parameters
fdfile descriptor
windowregion settings
catscategories
northnorthing position
easteasting position
usedescflag to scan category label
Returns
cell value at given position

Definition at line 148 of file sample.c.

◆ Rast_get_sample_cubic()

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).

Extract a cell value from raster map at given northing and easting with a sampled 3x3 window using a cubic interpolation.

Parameters
fdfile descriptor
windowregion settings
catscategories
northnorthing position
easteasting position
usedescflag to scan category label
Returns
cell value at given position

Definition at line 238 of file sample.c.

◆ Rast_get_sample_nearest()

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)

Extract a cell value from raster map at given northing and easting with a sampled 3x3 window using a neighbor interpolation.

Parameters
fdfile descriptor
windowregion settings
catscategories
northnorthing position
easteasting position
usedescflag to scan category label
Returns
cell value at given position

Definition at line 91 of file sample.c.