PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ RASTER_getYUpperLeft()

Datum RASTER_getYUpperLeft ( PG_FUNCTION_ARGS  )

Definition at line 334 of file rtpg_raster_properties.c.

References PG_FUNCTION_INFO_V1(), rtrowdump::raster, RASTER_getPixelWidth(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_y_offset(), and TRUE.

Referenced by RASTER_getXUpperLeft().

335 {
336  rt_pgraster *pgraster;
338  double yul;
339 
340  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
341  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
342 
343  raster = rt_raster_deserialize(pgraster, TRUE);
344  if ( ! raster ) {
345  PG_FREE_IF_COPY(pgraster, 0);
346  elog(ERROR, "RASTER_getYUpperLeft: Could not deserialize raster");
347  PG_RETURN_NULL();
348  }
349 
350  yul = rt_raster_get_y_offset(raster);
351 
352  rt_raster_destroy(raster);
353  PG_FREE_IF_COPY(pgraster, 0);
354 
355  PG_RETURN_FLOAT8(yul);
356 }
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:2213
#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
double rt_raster_get_y_offset(rt_raster raster)
Get raster y offset, in projection units.
Definition: rt_raster.c:222
Here is the call graph for this function:
Here is the caller graph for this function: