rasterizing

Gdal_rasterize nodata_value does not work

Gdal_rasterize nodata_value does not work Question: I want to rasterize a source layer made of polygons. No matter what value I assign to “NoData_value”, the outcome in my array is always = 0. I am using python 3.4. Can anyone help me understand please ? source_srs = source_layer.GetSpatialRef() x_min, x_max, y_min, y_max = source_layer.GetExtent() # …

Total answers: 1

Rasterizing a GDAL layer

Rasterizing a GDAL layer Question: Edit Here is the proper way to do it, and the documentation: import random from osgeo import gdal, ogr RASTERIZE_COLOR_FIELD = "__color__" def rasterize(pixel_size=25): # Open the data source orig_data_source = ogr.Open("test.shp") # Make a copy of the layer’s data source because we’ll need to # modify its attributes table …

Total answers: 1