PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ RASTER_setSRID()

Datum RASTER_setSRID ( PG_FUNCTION_ARGS  )

Definition at line 890 of file rtpg_raster_properties.c.

891{
892 rt_pgraster *pgraster = NULL;
893 rt_pgraster *pgrtn = NULL;
895 int32_t newSRID = PG_GETARG_INT32(1);
896
897 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
898 pgraster = (rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
899
901 if (!raster) {
902 PG_FREE_IF_COPY(pgraster, 0);
903 elog(ERROR, "RASTER_setSRID: Could not deserialize raster");
904 PG_RETURN_NULL();
905 }
906
907 rt_raster_set_srid(raster, newSRID);
908
909 pgrtn = rt_raster_serialize(raster);
910 rt_raster_destroy(raster);
911 PG_FREE_IF_COPY(pgraster, 0);
912 if (!pgrtn) PG_RETURN_NULL();
913
914 SET_VARSIZE(pgrtn, pgrtn->size);
915
916 PG_RETURN_POINTER(pgrtn);
917}
#define FALSE
Definition dbfopen.c:72
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition rt_raster.c:86
void rt_raster_set_srid(rt_raster raster, int32_t srid)
Set raster's SRID.
Definition rt_raster.c:367
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition rtrowdump.py:125
Struct definitions.
Definition librtcore.h:2452

References FALSE, rt_raster_deserialize(), rt_raster_destroy(), rt_raster_serialize(), rt_raster_set_srid(), and rt_raster_serialized_t::size.

Here is the call graph for this function: