PostGIS  2.1.10dev-r@@SVN_REVISION@@
rt_errorstate rt_band_set_isnodata_flag ( rt_band  band,
int  flag 
)

Set isnodata flag value.

Parameters
band: the band on which to set the isnodata flag
flag: the new isnodata flag value. Must be 1 or 0
Returns
ES_NONE or ES_ERROR

Definition at line 2023 of file rt_api.c.

References ES_ERROR, ES_NONE, rt_band_t::hasnodata, rt_band_t::isnodata, and rterror().

Referenced by RASTER_setBandIsNoData(), RASTER_tile(), rt_band_set_pixel_line(), and rt_raster_generate_new_band().

2023  {
2024  assert(NULL != band);
2025 
2026  if (!band->hasnodata) {
2027  /* silently permit setting isnodata flag to FALSE */
2028  if (!flag)
2029  band->isnodata = 0;
2030  else {
2031  rterror("rt_band_set_isnodata_flag: Cannot set isnodata flag as band has no NODATA");
2032  return ES_ERROR;
2033  }
2034  }
2035  else
2036  band->isnodata = (flag) ? 1 : 0;
2037 
2038  return ES_NONE;
2039 }
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895
int32_t isnodata
Definition: rt_api.h:2244
int32_t hasnodata
Definition: rt_api.h:2243

Here is the call graph for this function:

Here is the caller graph for this function: