PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ RASTER_getXUpperLeft()

Datum RASTER_getXUpperLeft ( PG_FUNCTION_ARGS  )

Definition at line 308 of file rtpg_raster_properties.c.

References PG_FUNCTION_INFO_V1(), rtrowdump::raster, RASTER_getYUpperLeft(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_x_offset(), and TRUE.

Referenced by RASTER_getYSkew().

309 {
310  rt_pgraster *pgraster;
312  double xul;
313 
314  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
315  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
316 
317  raster = rt_raster_deserialize(pgraster, TRUE);
318  if ( ! raster ) {
319  PG_FREE_IF_COPY(pgraster, 0);
320  elog(ERROR, "RASTER_getXUpperLeft: Could not deserialize raster");
321  PG_RETURN_NULL();
322  }
323 
324  xul = rt_raster_get_x_offset(raster);
325 
326  rt_raster_destroy(raster);
327  PG_FREE_IF_COPY(pgraster, 0);
328 
329  PG_RETURN_FLOAT8(xul);
330 }
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
Definition: rt_raster.c:213
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
#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:725
Here is the call graph for this function:
Here is the caller graph for this function: