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

Definition at line 1662 of file rt_pg.c.

References rt_raster_serialized_t::height, rtrowdump::raster, rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_height(), and TRUE.

1663 {
1664  rt_pgraster *pgraster;
1665  rt_raster raster;
1666  uint16_t height;
1667 
1668  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
1669  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
1670 
1671  raster = rt_raster_deserialize(pgraster, TRUE);
1672  if ( ! raster ) {
1673  PG_FREE_IF_COPY(pgraster, 0);
1674  elog(ERROR, "RASTER_getHeight: Could not deserialize raster");
1675  PG_RETURN_NULL();
1676  }
1677 
1678  height = rt_raster_get_height(raster);
1679 
1680  rt_raster_destroy(raster);
1681  PG_FREE_IF_COPY(pgraster, 0);
1682 
1683  PG_RETURN_INT32(height);
1684 }
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
tuple raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:123
uint16_t rt_raster_get_height(rt_raster raster)
Definition: rt_api.c:5434
Struct definitions.
Definition: rt_api.h:2175
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_api.c:8350
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function: