699 bool skewed[2] = {
false,
false};
718 PG_FREE_IF_COPY(pgraster, 0);
719 elog(ERROR,
"RASTER_rasterToWorldCoord: Could not deserialize raster");
728 for (i = 1; i <= 2; i++) {
729 if (PG_ARGISNULL(i)) {
732 elog(NOTICE,
"Pixel row and column required for computing longitude and latitude of a rotated raster");
734 PG_FREE_IF_COPY(pgraster, 0);
741 cr[i - 1] = PG_GETARG_INT32(i);
747 (
double) cr[0] - 1, (
double) cr[1] - 1,
752 PG_FREE_IF_COPY(pgraster, 0);
753 elog(ERROR,
"RASTER_rasterToWorldCoord: Could not compute longitude and latitude from pixel row and column");
757 PG_FREE_IF_COPY(pgraster, 0);
760 if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) {
762 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
764 "function returning record called in context "
765 "that cannot accept type record"
770 BlessTupleDesc(tupdesc);
772 values[0] = Float8GetDatum(cw[0]);
773 values[1] = Float8GetDatum(cw[1]);
778 tuple = heap_form_tuple(tupdesc, values, nulls);
781 result = HeapTupleGetDatum(tuple);
783 PG_RETURN_DATUM(result);
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.
double rt_raster_get_x_skew(rt_raster raster)
Get skew about the X axis.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
double rt_raster_get_y_skew(rt_raster raster)
Get skew about the Y axis.
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): ...
#define POSTGIS_RT_DEBUG(level, msg)