[gdal-dev] Overlay shapefile onto Geotiff image
Graeme B. Bell
grb at skogoglandskap.no
Thu Jun 11 04:23:59 PDT 2015
> I have been working on this issue for quite a while. I currently have a GeoTiff image and a shapefile. I would like to overlay the shapefile on the Geotiff, is this possible with Gdal? I looked into gdal_rasterize but I just don't know how to incorporate it with what I need. A code to start with would be great if possible. Or maybe point me into the right direction of probably other libraries that could do this.
First, turn your shapefile into a geotiff. You can do this by reading the documentation and searching google for "gdal_rasterize".
You'll need to tell it what size you want to burn. You can do that by looking at the extents (northeast, southwest) of your current raster/geotiff.
Second, overlay the 'shapefile geotiff' onto the other geotiff.
To do this, read the documentation for
gdal_merge.py or gdalwarp
Both of them can do what you want.
And look for some online articles about those tools for practical examples.
For example, read this and try to practice it:
More information about the gdal-dev