2

I have to make an image starting from a cadastal map (monocromatical image) and an orthophoto (RGB image). Both are in tif format. The images are perfectly coincident, resampled to have the same pixel size and same system reference coordinate SRC. The cadastral image is black and white (black = 0, white = no data). Initially I had thought of using a merge tool of QGIS to merge the two raster, but it seems that this procedure does not work perfectly: I get the same orthophoto by losing the cadastral margins. Using the blend function of the PIL library in python you get something that remembers the result I should have, basically playing on the transparency of the layer that overlaps. Instead, I'd like to get a final picture where you can see the cadastral boundaries on the orthodox background. I put un example image to try explain better what I want realize.

Can you help to me to find a solution?

enter image description here

  • I don't know if I fully understand the data you're working with, but it seems that you could just multiply the cadastral image by each band of the rgb image using gdal_calc (or band math in QGIS). The zeros in the cadastral image would then be "burned" into each band of the rgb image, producing black pixels at those locations. – Jon Oct 31 '17 at 20:53
  • Hi, I did this way but at first he did not work because the cadastral image has no-data pixels. Then I reclassify the no-data pixels and then finally I could to multiply raster. – Luca Caliciotti Nov 3 '17 at 13:58
  • gdal_calc allows you to input a nodata value with the --NoDataValue flag, so that should be no problem. – Jon Nov 3 '17 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.