Monday 13 May 2019

Merging Raster Datasets of Different Resolutions using ArcGIS Desktop?



I am using ArcGIS Desktop.


I have two DEMs in .tif format and I am looking to merge the two. The main problem with merging these are that they are different resolutions (one is 10m and one is ~20m). Also, another problem with merging the two is that they overlap and I am not sure of the most effective way of dealing with that overlap. Obviously I want to keep the values of the better resolution.


So what are the best methods here?




  • Is there a python script available that works best with merging rasters? I would like to automate this with a script if possible.

  • Which process of resampling is best for DEM data? Bipolar, Cubic... ?

  • What is the best way to merge overlapping DEMs?



Answer



Question 1


The attached script mosaics a list of rasters into a new raster dataset. Make sure to specify "MINIMUM" if you would like to maintain your 10m resolution raster datasets.


Question 2


Bilinear interpolation and cubic convolution are both good choices for resampling continuous data. Nearest neighbor is best for discrete raster datasets. Keep in mind that resampling a 30m resolution DEM to 10m will not improve the quality of the DEM, but rather will create more pixels that represents 30m resolution.


Question 3



The Mosaic to New Raster (Data Management) tool is your best choice.




You can see Mosaic to New Raster does a great job at merging overlapping rasters and color balancing. enter image description here




import arcpy
from arcpy import env

# Set overwrite
arcpy.env.overwriteOutput = 1


# Set environment
env.workspace = r'C:\temp'
Dir = env.workspace

# Produce a list of raster datasets
rasters = arcpy.ListRasters()
list = ";".join(rasters)

# Raster to new mosaic
output = "new_dem"

arcpy.MosaicToNewRaster_management(list,Dir, output, "", "", "", 1, "MINIMUM")

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...