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++) {
71 sscanf(pos,
"%2x", &b);
72 wkb[i] = (
unsigned char)b;
void * rtalloc(size_t size)
Wrappers used for managing memory.
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
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.
uint16_t rt_raster_get_num_bands(rt_raster raster)
uint16_t rt_raster_get_height(rt_raster raster)
uint16_t rt_raster_get_width(rt_raster raster)
void rtdealloc(void *mem)
double rt_raster_get_y_offset(rt_raster raster)
Get raster y offset, in projection units.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
void cu_free_raster(rt_raster raster)