PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ RASTER_getHeight()

Datum RASTER_getHeight ( PG_FUNCTION_ARGS  )

Definition at line 140 of file rtpg_raster_properties.c.

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

Referenced by RASTER_getWidth().

141 {
142  rt_pgraster *pgraster;
144  uint16_t height;
145 
146  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
147  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
148 
149  raster = rt_raster_deserialize(pgraster, TRUE);
150  if ( ! raster ) {
151  PG_FREE_IF_COPY(pgraster, 0);
152  elog(ERROR, "RASTER_getHeight: Could not deserialize raster");
153  PG_RETURN_NULL();
154  }
155 
156  height = rt_raster_get_height(raster);
157 
158  rt_raster_destroy(raster);
159  PG_FREE_IF_COPY(pgraster, 0);
160 
161  PG_RETURN_INT32(height);
162 }
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
Struct definitions.
Definition: librtcore.h:2250
uint16_t rt_raster_get_height(rt_raster raster)
Definition: rt_raster.c:129
#define TRUE
Definition: dbfopen.c:169
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:717
Here is the call graph for this function:
Here is the caller graph for this function: