[Gdal-dev] Question about gdal_rasterize

Frank Warmerdam warmerdam at pobox.com
Wed Apr 12 11:30:40 EDT 2006


Guillaume HUBY wrote:
> Hello,
> 
> I have a question about gdal_rasterize. I'm using
> 
>>> gdal_rasterize --version
> GDAL 1.3.1.0, FWTools 1.0.0b2, released 2006/03/30
> 
> I achieved to rasterized an ESRI polygon shapefile on some Geotiff raster.
> The pixels was burned when their center was inside the polygon. I would like
> to know if there is a way to burn pixels which are entirely inside polygons.
> I mean that the four corners of pixels are inside without intersecting
> polygon.
> 
> I would be very grateful if someone could answer this question.

Guillaume,

There is no support for this in the GDAL rasterizer.  You could try and
fiddle with the low level to allow this but it could be pretty tricky.

Another alternative would be to rasterize four rasters all offset by
half a pixel in the four directions, and then merge them - only setting
the target pixel if all our offsets were rasterized.

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