[gdal-dev] gdal_rasterize use SHP FID as burn attribute

Peter Rankor peter.rankor at googlemail.com
Wed Feb 10 15:40:38 EST 2010


Thanks you guys.

The SQL statement did the trick.

2010/2/9 Frank Warmerdam <warmerdam at pobox.com>

> Peter Rankor wrote:
>
>> List,
>>
>> I need to rasterize a polygon layer coming from a SHP file. However, the
>> values in the outputraster need to be the FID of the corresponding polygon.
>>
>> My command:
>> gdal_rasterize -a FID -l FECS FECS.shp flattenedRaster.tif
>>
>
> Peter,
>
> Could you try:
>
> gdal_rasterize -a FID \
>    -sql "select FID, * from FECS" FEC.shp flattenedRaster.tif
>
> The ExecuteSQL() method invoked for -sql should be able to treat FID
> as a pseudo-attribute.  It's a bit unfortunate this sort of thing doesn't
> work directly without the SQL route.
>
> 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<http://pobox.com/%7Ewarmerdam>
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100210/3bbe40e3/attachment-0001.html


More information about the gdal-dev mailing list