[Gdal-dev] gdal_rasterize - can't make it work

Frank Warmerdam warmerdam at pobox.com
Wed May 24 00:07:21 EDT 2006


Maciek Sieczka wrote:
> Hi!
> 
> Using Gdal CVS & Grass 6.1, both CVS 2006.23.05 and gdal-grass 1.3.1.2.
> 
> There is a tiff [1] and a shapefile [2]. They have the same extent (see
> the attached png - black is raster, red is vector). I want to burn the
> shapefile into the raster:
> 
> $ gdal_rasterize -a CAT -l cieki05 cieki05/cieki05.shp rast.tif
> 0100 - done.
> 
> But nothing happens - when the rast.tif is displayed it looks
> untouched. The value range of rast.tif is still 1-1 (like in [1],
> before gdal_rasterize).
> 
> What am I doing wrong?
> 
> 
> 
> [1]
> 
> $ gdalinfo rast.tif -mm
> Driver: GTiff/GeoTIFF
> Size is 678, 901
> Coordinate System is:
> PROJCS["WGS 84 / UTM zone 33N",
>     GEOGCS["WGS 84",
>         DATUM["WGS_1984",
>             SPHEROID["WGS 84",6378137,298.2572235629972,
>                 AUTHORITY["EPSG","7030"]],
>             AUTHORITY["EPSG","6326"]],
>         PRIMEM["Greenwich",0],
>         UNIT["degree",0.0174532925199433],
>         AUTHORITY["EPSG","4326"]],
>     PROJECTION["Transverse_Mercator"],
>     PARAMETER["latitude_of_origin",0],
>     PARAMETER["central_meridian",15],
>     PARAMETER["scale_factor",0.9996],
>     PARAMETER["false_easting",500000],
>     PARAMETER["false_northing",0],
>     UNIT["metre",1,
>         AUTHORITY["EPSG","9001"]],
>     AUTHORITY["EPSG","32633"]]
> Origin = (596040.000000,5684380.000000)
> Pixel Size = (10.00000000,-10.00000000)
> Metadata:
>   AREA_OR_POINT=Area
> Corner Coordinates:
> Upper Left  (  596040.000, 5684380.000) ( 16d22'39.70"E, 51d18'9.45"N)
> Lower Left  (  596040.000, 5675370.000) ( 16d22'30.99"E, 51d13'17.87"N)
> Upper Right (  602820.000, 5684380.000) ( 16d28'29.71"E, 51d18'5.18"N)
> Lower Right (  602820.000, 5675370.000) ( 16d28'20.39"E, 51d13'13.61"N)
> Center      (  599430.000, 5679875.000) ( 16d25'30.19"E, 51d15'41.56"N)
> Band 1 Block=678x12 Type=Byte, ColorInterp=Gray
>     Computed Min/Max=1.000,1.000
>   NoData Value=0
>   Metadata:
>     COLOR_TABLE_RULES_COUNT=0
> 
> 
> 
> [2]
> 
> $ john at quercus:~$ ogrinfo -al -so cieki05/cieki05.shp
> INFO: Open of `cieki05/cieki05.shp'
> using driver `ESRI Shapefile' successful.
> 
> Layer name: cieki05
> Geometry: Line String

Maciek,

I'm embarrassed to admit that gdal_rasterize only supports polygons at
this time.  So the line strings are just being ignored as will points.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list