PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ RASTER_getXScale()

Datum RASTER_getXScale ( PG_FUNCTION_ARGS  )

Definition at line 196 of file rtpg_raster_properties.c.

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

Referenced by RASTER_getNumBands().

197 {
198  rt_pgraster *pgraster;
200  double xsize;
201 
202  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
203  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
204 
205  raster = rt_raster_deserialize(pgraster, TRUE);
206  if ( ! raster ) {
207  PG_FREE_IF_COPY(pgraster, 0);
208  elog(ERROR, "RASTER_getXScale: Could not deserialize raster");
209  PG_RETURN_NULL();
210  }
211 
212  xsize = rt_raster_get_x_scale(raster);
213 
214  rt_raster_destroy(raster);
215  PG_FREE_IF_COPY(pgraster, 0);
216 
217  PG_RETURN_FLOAT8(xsize);
218 }
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
xsize
Definition: window.py:68
double rt_raster_get_x_scale(rt_raster raster)
Get scale X in projection units.
Definition: rt_raster.c:150
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:717
Here is the call graph for this function:
Here is the caller graph for this function: