PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ RASTER_getSRID()

Datum RASTER_getSRID ( PG_FUNCTION_ARGS  )

Definition at line 84 of file rtpg_raster_properties.c.

References PG_FUNCTION_INFO_V1(), rtrowdump::raster, RASTER_getWidth(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_srid(), and TRUE.

85 {
86  rt_pgraster *pgraster;
88  int32_t srid;
89 
90  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
91  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
92 
93  raster = rt_raster_deserialize(pgraster, TRUE);
94  if ( ! raster ) {
95  PG_FREE_IF_COPY(pgraster, 0);
96  elog(ERROR, "RASTER_getSRID: Could not deserialize raster");
97  PG_RETURN_NULL();
98  }
99 
100  srid = rt_raster_get_srid(raster);
101 
102  rt_raster_destroy(raster);
103  PG_FREE_IF_COPY(pgraster, 0);
104 
105  PG_RETURN_INT32(srid);
106 }
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
Definition: rt_raster.c:356
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: