6

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?
9

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") 
|improve this answer|||||
  • Perfect! Thanks! I think the bug is gone now. It produced a tif for me just fine. – CodeSpatial Apr 22 '13 at 0:48
  • Are you sure your two DEMs are spatially coincident? If in doubt, consider using the Mosaic to New Raster tool's Environments > Processing Extent > Snap Raster setting, using one of the two rasters as the snap raster. This will assure that the other raster will be adjusted in X-Y coordinate space (ie, "snapped") to spatially align with the snap raster. I don't know how to implement this in Python, maybe someone else can speak to that. – Stu Smith Aug 20 '19 at 3:55
0

Look into mosaics for the overlapping issue.

For the resolution, look into resampling.

These can be done different ways depending on which platform, software, etc.

|improve this answer|||||
  • Sorry, I meant to say that I am working in ArcGIS Desktop for this. – CodeSpatial Apr 21 '13 at 16:22

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