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

Definition at line 1573 of file rt_pg.c.

References rtrowdump::raster, rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_srid(), rt_raster_serialized_t::srid, and TRUE.

1574 {
1575  rt_pgraster *pgraster;
1576  rt_raster raster;
1577  int32_t srid;
1578 
1579  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
1580  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
1581 
1582  raster = rt_raster_deserialize(pgraster, TRUE);
1583  if ( ! raster ) {
1584  PG_FREE_IF_COPY(pgraster, 0);
1585  elog(ERROR, "RASTER_getSRID: Could not deserialize raster");
1586  PG_RETURN_NULL();
1587  }
1588 
1589  srid = rt_raster_get_srid(raster);
1590 
1591  rt_raster_destroy(raster);
1592  PG_FREE_IF_COPY(pgraster, 0);
1593 
1594  PG_RETURN_INT32(srid);
1595 }
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
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
Definition: rt_api.c:5661
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: