PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum RASTER_setPixelValuesGeomval ( PG_FUNCTION_ARGS  )

Definition at line 1177 of file rtpg_pixel.c.

References ovdump::band, clamp_srid(), ES_NONE, ET_FIRST, FALSE, rtpg_setvaluesgv_geomval_t::geom, LWCOLLECTION::geoms, getPoint2d_p(), gserialized_get_srid(), gserialized_get_type(), window::gt, rtpg_setvaluesgv_arg_t::gv, rtpg_setvaluesgv_arg_t::keepnodata, lwgeom_as_lwcollection(), lwgeom_as_lwpoint(), lwgeom_as_multi(), lwgeom_force_2d(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_empty(), lwgeom_ndims(), lwgeom_to_wkb(), rtpg_setvaluesgv_geomval_t::mask, MULTIPOINTTYPE, pixval::nband, rt_iterator_t::nband, rt_iterator_t::nbnodata, LWCOLLECTION::ngeoms, rtpg_setvaluesgv_arg_t::ngv, rtpg_setvaluesgv_geomval_t::nodata, rtpg_setvaluesgv_geomval_t::pixval, LWPOINT::point, POINTTYPE, POSTGIS_RT_DEBUG, POSTGIS_RT_DEBUGF, PT_END, rtrowdump::raster, rt_iterator_t::raster, rt_band_destroy(), rt_band_get_hasnodata_flag(), rt_band_get_isnodata_flag(), rt_band_get_nodata(), rt_band_get_pixel(), rt_band_get_pixtype(), rt_band_set_pixel(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_gdal_rasterize(), rt_raster_geopoint_to_cell(), rt_raster_get_band(), rt_raster_get_geotransform_matrix(), rt_raster_get_height(), rt_raster_get_inverse_geotransform_matrix(), rt_raster_get_num_bands(), rt_raster_get_srid(), rt_raster_get_width(), rt_raster_iterator(), rt_raster_replace_band(), rt_raster_serialize(), rt_raster_set_srid(), rtpg_setvalues_geomval_callback(), rtpg_setvaluesgv_arg_destroy(), rtpg_setvaluesgv_arg_init(), rt_raster_serialized_t::size, genraster::value, rtpg_setvaluesgv_geomval_t::value, WKB_SFSQL, POINT2D::x, and POINT2D::y.

1178 {
1179  rt_pgraster *pgraster = NULL;
1180  rt_pgraster *pgrtn = NULL;
1181  rt_raster raster = NULL;
1182  rt_band band = NULL;
1183  rt_raster _raster = NULL;
1184  rt_band _band = NULL;
1185  int nband = 0; /* 1-based */
1186 
1187  int numbands = 0;
1188  int width = 0;
1189  int height = 0;
1190  int srid = 0;
1191  double gt[6] = {0};
1192 
1193  rt_pixtype pixtype = PT_END;
1194  int hasnodata = 0;
1195  double nodataval = 0;
1196 
1197  rtpg_setvaluesgv_arg arg = NULL;
1198  int allpoint = 0;
1199 
1200  ArrayType *array;
1201  Oid etype;
1202  Datum *e;
1203  bool *nulls;
1204  int16 typlen;
1205  bool typbyval;
1206  char typalign;
1207  int n = 0;
1208 
1209  HeapTupleHeader tup;
1210  bool isnull;
1211  Datum tupv;
1212 
1213  GSERIALIZED *gser = NULL;
1214  uint8_t gtype;
1215  unsigned char *wkb = NULL;
1216  size_t wkb_len;
1217 
1218  int i = 0;
1219  int j = 0;
1220  int noerr = 1;
1221 
1222  /* pgraster is null, return null */
1223  if (PG_ARGISNULL(0))
1224  PG_RETURN_NULL();
1225  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
1226 
1227  /* raster */
1228  raster = rt_raster_deserialize(pgraster, FALSE);
1229  if (!raster) {
1230  PG_FREE_IF_COPY(pgraster, 0);
1231  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not deserialize raster");
1232  PG_RETURN_NULL();
1233  }
1234 
1235  /* raster attributes */
1236  numbands = rt_raster_get_num_bands(raster);
1237  width = rt_raster_get_width(raster);
1238  height = rt_raster_get_height(raster);
1239  srid = clamp_srid(rt_raster_get_srid(raster));
1241 
1242  /* nband */
1243  if (PG_ARGISNULL(1)) {
1244  elog(NOTICE, "Band index cannot be NULL. Value must be 1-based. Returning original raster");
1245  rt_raster_destroy(raster);
1246  PG_RETURN_POINTER(pgraster);
1247  }
1248 
1249  nband = PG_GETARG_INT32(1);
1250  if (nband < 1 || nband > numbands) {
1251  elog(NOTICE, "Band index is invalid. Value must be 1-based. Returning original raster");
1252  rt_raster_destroy(raster);
1253  PG_RETURN_POINTER(pgraster);
1254  }
1255 
1256  /* get band attributes */
1257  band = rt_raster_get_band(raster, nband - 1);
1258  pixtype = rt_band_get_pixtype(band);
1259  hasnodata = rt_band_get_hasnodata_flag(band);
1260  if (hasnodata)
1261  rt_band_get_nodata(band, &nodataval);
1262 
1263  /* array of geomval (2) */
1264  if (PG_ARGISNULL(2)) {
1265  elog(NOTICE, "No values to set. Returning original raster");
1266  rt_raster_destroy(raster);
1267  PG_RETURN_POINTER(pgraster);
1268  }
1269 
1270  array = PG_GETARG_ARRAYTYPE_P(2);
1271  etype = ARR_ELEMTYPE(array);
1272  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
1273 
1274  deconstruct_array(
1275  array,
1276  etype,
1277  typlen, typbyval, typalign,
1278  &e, &nulls, &n
1279  );
1280 
1281  if (!n) {
1282  elog(NOTICE, "No values to set. Returning original raster");
1283  rt_raster_destroy(raster);
1284  PG_RETURN_POINTER(pgraster);
1285  }
1286 
1287  /* init arg */
1288  arg = rtpg_setvaluesgv_arg_init();
1289  if (arg == NULL) {
1290  rt_raster_destroy(raster);
1291  PG_FREE_IF_COPY(pgraster, 0);
1292  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not intialize argument structure");
1293  PG_RETURN_NULL();
1294  }
1295 
1296  arg->gv = palloc(sizeof(struct rtpg_setvaluesgv_geomval_t) * n);
1297  if (arg->gv == NULL) {
1299  rt_raster_destroy(raster);
1300  PG_FREE_IF_COPY(pgraster, 0);
1301  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not allocate memory for geomval array");
1302  PG_RETURN_NULL();
1303  }
1304 
1305  /* process each element */
1306  arg->ngv = 0;
1307  for (i = 0; i < n; i++) {
1308  if (nulls[i])
1309  continue;
1310 
1311  arg->gv[arg->ngv].pixval.nodata = 0;
1312  arg->gv[arg->ngv].pixval.value = 0;
1313  arg->gv[arg->ngv].geom = NULL;
1314  arg->gv[arg->ngv].mask = NULL;
1315 
1316  /* each element is a tuple */
1317  tup = (HeapTupleHeader) DatumGetPointer(e[i]);
1318  if (NULL == tup) {
1320  rt_raster_destroy(raster);
1321  PG_FREE_IF_COPY(pgraster, 0);
1322  elog(ERROR, "RASTER_setPixelValuesGeomval: Invalid argument for geomval at index %d", i);
1323  PG_RETURN_NULL();
1324  }
1325 
1326  /* first element, geometry */
1327  POSTGIS_RT_DEBUG(4, "Processing first element (geometry)");
1328  tupv = GetAttributeByName(tup, "geom", &isnull);
1329  if (isnull) {
1330  elog(NOTICE, "First argument (geom) of geomval at index %d is NULL. Skipping", i);
1331  continue;
1332  }
1333 
1334  gser = (GSERIALIZED *) PG_DETOAST_DATUM(tupv);
1335  arg->gv[arg->ngv].geom = lwgeom_from_gserialized(gser);
1336  if (arg->gv[arg->ngv].geom == NULL) {
1338  rt_raster_destroy(raster);
1339  PG_FREE_IF_COPY(pgraster, 0);
1340  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not deserialize geometry of geomval at index %d", i);
1341  PG_RETURN_NULL();
1342  }
1343 
1344  /* empty geometry */
1345  if (lwgeom_is_empty(arg->gv[arg->ngv].geom)) {
1346  elog(NOTICE, "First argument (geom) of geomval at index %d is an empty geometry. Skipping", i);
1347  continue;
1348  }
1349 
1350  /* check SRID */
1351  if (clamp_srid(gserialized_get_srid(gser)) != srid) {
1352  elog(NOTICE, "Geometry provided for geomval at index %d does not have the same SRID as the raster: %d. Returning original raster", i, srid);
1354  rt_raster_destroy(raster);
1355  PG_RETURN_POINTER(pgraster);
1356  }
1357 
1358  /* Get a 2D version of the geometry if necessary */
1359  if (lwgeom_ndims(arg->gv[arg->ngv].geom) > 2) {
1360  LWGEOM *geom2d = lwgeom_force_2d(arg->gv[arg->ngv].geom);
1361  lwgeom_free(arg->gv[arg->ngv].geom);
1362  arg->gv[arg->ngv].geom = geom2d;
1363  }
1364 
1365  /* filter for types */
1366  gtype = gserialized_get_type(gser);
1367 
1368  /* shortcuts for POINT and MULTIPOINT */
1369  if (gtype == POINTTYPE || gtype == MULTIPOINTTYPE)
1370  allpoint++;
1371 
1372  /* get wkb of geometry */
1373  POSTGIS_RT_DEBUG(3, "getting wkb of geometry");
1374  wkb = lwgeom_to_wkb(arg->gv[arg->ngv].geom, WKB_SFSQL, &wkb_len);
1375 
1376  /* rasterize geometry */
1377  arg->gv[arg->ngv].mask = rt_raster_gdal_rasterize(
1378  wkb, wkb_len,
1379  NULL,
1380  0, NULL,
1381  NULL, NULL,
1382  NULL, NULL,
1383  NULL, NULL,
1384  &(gt[1]), &(gt[5]),
1385  NULL, NULL,
1386  &(gt[0]), &(gt[3]),
1387  &(gt[2]), &(gt[4]),
1388  NULL
1389  );
1390 
1391  pfree(wkb);
1392  if (gtype != POINTTYPE && gtype != MULTIPOINTTYPE) {
1393  lwgeom_free(arg->gv[arg->ngv].geom);
1394  arg->gv[arg->ngv].geom = NULL;
1395  }
1396 
1397  if (arg->gv[arg->ngv].mask == NULL) {
1399  rt_raster_destroy(raster);
1400  PG_FREE_IF_COPY(pgraster, 0);
1401  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not rasterize geometry of geomval at index %d", i);
1402  PG_RETURN_NULL();
1403  }
1404 
1405  /* set SRID */
1406  rt_raster_set_srid(arg->gv[arg->ngv].mask, srid);
1407 
1408  /* second element, value */
1409  POSTGIS_RT_DEBUG(4, "Processing second element (val)");
1410  tupv = GetAttributeByName(tup, "val", &isnull);
1411  if (isnull) {
1412  elog(NOTICE, "Second argument (val) of geomval at index %d is NULL. Treating as NODATA", i);
1413  arg->gv[arg->ngv].pixval.nodata = 1;
1414  }
1415  else
1416  arg->gv[arg->ngv].pixval.value = DatumGetFloat8(tupv);
1417 
1418  (arg->ngv)++;
1419  }
1420 
1421  /* redim arg->gv if needed */
1422  if (arg->ngv < n) {
1423  arg->gv = repalloc(arg->gv, sizeof(struct rtpg_setvaluesgv_geomval_t) * arg->ngv);
1424  if (arg->gv == NULL) {
1426  rt_raster_destroy(raster);
1427  PG_FREE_IF_COPY(pgraster, 0);
1428  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not reallocate memory for geomval array");
1429  PG_RETURN_NULL();
1430  }
1431  }
1432 
1433  /* keepnodata */
1434  if (!PG_ARGISNULL(3))
1435  arg->keepnodata = PG_GETARG_BOOL(3);
1436  POSTGIS_RT_DEBUGF(3, "keepnodata = %d", arg->keepnodata);
1437 
1438  /* keepnodata = TRUE and band is NODATA */
1439  if (arg->keepnodata && rt_band_get_isnodata_flag(band)) {
1440  POSTGIS_RT_DEBUG(3, "keepnodata = TRUE and band is NODATA. Not doing anything");
1441  }
1442  /* all elements are points */
1443  else if (allpoint == arg->ngv) {
1444  double igt[6] = {0};
1445  double xy[2] = {0};
1446  double value = 0;
1447  int isnodata = 0;
1448 
1449  LWCOLLECTION *coll = NULL;
1450  LWPOINT *point = NULL;
1451  POINT2D p;
1452 
1453  POSTGIS_RT_DEBUG(3, "all geometries are points, using direct to pixel method");
1454 
1455  /* cache inverse gretransform matrix */
1457 
1458  /* process each geometry */
1459  for (i = 0; i < arg->ngv; i++) {
1460  /* convert geometry to collection */
1461  coll = lwgeom_as_lwcollection(lwgeom_as_multi(arg->gv[i].geom));
1462 
1463  /* process each point in collection */
1464  for (j = 0; j < coll->ngeoms; j++) {
1465  point = lwgeom_as_lwpoint(coll->geoms[j]);
1466  getPoint2d_p(point->point, 0, &p);
1467 
1468  if (rt_raster_geopoint_to_cell(raster, p.x, p.y, &(xy[0]), &(xy[1]), igt) != ES_NONE) {
1470  rt_raster_destroy(raster);
1471  PG_FREE_IF_COPY(pgraster, 0);
1472  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not process coordinates of point");
1473  PG_RETURN_NULL();
1474  }
1475 
1476  /* skip point if outside raster */
1477  if (
1478  (xy[0] < 0 || xy[0] >= width) ||
1479  (xy[1] < 0 || xy[1] >= height)
1480  ) {
1481  elog(NOTICE, "Point is outside raster extent. Skipping");
1482  continue;
1483  }
1484 
1485  /* get pixel value */
1486  if (rt_band_get_pixel(band, xy[0], xy[1], &value, &isnodata) != ES_NONE) {
1488  rt_raster_destroy(raster);
1489  PG_FREE_IF_COPY(pgraster, 0);
1490  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not get pixel value");
1491  PG_RETURN_NULL();
1492  }
1493 
1494  /* keepnodata = TRUE AND pixel value is NODATA */
1495  if (arg->keepnodata && isnodata)
1496  continue;
1497 
1498  /* set pixel */
1499  if (arg->gv[i].pixval.nodata)
1500  noerr = rt_band_set_pixel(band, xy[0], xy[1], nodataval, NULL);
1501  else
1502  noerr = rt_band_set_pixel(band, xy[0], xy[1], arg->gv[i].pixval.value, NULL);
1503 
1504  if (noerr != ES_NONE) {
1506  rt_raster_destroy(raster);
1507  PG_FREE_IF_COPY(pgraster, 0);
1508  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not set pixel value");
1509  PG_RETURN_NULL();
1510  }
1511  }
1512  }
1513  }
1514  /* run iterator otherwise */
1515  else {
1516  rt_iterator itrset;
1517 
1518  POSTGIS_RT_DEBUG(3, "a mix of geometries, using iterator method");
1519 
1520  /* init itrset */
1521  itrset = palloc(sizeof(struct rt_iterator_t) * (arg->ngv + 1));
1522  if (itrset == NULL) {
1524  rt_raster_destroy(raster);
1525  PG_FREE_IF_COPY(pgraster, 0);
1526  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not allocate memory for iterator arguments");
1527  PG_RETURN_NULL();
1528  }
1529 
1530  /* set first raster's info */
1531  itrset[0].raster = raster;
1532  itrset[0].nband = nband - 1;
1533  itrset[0].nbnodata = 1;
1534 
1535  /* set other raster's info */
1536  for (i = 0, j = 1; i < arg->ngv; i++, j++) {
1537  itrset[j].raster = arg->gv[i].mask;
1538  itrset[j].nband = 0;
1539  itrset[j].nbnodata = 1;
1540  }
1541 
1542  /* pass to iterator */
1543  noerr = rt_raster_iterator(
1544  itrset, arg->ngv + 1,
1545  ET_FIRST, NULL,
1546  pixtype,
1547  hasnodata, nodataval,
1548  0, 0,
1549  NULL,
1550  arg,
1552  &_raster
1553  );
1554  pfree(itrset);
1555 
1556  if (noerr != ES_NONE) {
1558  rt_raster_destroy(raster);
1559  PG_FREE_IF_COPY(pgraster, 0);
1560  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not run raster iterator function");
1561  PG_RETURN_NULL();
1562  }
1563 
1564  /* copy band from _raster to raster */
1565  _band = rt_raster_get_band(_raster, 0);
1566  if (_band == NULL) {
1568  rt_raster_destroy(_raster);
1569  rt_raster_destroy(raster);
1570  PG_FREE_IF_COPY(pgraster, 0);
1571  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not get band from working raster");
1572  PG_RETURN_NULL();
1573  }
1574 
1575  _band = rt_raster_replace_band(raster, _band, nband - 1);
1576  if (_band == NULL) {
1578  rt_raster_destroy(_raster);
1579  rt_raster_destroy(raster);
1580  PG_FREE_IF_COPY(pgraster, 0);
1581  elog(ERROR, "RASTER_setPixelValuesGeomval: Could not replace band in output raster");
1582  PG_RETURN_NULL();
1583  }
1584 
1585  rt_band_destroy(_band);
1586  rt_raster_destroy(_raster);
1587  }
1588 
1590 
1591  pgrtn = rt_raster_serialize(raster);
1592  rt_raster_destroy(raster);
1593  PG_FREE_IF_COPY(pgraster, 0);
1594 
1595  POSTGIS_RT_DEBUG(3, "Finished");
1596 
1597  if (!pgrtn)
1598  PG_RETURN_NULL();
1599 
1600  SET_VARSIZE(pgrtn, pgrtn->size);
1601  PG_RETURN_POINTER(pgrtn);
1602 }
static int rtpg_setvalues_geomval_callback(rt_iterator_arg arg, void *userarg, double *value, int *nodata)
Definition: rtpg_pixel.c:1126
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
Definition: g_serialized.c:55
int clamp_srid(int srid)
Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from wha...
Definition: lwutil.c:350
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_raster.c:372
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void rt_raster_get_geotransform_matrix(rt_raster raster, double *gt)
Get 6-element array of raster geotransform matrix.
Definition: rt_raster.c:706
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
tuple gt
Definition: window.py:77
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
rtpg_setvaluesgv_geomval gv
Definition: rtpg_pixel.c:1080
tuple band
Definition: ovdump.py:57
rt_raster rt_raster_gdal_rasterize(const unsigned char *wkb, uint32_t wkb_len, const char *srs, uint32_t num_bands, rt_pixtype *pixtype, double *init, double *value, double *nodata, uint8_t *hasnodata, int *width, int *height, double *scale_x, double *scale_y, double *ul_xw, double *ul_yw, double *grid_xw, double *grid_yw, double *skew_x, double *skew_y, char **options)
Return a raster of the provided geometry.
Definition: rt_raster.c:2492
tuple raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
Definition: lwgeom.c:284
rt_pixtype
Definition: librtcore.h:197
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_band.c:242
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
Definition: lwgeom.c:80
POINTARRAY * point
Definition: liblwgeom.h:395
int lwgeom_ndims(const LWGEOM *geom)
Return the number of dimensions (2, 3, 4) in a geometry.
Definition: lwgeom.c:850
#define WKB_SFSQL
Definition: liblwgeom.h:1931
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rtpostgis.h:57
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
Definition: rt_band.c:1597
double x
Definition: liblwgeom.h:312
uint8_t * lwgeom_to_wkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)
Convert LWGEOM to a char* in WKB format.
Definition: lwout_wkb.c:750
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
Definition: rt_band.c:1088
tuple nband
Definition: pixval.py:52
LWGEOM ** geoms
Definition: liblwgeom.h:493
LWGEOM * lwgeom_force_2d(const LWGEOM *geom)
Strip out the Z/M components of an LWGEOM.
Definition: lwgeom.c:690
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition: rt_raster.c:381
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
Definition: rt_band.c:541
void rt_raster_set_srid(rt_raster raster, int32_t srid)
Set raster's SRID.
Definition: rt_raster.c:363
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
Definition: rt_raster.c:356
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
rt_raster raster
Definition: librtcore.h:2406
rt_band rt_raster_replace_band(rt_raster raster, rt_band band, int index)
Replace band at provided index with new band.
Definition: rt_raster.c:1502
double y
Definition: liblwgeom.h:312
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:448
rt_errorstate rt_raster_geopoint_to_cell(rt_raster raster, double xw, double yw, double *xr, double *yr, double *igt)
Convert an xw, yw map point to a xr, yr raster point.
Definition: rt_raster.c:806
static rtpg_setvaluesgv_arg rtpg_setvaluesgv_arg_init()
Definition: rtpg_pixel.c:1095
uint16_t nband
Definition: librtcore.h:2407
uint16_t rt_raster_get_width(rt_raster raster)
Definition: rt_raster.c:121
struct rtpg_setvaluesgv_geomval_t::@19 pixval
#define FALSE
Definition: dbfopen.c:168
uint8_t nbnodata
Definition: librtcore.h:2408
Struct definitions.
Definition: librtcore.h:2213
rt_errorstate rt_raster_get_inverse_geotransform_matrix(rt_raster raster, double *gt, double *igt)
Get 6-element array of raster inverse geotransform matrix.
Definition: rt_raster.c:676
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:143
static void rtpg_setvaluesgv_arg_destroy(rtpg_setvaluesgv_arg arg)
Definition: rtpg_pixel.c:1109
rt_errorstate rt_raster_iterator(rt_iterator itrset, uint16_t itrcount, rt_extenttype extenttype, rt_raster customextent, rt_pixtype pixtype, uint8_t hasnodata, double nodataval, uint16_t distancex, uint16_t distancey, rt_mask mask, void *userarg, int(*callback)(rt_iterator_arg arg, void *userarg, double *value, int *nodata), rt_raster *rtnraster)
n-raster iterator.
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
Definition: rt_band.c:498
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
Definition: rt_band.c:581
rt_errorstate rt_band_set_pixel(rt_band band, int x, int y, double val, int *converted)
Set single pixel's value.
Definition: rt_band.c:841
uint16_t rt_raster_get_height(rt_raster raster)
Definition: rt_raster.c:129
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:53
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1297
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:717
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: g_serialized.c:69

Here is the call graph for this function: