I am trying to rasterize a shapefile with Python using ogr, but if you know to do with other libraries as fiona, I am interested in too.
I use the shapefile in the following website: https://www.hydrosheds.org/page/hydrolakes (Lake polygon).
I try to get a raster of 0.5° resolution and in lat/lon projection. I want to create a matrice
M(i,j) correspond to lake fraction. In my shapefile the polygons are lakes.
I see people using the function
gdal.RasterizeLayer(target_ds, , source_layer, burn_values=) and I don't success to use it.
Can you give me tips?
I just success to get a raster with undefined values.
I try the method of snowman2. But finally with a friend that have the costum to do it R. I follow his algorithm in python with ogr and I sucess to get something precise.
I will put the code within the day.