Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wanting to use FWTools to rasterize a large number of Shapefile polygons. I have used the Rasterize tool in QIS and it works great. But when I use the generated code in FWTools the process does not work. Here is the generated code:

gdal_rasterize -a COVTYPE -ts 5000 3705 -l LCC001k_dis

Unfortunately I am not a programmer, so I am not able to create my own script to perform this task. Can anyone assist me with why this code doesn't work in FWTools, or what changes I need to make to utilize the Rasterize functionality.

share|improve this question
Do you get any errors or other output when running the code command? – dakcarto Jun 4 '12 at 13:54
No there is no error message. It just brings up the usage. – Ryan Garnett Jun 4 '12 at 14:15
It would be good to mark an answer to this and previous questions as "accepted" by clicking the checkmark next to the answers. – RyanDalton Jun 4 '12 at 15:28
FWTools uses an outdated gdal library, use binaries at or QGIS. – kyle Dec 19 '12 at 22:40
up vote 2 down vote accepted

In my version of FWTools I don't think your command line would work either, it expects the raster to which you are burning the vectors to exist already. The version of gdal_rasterize that comes with recent versions of QGIS does not have this limitation, it can create the new raster. Nick.

share|improve this answer
Thanks Nick. That was my suspicion, but I wanted to see if there was something I was missing. Do you know of any other way I may be able to do this via a command line? I want to batch the rasterization of hundreds of files. – Ryan Garnett Jun 4 '12 at 15:12
If you're in Windows you could run gdal_rasterize from an OSGEO4W window. Or from any command line window, if you put in the path to the QGIS version of gdal_rasterize. Nick. – nhopton Jun 4 '12 at 15:20
I just tried that with the same result: C:\Program Files (x86)\FWTools2.4.7>"C:\Program Files (x86)\Quantum GIS Wroclaw\bin\gdal_rasterize.exe" gdal_rasterize -a COVTYPE -ts 5000 3705 -l LCC001k_dis C:/GlobalData/Vectors/LCC/LCCRasters/LCC001k_dis.shp C:/GlobalData/Vectors/LCC/LCCRasters/LCC001kz.tif – Ryan Garnett Jun 4 '12 at 15:29
"...\bin\gdal_rasterize.exe" gdal_rasterize..." It looks as if you're calling gdal_rasterize twice :( Nick. – nhopton Jun 4 '12 at 15:43
Thank you Nick, those second pair of eyes helped. That was it. Thanks again. – Ryan Garnett Jun 4 '12 at 16:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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