PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ 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 1221 of file rt_band.c.

1227 {
1228  if (resample == RT_BILINEAR) {
1230  band, xr, yr, r_value, r_nodata
1231  );
1232  }
1233  else if (resample == RT_NEAREST) {
1234  return rt_band_get_pixel(
1235  band, floor(xr), floor(yr),
1236  r_value, r_nodata
1237  );
1238  }
1239  else {
1240  rtwarn("Invalid resample type requested %d", resample);
1241  return ES_ERROR;
1242  }
1243 
1244 }
@ RT_BILINEAR
Definition: librtcore.h:1452
@ RT_NEAREST
Definition: librtcore.h:1451
void rtwarn(const char *fmt,...)
Definition: rt_context.c:244
@ ES_ERROR
Definition: librtcore.h:183
band
Definition: ovdump.py:58
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
Definition: rt_band.c:1376
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:1260

References ovdump::band, 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: