PostGIS 3.6.2dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ rt_band_get_pixel_resample()

rt_errorstate rt_band_get_pixel_resample ( rt_band  band,
double  xr,
double  yr,
rt_resample_type  resample,
double *  r_value,
int *  r_nodata 
)

Retrieve a point value from the raster using a world coordinate and selected interpolation.

Retrieve a point value from the raster using a world coordinate and selected resampling method.

Parameters
band: the band to read for values
xr: x unrounded raster coordinate
yr: y unrounded raster coordinate
r_value: return pointer for point value
r_nodata: return pointer for if this is a nodata
Returns
ES_ERROR on error, otherwise ES_NONE

Definition at line 1372 of file rt_band.c.

1378{
1379 if (resample == RT_BILINEAR) {
1381 band, xr, yr, r_value, r_nodata
1382 );
1383 }
1384 else if (resample == RT_NEAREST) {
1385 return rt_band_get_pixel(
1386 band, floor(xr), floor(yr),
1387 r_value, r_nodata
1388 );
1389 }
1390 else {
1391 rtwarn("Invalid resample type requested %d", resample);
1392 return ES_ERROR;
1393 }
1394
1395}
void void void rtwarn(const char *fmt,...) __attribute__((format(printf
@ RT_BILINEAR
Definition librtcore.h:1478
@ RT_NEAREST
Definition librtcore.h:1477
@ ES_ERROR
Definition librtcore.h:183
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
Definition rt_band.c:1527
rt_errorstate rt_band_get_pixel_bilinear(rt_band band, double xr, double yr, double *r_value, int *r_nodata)
Retrieve a point value from the raster using a world coordinate and bilinear interpolation.
Definition rt_band.c:1411

References ES_ERROR, rt_band_get_pixel(), rt_band_get_pixel_bilinear(), RT_BILINEAR, RT_NEAREST, and rtwarn().

Referenced by RASTER_getPixelValueResample(), and rt_raster_copy_to_geometry().

Here is the call graph for this function:
Here is the caller graph for this function: