PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum RASTER_reclass ( PG_FUNCTION_ARGS  )

Definition at line 10535 of file rt_pg.c.

References ovdump::band, rt_reclassexpr_t::dst, rt_reclassexpr_t::rt_reclassrange::exc_max, rt_reclassexpr_t::rt_reclassrange::exc_min, FALSE, rt_reclassexpr_t::rt_reclassrange::inc_max, rt_reclassexpr_t::rt_reclassrange::inc_min, rt_reclassexpr_t::rt_reclassrange::max, rt_reclassexpr_t::rt_reclassrange::min, pixval::nband, POSTGIS_RT_DEBUG, POSTGIS_RT_DEBUGF, PT_END, rtrowdump::raster, rt_band_destroy(), rt_band_reclass(), rt_pixtype_index_from_name(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_band(), rt_raster_get_num_bands(), rt_raster_replace_band(), rt_raster_serialize(), rtpg_chartrim(), rtpg_removespaces(), rtpg_strrstr(), rtpg_strsplit(), rt_raster_serialized_t::size, rt_reclassexpr_t::src, and TRUE.

10535  {
10536  rt_pgraster *pgraster = NULL;
10537  rt_pgraster *pgrtn = NULL;
10538  rt_raster raster = NULL;
10539  rt_band band = NULL;
10540  rt_band newband = NULL;
10541  uint32_t numBands = 0;
10542 
10543  ArrayType *array;
10544  Oid etype;
10545  Datum *e;
10546  bool *nulls;
10547  int16 typlen;
10548  bool typbyval;
10549  char typalign;
10550  int n = 0;
10551 
10552  int i = 0;
10553  int j = 0;
10554  int k = 0;
10555 
10556  int a = 0;
10557  int b = 0;
10558  int c = 0;
10559 
10560  rt_reclassexpr *exprset = NULL;
10561  HeapTupleHeader tup;
10562  bool isnull;
10563  Datum tupv;
10564  uint32_t nband = 0;
10565  char *expr = NULL;
10566  text *exprtext = NULL;
10567  double val = 0;
10568  char *junk = NULL;
10569  int inc_val = 0;
10570  int exc_val = 0;
10571  char *pixeltype = NULL;
10572  text *pixeltypetext = NULL;
10573  rt_pixtype pixtype = PT_END;
10574  double nodataval = 0;
10575  bool hasnodata = FALSE;
10576 
10577  char **comma_set = NULL;
10578  int comma_n = 0;
10579  char **colon_set = NULL;
10580  int colon_n = 0;
10581  char **dash_set = NULL;
10582  int dash_n = 0;
10583 
10584  POSTGIS_RT_DEBUG(3, "RASTER_reclass: Starting");
10585 
10586  /* pgraster is null, return null */
10587  if (PG_ARGISNULL(0))
10588  PG_RETURN_NULL();
10589  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
10590 
10591  /* raster */
10592  raster = rt_raster_deserialize(pgraster, FALSE);
10593  if (!raster) {
10594  PG_FREE_IF_COPY(pgraster, 0);
10595  elog(ERROR, "RASTER_reclass: Could not deserialize raster");
10596  PG_RETURN_NULL();
10597  }
10598  numBands = rt_raster_get_num_bands(raster);
10599  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: %d possible bands to be reclassified", numBands);
10600 
10601  /* process set of reclassarg */
10602  POSTGIS_RT_DEBUG(3, "RASTER_reclass: Processing Arg 1 (reclassargset)");
10603  array = PG_GETARG_ARRAYTYPE_P(1);
10604  etype = ARR_ELEMTYPE(array);
10605  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
10606 
10607  deconstruct_array(array, etype, typlen, typbyval, typalign, &e,
10608  &nulls, &n);
10609 
10610  if (!n) {
10611  elog(NOTICE, "Invalid argument for reclassargset. Returning original raster");
10612 
10613  pgrtn = rt_raster_serialize(raster);
10614  rt_raster_destroy(raster);
10615  PG_FREE_IF_COPY(pgraster, 0);
10616  if (!pgrtn)
10617  PG_RETURN_NULL();
10618 
10619  SET_VARSIZE(pgrtn, pgrtn->size);
10620  PG_RETURN_POINTER(pgrtn);
10621  }
10622 
10623  /*
10624  process each element of reclassarg
10625  each element is the index of the band to process, the set
10626  of reclass ranges and the output band's pixeltype
10627  */
10628  for (i = 0; i < n; i++) {
10629  if (nulls[i]) continue;
10630 
10631  /* each element is a tuple */
10632  tup = (HeapTupleHeader) DatumGetPointer(e[i]);
10633  if (NULL == tup) {
10634  elog(NOTICE, "Invalid argument for reclassargset. Returning original raster");
10635 
10636  pgrtn = rt_raster_serialize(raster);
10637  rt_raster_destroy(raster);
10638  PG_FREE_IF_COPY(pgraster, 0);
10639  if (!pgrtn)
10640  PG_RETURN_NULL();
10641 
10642  SET_VARSIZE(pgrtn, pgrtn->size);
10643  PG_RETURN_POINTER(pgrtn);
10644  }
10645 
10646  /* band index (1-based) */
10647  tupv = GetAttributeByName(tup, "nband", &isnull);
10648  if (isnull) {
10649  elog(NOTICE, "Invalid argument for reclassargset. Missing value of nband for reclassarg of index %d . Returning original raster", i);
10650 
10651  pgrtn = rt_raster_serialize(raster);
10652  rt_raster_destroy(raster);
10653  PG_FREE_IF_COPY(pgraster, 0);
10654  if (!pgrtn)
10655  PG_RETURN_NULL();
10656 
10657  SET_VARSIZE(pgrtn, pgrtn->size);
10658  PG_RETURN_POINTER(pgrtn);
10659  }
10660  nband = DatumGetInt32(tupv);
10661  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: expression for band %d", nband);
10662 
10663  /* valid band index? */
10664  if (nband < 1 || nband > numBands) {
10665  elog(NOTICE, "Invalid argument for reclassargset. Invalid band index (must use 1-based) for reclassarg of index %d . Returning original raster", i);
10666 
10667  pgrtn = rt_raster_serialize(raster);
10668  rt_raster_destroy(raster);
10669  PG_FREE_IF_COPY(pgraster, 0);
10670  if (!pgrtn)
10671  PG_RETURN_NULL();
10672 
10673  SET_VARSIZE(pgrtn, pgrtn->size);
10674  PG_RETURN_POINTER(pgrtn);
10675  }
10676 
10677  /* reclass expr */
10678  tupv = GetAttributeByName(tup, "reclassexpr", &isnull);
10679  if (isnull) {
10680  elog(NOTICE, "Invalid argument for reclassargset. Missing value of reclassexpr for reclassarg of index %d . Returning original raster", i);
10681 
10682  pgrtn = rt_raster_serialize(raster);
10683  rt_raster_destroy(raster);
10684  PG_FREE_IF_COPY(pgraster, 0);
10685  if (!pgrtn)
10686  PG_RETURN_NULL();
10687 
10688  SET_VARSIZE(pgrtn, pgrtn->size);
10689  PG_RETURN_POINTER(pgrtn);
10690  }
10691  exprtext = (text *) DatumGetPointer(tupv);
10692  if (NULL == exprtext) {
10693  elog(NOTICE, "Invalid argument for reclassargset. Missing value of reclassexpr for reclassarg of index %d . Returning original raster", i);
10694 
10695  pgrtn = rt_raster_serialize(raster);
10696  rt_raster_destroy(raster);
10697  PG_FREE_IF_COPY(pgraster, 0);
10698  if (!pgrtn)
10699  PG_RETURN_NULL();
10700 
10701  SET_VARSIZE(pgrtn, pgrtn->size);
10702  PG_RETURN_POINTER(pgrtn);
10703  }
10704  expr = text_to_cstring(exprtext);
10705  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: expr (raw) %s", expr);
10706  expr = rtpg_removespaces(expr);
10707  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: expr (clean) %s", expr);
10708 
10709  /* split string to its components */
10710  /* comma (,) separating rangesets */
10711  comma_set = rtpg_strsplit(expr, ",", &comma_n);
10712  if (comma_n < 1) {
10713  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
10714 
10715  pgrtn = rt_raster_serialize(raster);
10716  rt_raster_destroy(raster);
10717  PG_FREE_IF_COPY(pgraster, 0);
10718  if (!pgrtn)
10719  PG_RETURN_NULL();
10720 
10721  SET_VARSIZE(pgrtn, pgrtn->size);
10722  PG_RETURN_POINTER(pgrtn);
10723  }
10724 
10725  /* set of reclass expressions */
10726  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: %d possible expressions", comma_n);
10727  exprset = palloc(comma_n * sizeof(rt_reclassexpr));
10728 
10729  for (a = 0, j = 0; a < comma_n; a++) {
10730  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: map %s", comma_set[a]);
10731 
10732  /* colon (:) separating range "src" and "dst" */
10733  colon_set = rtpg_strsplit(comma_set[a], ":", &colon_n);
10734  if (colon_n != 2) {
10735  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
10736  for (k = 0; k < j; k++) pfree(exprset[k]);
10737  pfree(exprset);
10738 
10739  pgrtn = rt_raster_serialize(raster);
10740  rt_raster_destroy(raster);
10741  PG_FREE_IF_COPY(pgraster, 0);
10742  if (!pgrtn)
10743  PG_RETURN_NULL();
10744 
10745  SET_VARSIZE(pgrtn, pgrtn->size);
10746  PG_RETURN_POINTER(pgrtn);
10747  }
10748 
10749  /* allocate mem for reclass expression */
10750  exprset[j] = palloc(sizeof(struct rt_reclassexpr_t));
10751 
10752  for (b = 0; b < colon_n; b++) {
10753  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: range %s", colon_set[b]);
10754 
10755  /* dash (-) separating "min" and "max" */
10756  dash_set = rtpg_strsplit(colon_set[b], "-", &dash_n);
10757  if (dash_n < 1 || dash_n > 3) {
10758  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
10759  for (k = 0; k < j; k++) pfree(exprset[k]);
10760  pfree(exprset);
10761 
10762  pgrtn = rt_raster_serialize(raster);
10763  rt_raster_destroy(raster);
10764  PG_FREE_IF_COPY(pgraster, 0);
10765  if (!pgrtn)
10766  PG_RETURN_NULL();
10767 
10768  SET_VARSIZE(pgrtn, pgrtn->size);
10769  PG_RETURN_POINTER(pgrtn);
10770  }
10771 
10772  for (c = 0; c < dash_n; c++) {
10773  /* need to handle: (-9999-100 -> "(", "9999", "100" */
10774  if (
10775  c < 1 &&
10776  strlen(dash_set[c]) == 1 && (
10777  strchr(dash_set[c], '(') != NULL ||
10778  strchr(dash_set[c], '[') != NULL ||
10779  strchr(dash_set[c], ')') != NULL ||
10780  strchr(dash_set[c], ']') != NULL
10781  )
10782  ) {
10783  junk = palloc(sizeof(char) * (strlen(dash_set[c + 1]) + 2));
10784  if (NULL == junk) {
10785  for (k = 0; k <= j; k++) pfree(exprset[k]);
10786  pfree(exprset);
10787  rt_raster_destroy(raster);
10788  PG_FREE_IF_COPY(pgraster, 0);
10789 
10790  elog(ERROR, "RASTER_reclass: Could not allocate memory");
10791  PG_RETURN_NULL();
10792  }
10793 
10794  sprintf(junk, "%s%s", dash_set[c], dash_set[c + 1]);
10795  c++;
10796  dash_set[c] = repalloc(dash_set[c], sizeof(char) * (strlen(junk) + 1));
10797  strcpy(dash_set[c], junk);
10798  pfree(junk);
10799 
10800  /* rebuild dash_set */
10801  for (k = 1; k < dash_n; k++) {
10802  dash_set[k - 1] = repalloc(dash_set[k - 1], (strlen(dash_set[k]) + 1) * sizeof(char));
10803  strcpy(dash_set[k - 1], dash_set[k]);
10804  }
10805  dash_n--;
10806  c--;
10807  pfree(dash_set[dash_n]);
10808  dash_set = repalloc(dash_set, sizeof(char *) * dash_n);
10809  }
10810 
10811  /* there shouldn't be more than two in dash_n */
10812  if (c < 1 && dash_n > 2) {
10813  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
10814  for (k = 0; k < j; k++) pfree(exprset[k]);
10815  pfree(exprset);
10816 
10817  pgrtn = rt_raster_serialize(raster);
10818  rt_raster_destroy(raster);
10819  PG_FREE_IF_COPY(pgraster, 0);
10820  if (!pgrtn)
10821  PG_RETURN_NULL();
10822 
10823  SET_VARSIZE(pgrtn, pgrtn->size);
10824  PG_RETURN_POINTER(pgrtn);
10825  }
10826 
10827  /* check interval flags */
10828  exc_val = 0;
10829  inc_val = 1;
10830  /* range */
10831  if (dash_n != 1) {
10832  /* min */
10833  if (c < 1) {
10834  if (
10835  strchr(dash_set[c], ')') != NULL ||
10836  strchr(dash_set[c], ']') != NULL
10837  ) {
10838  exc_val = 1;
10839  inc_val = 1;
10840  }
10841  else if (strchr(dash_set[c], '(') != NULL){
10842  inc_val = 0;
10843  }
10844  else {
10845  inc_val = 1;
10846  }
10847  }
10848  /* max */
10849  else {
10850  if (
10851  strrchr(dash_set[c], '(') != NULL ||
10852  strrchr(dash_set[c], '[') != NULL
10853  ) {
10854  exc_val = 1;
10855  inc_val = 0;
10856  }
10857  else if (strrchr(dash_set[c], ']') != NULL) {
10858  inc_val = 1;
10859  }
10860  else {
10861  inc_val = 0;
10862  }
10863  }
10864  }
10865  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: exc_val %d inc_val %d", exc_val, inc_val);
10866 
10867  /* remove interval flags */
10868  dash_set[c] = rtpg_chartrim(dash_set[c], "()[]");
10869  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: min/max (char) %s", dash_set[c]);
10870 
10871  /* value from string to double */
10872  errno = 0;
10873  val = strtod(dash_set[c], &junk);
10874  if (errno != 0 || dash_set[c] == junk) {
10875  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
10876  for (k = 0; k < j; k++) pfree(exprset[k]);
10877  pfree(exprset);
10878 
10879  pgrtn = rt_raster_serialize(raster);
10880  rt_raster_destroy(raster);
10881  PG_FREE_IF_COPY(pgraster, 0);
10882  if (!pgrtn)
10883  PG_RETURN_NULL();
10884 
10885  SET_VARSIZE(pgrtn, pgrtn->size);
10886  PG_RETURN_POINTER(pgrtn);
10887  }
10888  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: min/max (double) %f", val);
10889 
10890  /* strsplit removes dash (a.k.a. negative sign), compare now to restore */
10891  if (c < 1)
10892  junk = strstr(colon_set[b], dash_set[c]);
10893  else
10894  junk = rtpg_strrstr(colon_set[b], dash_set[c]);
10895  /* not beginning of string */
10896  if (junk != colon_set[b]) {
10897  /* prior is a dash */
10898  if (*(junk - 1) == '-') {
10899  /* prior is beginning of string or prior - 1 char is dash, negative number */
10900  if (
10901  ((junk - 1) == colon_set[b]) ||
10902  (*(junk - 2) == '-') ||
10903  (*(junk - 2) == '[') ||
10904  (*(junk - 2) == '(')
10905  ) {
10906  val *= -1.;
10907  }
10908  }
10909  }
10910  POSTGIS_RT_DEBUGF(5, "RASTER_reclass: min/max (double) %f", val);
10911 
10912  /* src */
10913  if (b < 1) {
10914  /* singular value */
10915  if (dash_n == 1) {
10916  exprset[j]->src.exc_min = exprset[j]->src.exc_max = exc_val;
10917  exprset[j]->src.inc_min = exprset[j]->src.inc_max = inc_val;
10918  exprset[j]->src.min = exprset[j]->src.max = val;
10919  }
10920  /* min */
10921  else if (c < 1) {
10922  exprset[j]->src.exc_min = exc_val;
10923  exprset[j]->src.inc_min = inc_val;
10924  exprset[j]->src.min = val;
10925  }
10926  /* max */
10927  else {
10928  exprset[j]->src.exc_max = exc_val;
10929  exprset[j]->src.inc_max = inc_val;
10930  exprset[j]->src.max = val;
10931  }
10932  }
10933  /* dst */
10934  else {
10935  /* singular value */
10936  if (dash_n == 1)
10937  exprset[j]->dst.min = exprset[j]->dst.max = val;
10938  /* min */
10939  else if (c < 1)
10940  exprset[j]->dst.min = val;
10941  /* max */
10942  else
10943  exprset[j]->dst.max = val;
10944  }
10945  }
10946  pfree(dash_set);
10947  }
10948  pfree(colon_set);
10949 
10950  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: or: %f - %f nr: %f - %f"
10951  , exprset[j]->src.min
10952  , exprset[j]->src.max
10953  , exprset[j]->dst.min
10954  , exprset[j]->dst.max
10955  );
10956  j++;
10957  }
10958  pfree(comma_set);
10959 
10960  /* pixel type */
10961  tupv = GetAttributeByName(tup, "pixeltype", &isnull);
10962  if (isnull) {
10963  elog(NOTICE, "Invalid argument for reclassargset. Missing value of pixeltype for reclassarg of index %d . Returning original raster", i);
10964 
10965  pgrtn = rt_raster_serialize(raster);
10966  rt_raster_destroy(raster);
10967  PG_FREE_IF_COPY(pgraster, 0);
10968  if (!pgrtn)
10969  PG_RETURN_NULL();
10970 
10971  SET_VARSIZE(pgrtn, pgrtn->size);
10972  PG_RETURN_POINTER(pgrtn);
10973  }
10974  pixeltypetext = (text *) DatumGetPointer(tupv);
10975  if (NULL == pixeltypetext) {
10976  elog(NOTICE, "Invalid argument for reclassargset. Missing value of pixeltype for reclassarg of index %d . Returning original raster", i);
10977 
10978  pgrtn = rt_raster_serialize(raster);
10979  rt_raster_destroy(raster);
10980  PG_FREE_IF_COPY(pgraster, 0);
10981  if (!pgrtn)
10982  PG_RETURN_NULL();
10983 
10984  SET_VARSIZE(pgrtn, pgrtn->size);
10985  PG_RETURN_POINTER(pgrtn);
10986  }
10987  pixeltype = text_to_cstring(pixeltypetext);
10988  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: pixeltype %s", pixeltype);
10989  pixtype = rt_pixtype_index_from_name(pixeltype);
10990 
10991  /* nodata */
10992  tupv = GetAttributeByName(tup, "nodataval", &isnull);
10993  if (isnull) {
10994  nodataval = 0;
10995  hasnodata = FALSE;
10996  }
10997  else {
10998  nodataval = DatumGetFloat8(tupv);
10999  hasnodata = TRUE;
11000  }
11001  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: nodataval %f", nodataval);
11002  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: hasnodata %d", hasnodata);
11003 
11004  /* do reclass */
11005  band = rt_raster_get_band(raster, nband - 1);
11006  if (!band) {
11007  elog(NOTICE, "Could not find raster band of index %d. Returning original raster", nband);
11008  for (k = 0; k < j; k++) pfree(exprset[k]);
11009  pfree(exprset);
11010 
11011  pgrtn = rt_raster_serialize(raster);
11012  rt_raster_destroy(raster);
11013  PG_FREE_IF_COPY(pgraster, 0);
11014  if (!pgrtn)
11015  PG_RETURN_NULL();
11016 
11017  SET_VARSIZE(pgrtn, pgrtn->size);
11018  PG_RETURN_POINTER(pgrtn);
11019  }
11020  newband = rt_band_reclass(band, pixtype, hasnodata, nodataval, exprset, j);
11021  if (!newband) {
11022  for (k = 0; k < j; k++) pfree(exprset[k]);
11023  pfree(exprset);
11024 
11025  rt_raster_destroy(raster);
11026  PG_FREE_IF_COPY(pgraster, 0);
11027 
11028  elog(ERROR, "RASTER_reclass: Could not reclassify raster band of index %d", nband);
11029  PG_RETURN_NULL();
11030  }
11031 
11032  /* replace old band with new band */
11033  if (rt_raster_replace_band(raster, newband, nband - 1) == NULL) {
11034  for (k = 0; k < j; k++) pfree(exprset[k]);
11035  pfree(exprset);
11036 
11037  rt_band_destroy(newband);
11038  rt_raster_destroy(raster);
11039  PG_FREE_IF_COPY(pgraster, 0);
11040 
11041  elog(ERROR, "RASTER_reclass: Could not replace raster band of index %d with reclassified band", nband);
11042  PG_RETURN_NULL();
11043  }
11044 
11045  /* old band is in the variable band */
11046  rt_band_destroy(band);
11047 
11048  /* free exprset */
11049  for (k = 0; k < j; k++) pfree(exprset[k]);
11050  pfree(exprset);
11051  }
11052 
11053  pgrtn = rt_raster_serialize(raster);
11054  rt_raster_destroy(raster);
11055  PG_FREE_IF_COPY(pgraster, 0);
11056  if (!pgrtn)
11057  PG_RETURN_NULL();
11058 
11059  POSTGIS_RT_DEBUG(3, "RASTER_reclass: Finished");
11060 
11061  SET_VARSIZE(pgrtn, pgrtn->size);
11062  PG_RETURN_POINTER(pgrtn);
11063 }
static char * rtpg_strrstr(const char *s1, const char *s2)
Definition: rt_pg.c:895
static char * rtpg_removespaces(char *str)
Definition: rt_pg.c:837
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_api.c:5677
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_api.c:8158
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
struct rt_reclassexpr_t::rt_reclassrange dst
Definition: rt_api.h:184
rt_band rt_raster_replace_band(rt_raster raster, rt_band band, int index)
Replace band at provided index with new band.
Definition: rt_api.c:8702
tuple band
Definition: ovdump.py:57
tuple raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:123
static char ** rtpg_strsplit(const char *str, const char *delimiter, int *n)
Definition: rt_pg.c:772
struct rt_reclassexpr_t::rt_reclassrange src
rt_pixtype
Definition: rt_api.h:172
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rt_pg.h:58
tuple nband
Definition: pixval.py:52
rt_band rt_band_reclass(rt_band srcband, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, rt_reclassexpr *exprset, int exprcount)
Returns new band with values reclassified.
Definition: rt_api.c:5009
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_api.c:1650
rt_band rt_raster_get_band(rt_raster raster, int n)
Return Nth band, or NULL if unavailable.
Definition: rt_api.c:5686
static char * rtpg_chartrim(const char *input, char *remove)
Definition: rt_pg.c:740
#define FALSE
Definition: dbfopen.c:169
Struct definitions.
Definition: rt_api.h:2175
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rt_pg.h:62
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_api.c:8350
rt_pixtype rt_pixtype_index_from_name(const char *pixname)
Definition: rt_api.c:1138
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function: