Thanks Hermann for your explaination. I probably made a typo because now the pixels have different colors/values as I would expect.
Thanks, Paul *Paul Meems * Release manager, configuration manager and forum moderator of MapWindow GIS. www.mapwindow.org Owner of MapWindow.nl - Support for Dutch speaking users. www.mapwindow.nl * * 2013/10/21 Hermann Peifer <[email protected]> > On 2013-10-21 14:46, Paul Meems wrote: > >> 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 >> >> > You could drop "-of GTiff" as GTiff is anyway the default format. > "-a_nodata -999" makes most sense in combination with "-init -999". > Anything else looks fine to me. > > > 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. >> > > -ts obviously sets the output file size, to 800x800 pixels, as you noted > yourself. Do all pixels also have the same *value* ? > > Hermann >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
