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

Definition at line 1718 of file rt_pg.c.

References rtrowdump::raster, rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_x_scale(), TRUE, and window::xsize.

1719 {
1720  rt_pgraster *pgraster;
1721  rt_raster raster;
1722  double xsize;
1723 
1724  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
1725  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
1726 
1727  raster = rt_raster_deserialize(pgraster, TRUE);
1728  if ( ! raster ) {
1729  PG_FREE_IF_COPY(pgraster, 0);
1730  elog(ERROR, "RASTER_getXScale: Could not deserialize raster");
1731  PG_RETURN_NULL();
1732  }
1733 
1734  xsize = rt_raster_get_x_scale(raster);
1735 
1736  rt_raster_destroy(raster);
1737  PG_FREE_IF_COPY(pgraster, 0);
1738 
1739  PG_RETURN_FLOAT8(xsize);
1740 }
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
xsize
Definition: window.py:70
double rt_raster_get_x_scale(rt_raster raster)
Get scale X in projection units.
Definition: rt_api.c:5455
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: