PostGIS 3.7.0dev-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 1396 of file rt_band.c.

1402{
1403 if (resample == RT_BILINEAR) {
1405 band, xr, yr, r_value, r_nodata
1406 );
1407 }
1408 else if (resample == RT_NEAREST) {
1409 return rt_band_get_pixel(
1410 band, floor(xr), floor(yr),
1411 r_value, r_nodata
1412 );
1413 }
1414 else {
1415 rtwarn("Invalid resample type requested %d", resample);
1416 return ES_ERROR;
1417 }
1418
1419}
void void void rtwarn(const char *fmt,...) __attribute__((format(printf
@ RT_BILINEAR
Definition librtcore.h:1480
@ RT_NEAREST
Definition librtcore.h:1479
@ 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:1551
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:1435

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: