Geographic Information Systems Asked by terraCoder on February 2, 2021
I am having a Merging issue with the GDAL python library. I am using gdal_merge.py
link
My issue is when I merge two rasters NoData value of one raster overlaps the other data resulting in not a proper raster image.
For example, in the raster images below (left images) if I merge these 4 images labeled as 1,2,3,4 I should get the merged raster image as the right-sided image.
But, the merged image I am getting looks like this (image below):
(Note: Image labeled 1,2 and 3 are merged properly. It’s only when we merged them with image labeled 4, it’s not properly merging.)
If anyone knows, how to resolve this issue then it’ll be a great help to me. Thanks in advance.
Are you using the -n parameter? If not, nodata values will be included in your mosaic.
GDAL will ignore nodata values if you specify this and will mosaic data without overlapping nodata areas included.
Note (update from OP): np.nan may not work as a nodata value
For example:
gdal_merge.py -n 0 -o output.tif input1.tif input2.tif
You will need to know the nodata value and make sure it is the same in each image
Answered by Nathan Thomas on February 2, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP