811 PG_FREE_IF_COPY(pgraster, 0);
812 elog(ERROR,
"RASTER_worldToRasterCoord: Could not deserialize raster");
822 for (i = 1; i <= 2; i++) {
823 if (PG_ARGISNULL(i)) {
826 elog(NOTICE,
"Latitude and longitude required for computing pixel row and column of a rotated raster");
828 PG_FREE_IF_COPY(pgraster, 0);
835 cw[i - 1] = PG_GETARG_FLOAT8(i);
842 &(_cr[0]), &(_cr[1]),
846 PG_FREE_IF_COPY(pgraster, 0);
847 elog(ERROR,
"RASTER_worldToRasterCoord: Could not compute pixel row and column from longitude and latitude");
851 PG_FREE_IF_COPY(pgraster, 0);
854 cr[0] = ((int) _cr[0]) + 1;
855 cr[1] = ((int) _cr[1]) + 1;
858 if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) {
860 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
862 "function returning record called in context " 863 "that cannot accept type record" 868 BlessTupleDesc(tupdesc);
870 values[0] = Int32GetDatum(cr[0]);
871 values[1] = Int32GetDatum(cr[1]);
876 tuple = heap_form_tuple(tupdesc, values, nulls);
879 result = HeapTupleGetDatum(tuple);
881 PG_RETURN_DATUM(result);
double rt_raster_get_y_skew(rt_raster raster)
Get skew about the Y axis.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_errorstate rt_raster_geopoint_to_cell(rt_raster raster, double xw, double yw, double *xr, double *yr, double *igt)
Convert an xw, yw map point to a xr, yr raster point.
double rt_raster_get_x_skew(rt_raster raster)
Get skew about the X axis.
#define POSTGIS_RT_DEBUG(level, msg)
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.