813 PG_FREE_IF_COPY(pgraster, 0);
814 elog(ERROR,
"RASTER_worldToRasterCoord: Could not deserialize raster");
824 for (i = 1; i <= 2; i++) {
825 if (PG_ARGISNULL(i)) {
828 elog(NOTICE,
"Latitude and longitude required for computing pixel row and column of a rotated raster");
830 PG_FREE_IF_COPY(pgraster, 0);
837 cw[i - 1] = PG_GETARG_FLOAT8(i);
844 &(_cr[0]), &(_cr[1]),
848 PG_FREE_IF_COPY(pgraster, 0);
849 elog(ERROR,
"RASTER_worldToRasterCoord: Could not compute pixel row and column from longitude and latitude");
853 PG_FREE_IF_COPY(pgraster, 0);
856 cr[0] = ((int) _cr[0]) + 1;
857 cr[1] = ((int) _cr[1]) + 1;
860 if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) {
862 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
864 "function returning record called in context "
865 "that cannot accept type record"
870 BlessTupleDesc(tupdesc);
872 values[0] = Int32GetDatum(cr[0]);
873 values[1] = Int32GetDatum(cr[1]);
878 tuple = heap_form_tuple(tupdesc, values, nulls);
881 result = HeapTupleGetDatum(tuple);
883 PG_RETURN_DATUM(result);
double rt_raster_get_x_skew(rt_raster raster)
Get skew about the X axis.
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.
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)