<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,</div><div class="gmail_default" style="font-size:small">I want to use GDALRasterize. </div><div class="gmail_default" style="font-size:small">here is the code: (GDALRasterizeOptions is problematic)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">#include "/usr/include/gdal/gdal_priv.h"<br>#include </usr/include/gdal/gdal.h><br>#include </usr/include/gdal/gdal_utils.h><br>#include <gdal/ogr_geometry.h><br>#include <iostream><br>#include <errno.h><br><br>int main()<br>{<br>    // Register GDAL drivers<br>    GDALAllRegister();<br><br>    // Set the driver for the output raster dataset<br>    GDALDriver* driver = GetGDALDriverManager()->GetDriverByName("GTiff");<br><br>    // Define the dimensions and properties of the output raster dataset<br>    int width = 100;<br>    int height = 100;<br>    int num_bands = 1;<br>    GDALDataType data_type = GDT_Byte;  // Data type of the raster values<br>    const char* output_path = "output.tif";  // Path to the output raster dataset<br><br>    // Create an empty raster dataset<br>    GDALDataset* dataset = driver->Create(output_path, width, height, num_bands, data_type, nullptr);<br><br>    // Set the spatial reference system of the raster dataset (optional)<br>    OGRSpatialReference srs;<br>    srs.importFromEPSG(4326);  // WGS84<br>    char* srs_wkt = nullptr;<br>    srs.exportToWkt(&srs_wkt);<br>    dataset->SetProjection(srs_wkt);<br>    CPLFree(srs_wkt);<br><br>    // Open the vector file and get the layer<br>    const char* vector_path = "test.shp";  // Path to the input vector file<br>    GDALDataset* vector_dataset = (GDALDataset*)GDALOpenEx(vector_path,       GDAL_OF_VECTOR, nullptr, nullptr, nullptr);<br>    OGRLayer* layer = vector_dataset->GetLayer(0);<br><br>    // Set the rasterization options<br>    GDALRasterizeOptions options;<br>    options.width = width;<br>    options.height = height;<br>    options.outputType = data_type;<br>    options.burnValues = nullptr;  // Optional array of values to burn into the raster<br><br>    // Rasterize the vector layer into the output raster dataset<br>    GDALRasterize(dataset, num_bands, &layer, &options, nullptr, nullptr);<br>    // Cleanup<br>    GDALClose(vector_dataset);<br>    GDALClose(dataset);<br><br>    // Cleanup GDAL<br>    GDALDestroyDriverManager();<br><br>    return 0;<br>}</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can you tell me what is wrong ?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">regards<br><br></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Ahmet Temiz<br>Jeoloji Müh.<br>Afet ve Acil Durum Yönetimi Başkanlığı<br>Deprem  Dairesi Başkanlığı<br><br><br>________________________<br><br>Ahmet Temiz<br>Geological Eng.<br><br>Disaster and Emergency Management<br>of Presidency</div></div></div></div></div></div></div></div>