Skip to main content
2 of 2
deleted 1 character in body; edited tags
Gery
  • 2.1k
  • 1
  • 16
  • 38

Reverse gdal_rasterize (-i option) does not work

When I use:

gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -burn 255 -burn 255 polygon.shp tiff.tiff

I get a new tiff with a white hole in it with the shape of the polygon shp. However, when I use the reverse process:

gdal_rasterize -i -b 1 -b 2 -b 3 -burn 255 -burn 255 -burn 255 polygon.shp tiff.tiff

I get a blank tiff. I expect the old tiff shaped by the polygon (ie. raster values inside the polygon), instead.

Any ideas why this happens? is it possible to clip a raster with a shapefile in this way?

Gery
  • 2.1k
  • 1
  • 16
  • 38