0

How I can to draw using GDAL in python or c a polygon shapefile shape.shp with a GeoTIFF as background background.tiff file?

Both files are in the same projection.

The result could be a PNG, JPEG or whatever. To clarify I'm going to put screen shoots of the done with QGIS. First one is the shapefile, second the GeoTIFF, and finally the union.

Shapefile File

GeoTIFF file

GeoTIFF as background and shape as shadow

4
  • Are you wanting this to be scripted, or a one time thing? Commented Mar 16, 2017 at 19:43
  • @AlecBennett scripted or c coded
    – Mquinteiro
    Commented Mar 16, 2017 at 19:44
  • 2
    Add alpha to the gdal_rasterize command as in here gis.stackexchange.com/questions/176471/…. There are other usable answers as well, search with "gdal_rasterize".
    – user30184
    Commented Mar 16, 2017 at 19:48
  • @user30184 It's look similar, I'm going to test it. Thanks.
    – Mquinteiro
    Commented Mar 16, 2017 at 20:02

1 Answer 1

0

One method would be to rasterize the shapefile using gdal_rasterize, and then overlay it onto the other raster file.

A similar question exists and is available here: how to overlay shapefile and raster?

Not the answer you're looking for? Browse other questions tagged or ask your own question.