Get a raster pixel as a polygon.
The pixel shape is a 4 vertices (5 to be closed) single ring polygon bearing the raster's rotation and using projection coordinates
609{
610 double scale_x, scale_y;
611 double skew_x, skew_y;
612 double ul_x, ul_y;
613 int32_t srid;
617
618 assert(rast != NULL);
619
627
630
631 p0.
x = scale_x *
x + skew_x *
y + ul_x;
632 p0.
y = scale_y *
y + skew_y *
x + ul_y;
634
635 p.
x = p0.
x + scale_x;
638
639 p.
x = p0.
x + scale_x + skew_x;
640 p.
y = p0.
y + scale_y + skew_y;
642
644 p.
y = p0.
y + scale_y;
646
647
649
651
652 return poly;
653}
LWPOLY * lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
void * rtalloc(size_t size)
Wrappers used for managing memory.
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
double rt_raster_get_x_skew(rt_raster raster)
Get skew about the X axis.
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
double rt_raster_get_x_scale(rt_raster raster)
Get scale X in projection units.
double rt_raster_get_y_scale(rt_raster raster)
Get scale Y in projection units.
double rt_raster_get_y_skew(rt_raster raster)
Get skew about the Y axis.
double rt_raster_get_y_offset(rt_raster raster)
Get raster y offset, in projection units.