[gdal-dev] Understanding gdal_rasterize

Paul Meems bontepaarden at gmail.com
Mon Oct 21 05:46:50 PDT 2013


I'm trying to understand how gdal_rasterize works.
As a test I'm trying to convert a shapefile with all counties of the USA to
a GeoTiff.
I've added a field to the shapefile called myID which is equal to the shape
number.
The goal is to create a tiff with each county its own value.

This is my command:
gdal_rasterize -a myID -l counties -of GTiff -a_nodata -999 -ts 800 800
counties.shp GDALRasterizeTest.tif

I'm having trouble understanding the -ts or -tr parameters.
Using the above command I get an 800*800 tiff which shows the USA, but it
looks like all pixels are the same color.
I would have expected I could set the cell size and the dimensions of the
resulting tiff file would be equal to the input shapefile.

I also tried creating an ASCII file so I could 'read' the values, but I
can't figure out how to create an ASCII file.

Any help will be much appreciated.

Thanks,

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131021/7b9bb50e/attachment.html>


More information about the gdal-dev mailing list