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
608{
609 double scale_x, scale_y;
610 double skew_x, skew_y;
611 double ul_x, ul_y;
612 int32_t srid;
616
617 assert(rast != NULL);
618
626
629
630 p0.
x = scale_x *
x + skew_x *
y + ul_x;
631 p0.
y = scale_y *
y + skew_y *
x + ul_y;
633
634 p.
x = p0.
x + scale_x;
637
638 p.
x = p0.
x + scale_x + skew_x;
639 p.
y = p0.
y + scale_y + skew_y;
641
643 p.
y = p0.
y + scale_y;
645
646
648
650
651 return poly;
652}
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.