What I am trying to do

Using DTM files(IMG file extension) from HiRise dataset(https://hirise.lpl.arizona.edu/), I would like to align overlapping terrains into one large terrain. The idea is that I want to automate this process through batch files and scripting so that i can dynamically create a large 3D terrain map based bounding box set by GPS coordinates of Mars. I do understand that completely automating this process will make it very difficult/impossible to get 100% accuracy on aligning these DTMs. Let's assume this is acceptable for now. See photos below

2 Separate DTM's that overlap

Expected Result(not perfect as i did this quickly by hand)

The above images are displayed using blender, this is not relevant other than the resulting combined images need to be in a format that can be imported into blender as a mesh

What I have tried

I tried using gdalwarp and this was the result.

result of gdalwarp

gdalwarp does not support creating files in PDS4 format so this was created in ISIS2 format and then converted to ISIS3 format using pds2isis

I have also tried the various ISIS3 utilities and walkthroughs on USGS site and keep getting various errors which i did not save but can recreate if needed.

My Requirements

I have some requirements that restrict software i can use

1. Software must be opensource(GPL)

2. Software must have a command line options for all utilities

Sorry if i am misusing any terms. From what i have read this is a mosaic but if it is a merge please let me know and i will update question.

2 Answers 2


If you can dabble in R this question seems similar:

Combine multiple partially overlapping rasters into a single raster in R

R codes can be called from the command line


  • I can learn R if that is required. I am using python for this script. I will work with that and see what i can do. That question does seem to be in line with what i am attempting. Thank you
    – Chris
    Nov 1, 2017 at 17:19

HiRise DTM's are stereo pairs. This means they take 2 different pictures of the same area at different viewing angles. The pictures have a different pixel size, some 0.25 meters up to 2.0 meters. This means the pictures have to be adjusted in scale to line up properly. When they generate the DTM they use the information from the images as a base for latitude, longitude and elevation. So 0 elevation may be different between 2 DTM's and there will be similar small differences in latitude and longitude. So when you take 2 different DTM's that overlap, they will almost never line up 100% because of this process.

** I hope i explained this better than my original post. I am trying to recall a conversation with someone that explained this to me. So if anything here is not accurate. Please edit or let me know so that i can correct it. I am by no means a GIS pro.

  • What do you mean with ".. the coordinate systems are adjusted to the projections"? Can you explain with other words and/or in more details? Tks. Dec 30, 2017 at 0:38
  • Yes, I will update the wording. After rereading this myself, I realize it is quite terrible.
    – Chris
    Dec 30, 2017 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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