697 bool skewed[2] = {
false,
false};
716 PG_FREE_IF_COPY(pgraster, 0);
717 elog(ERROR,
"RASTER_rasterToWorldCoord: Could not deserialize raster");
726 for (i = 1; i <= 2; i++) {
727 if (PG_ARGISNULL(i)) {
730 elog(NOTICE,
"Pixel row and column required for computing longitude and latitude of a rotated raster");
732 PG_FREE_IF_COPY(pgraster, 0);
739 cr[i - 1] = PG_GETARG_INT32(i);
745 (
double) cr[0] - 1, (
double) cr[1] - 1,
750 PG_FREE_IF_COPY(pgraster, 0);
751 elog(ERROR,
"RASTER_rasterToWorldCoord: Could not compute longitude and latitude from pixel row and column");
755 PG_FREE_IF_COPY(pgraster, 0);
758 if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) {
760 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
762 "function returning record called in context " 763 "that cannot accept type record" 768 BlessTupleDesc(tupdesc);
770 values[0] = Float8GetDatum(cw[0]);
771 values[1] = Float8GetDatum(cw[1]);
776 tuple = heap_form_tuple(tupdesc, values, nulls);
779 result = HeapTupleGetDatum(tuple);
781 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): ...
rt_errorstate rt_raster_cell_to_geopoint(rt_raster raster, double xr, double yr, double *xw, double *yw, double *gt)
Convert an xr, yr raster point to an xw, yw point on map.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
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.