579 {
580 uint32_t width = 2;
581 uint32_t height = 2;
582 double ul_x = 0.0;
583 double ul_y = 0.0;
584 double scale_x = 1;
585 double scale_y = 1;
586 int err;
587
588 double xr, yr;
589 double igt[6];
590
594
595 double xw = 1.5, yw = 0.5;
596
598 rast,
600 1.0,
601 1,
602 -99.0,
603 0
604 );
605
607 rast,
608 xw, yw,
609 &xr, &yr, igt);
610
611 printf("xw = %g, yw = %g, xr = %g, yr = %g\n", xw, yw, xr, yr);
612
613
614
615
616
617
618
619
625
626
628 int nodata = 0;
630 band,
631 xw, yw,
632 &value, &nodata
633 );
634
636
637
638
639}
int rt_raster_generate_new_band(rt_raster raster, rt_pixtype pixtype, double initialvalue, uint32_t hasnodata, double nodatavalue, int index)
Generate a new inline band and add it to a raster.
void rt_raster_set_scale(rt_raster raster, double scaleX, double scaleY)
Set scale in projection units.
rt_errorstate rt_raster_geopoint_to_rasterpoint(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.
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
rt_errorstate rt_band_set_pixel(rt_band band, int x, int y, double val, int *converted)
Set single pixel's value.
rt_errorstate rt_band_get_pixel_bilinear(rt_band band, double xr, double yr, double *r_value, int *r_nodata)
Retrieve a point value from the raster using a world coordinate and bilinear interpolation.
void rt_raster_set_offsets(rt_raster raster, double x, double y)
Set insertion points in projection units.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.