0

I want to convert a shapefile (polygons) which contains also 3 attributes (CO,NOX,SOx) with float values.

I used the following command

gdal_rasterize -a CO -a NOx -a SOx -ot Float32 -ts 1000 1000 -l emissions_shp /home/emissions_shp.shp /home/emissions.tif 

and the result is a raster file with one band only. It seems that it gets only the last attribute (Sox).

0

Rasterize into 3 single band rasters then merge them:

gdal_rasterize -a CO -ot Float32 -ts 1000 1000 -l emissions_shp /home/emissions_shp.shp /home/co.tif 
gdal_rasterize -a NOx -ot Float32 -ts 1000 1000 -l emissions_shp /home/emissions_shp.shp /home/nox.tif 
gdal_rasterize -a SOx -ot Float32 -ts 1000 1000 -l emissions_shp /home/emissions_shp.shp /home/sox.tif 
gdalbuildvrt -separate emissions.vrt /home/co.tif /home/nox.tif /home/sox.tif
gdal_translate emissions.vrt  emissions.tif
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.