51 char srs[] =
"PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-100],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"2163\"]]";
52 const char wkb_hex[] =
"010300000001000000050000000000000080841ec100000000600122410000000080841ec100000000804f22410000000040e81dc100000000804f22410000000040e81dc100000000600122410000000080841ec10000000060012241";
53 const char *pos = wkb_hex;
54 unsigned char *wkb = NULL;
58 double scale_y = -100;
63 double nodata[] = {0};
67 wkb_len = (int) ceil(((
double) strlen(wkb_hex)) / 2);
68 wkb = (
unsigned char *)
rtalloc(
sizeof(
unsigned char) * wkb_len);
69 for (i = 0; i < wkb_len; i++) {
70 sscanf(pos,
"%2hhx", &wkb[i]);
88 CU_ASSERT(raster != NULL);
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
int rt_raster_get_num_bands(rt_raster raster)
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_raster rt_raster_gdal_rasterize(const unsigned char *wkb, uint32_t wkb_len, const char *srs, uint32_t num_bands, rt_pixtype *pixtype, double *init, double *value, double *nodata, uint8_t *hasnodata, int *width, int *height, double *scale_x, double *scale_y, double *ul_xw, double *ul_yw, double *grid_xw, double *grid_yw, double *skew_x, double *skew_y, char **options)
Return a raster of the provided geometry.
void * rtalloc(size_t size)
Wrappers used for managing memory.
void cu_free_raster(rt_raster raster)
uint16_t rt_raster_get_width(rt_raster raster)
void rtdealloc(void *mem)
uint16_t rt_raster_get_height(rt_raster raster)
double rt_raster_get_y_offset(rt_raster raster)
Get raster y offset, in projection units.