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

Definition at line 1963 of file rt_pg.c.

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

1964 {
1965  rt_pgraster *pgraster;
1966  rt_raster raster;
1967  double xul;
1968 
1969  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
1970  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
1971 
1972  raster = rt_raster_deserialize(pgraster, TRUE);
1973  if ( ! raster ) {
1974  PG_FREE_IF_COPY(pgraster, 0);
1975  elog(ERROR, "RASTER_getXUpperLeft: Could not deserialize raster");
1976  PG_RETURN_NULL();
1977  }
1978 
1979  xul = rt_raster_get_x_offset(raster);
1980 
1981  rt_raster_destroy(raster);
1982  PG_FREE_IF_COPY(pgraster, 0);
1983 
1984  PG_RETURN_FLOAT8(xul);
1985 }
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
Definition: rt_api.c:5518
tuple raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:123
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: