Opened 17 years ago

Closed 15 years ago

#1458 closed enhancement (fixed)

[WISH] gdal_rasterize should allow masking areas outside polygons

Reported by: josegomez@… Owned by: warmerdam
Priority: normal Milestone: 1.5.0
Component: Utilities Version: svn-trunk
Severity: minor Keywords: gdal_rasterize
Cc: josegomez@…, Markus Neteler

Description (last modified by Markus Neteler)

gdal_rasterize should allow burning values in areas outside polygons, so that masking out regions in a polygon is available.

Change History (2)

comment:1 by Markus Neteler, 15 years ago

Cc: Markus Neteler added
Component: defaultGDAL_Raster
Description: modified (diff)
Version: 1.3.2svn-trunk

I have the same wish (have to cut a mosaicked orthophoto map (gdalwarp) to the provincial boundaries from a vector map) - the command

gdal_rasterize -i -b 1 -b 2 -b 3  -burn 255 -burn 255 -burn 255 -l ammprv03 ammprv03.shp ortho.tif

did not change the ortho.tif file at all.

Best, Markus

comment:2 by warmerdam, 15 years ago

Component: GDAL_RasterUtilities
Keywords: gdal_rasterize added
Milestone: 1.5.0
Priority: highestnormal
Resolution: fixed
Status: newclosed

The -i flag inverts the concept of "inside" so it allows burning a value into all parts of the raster outside the selected polygons. I'm not sure why Markus' effort failed. Perhaps there is an issue with the coordinate system of the polygons?

Markus, feel free to open a new ticket if you are convinced something is wrong in gdal_rasterize.

Note: See TracTickets for help on using tickets.