Subscribe to this thread
Home - General / All posts - Joining Multiple ERDAS IMG surface files
NithField12 post(s)
#25-Mar-17 13:26

Hello,

I have thousands of 1km x 1km Elevation Tiles (2m resolution) in ERDAS IMG format. I want to join all of these files into one large file or single IMG file,

any ideas? I am a new manifold user... so this might be basic to most of you... Thanks

Attachments:
1km17502047270SWOOP2015.img

firsttube


1,439 post(s)
#25-Mar-17 14:39

Manifold can import .img surface files (I did the exact same thing, however using FME). It would be a simple matter of writing a script to batch import all these files and copy/paste them into one single large surface. However this might take a while and lots of system resources. Check out NewImport("ERDAS IMG") in the scripting reference. I would use the FileSystemObject to obtain the folder that contains the img files, cycle through these and import each one, then copy/paste to a "composite" surface component, and remove each img as it is done. I'll try to post something early next week.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

NithField12 post(s)
#25-Mar-17 15:20

Ok Thanks firsttube, I will log some time trying this,

Would this be the same process for multiple "tile" dem files?

dale

630 post(s)
#25-Mar-17 20:26

Here's a thread with an answer.

In setting the target referred to in the thread, I'd find the two files furthest apart, copy one, then paste append it to the other. This creates a surface component that can then have all the other imported files copy paste append by script.

Search the forum, there are other scripts that will import, and then assign projection to a folder of images or surfaces. That way you could set up and run an import and merge process to be run overnight.

tjhb
10,094 post(s)
#25-Mar-17 23:54

I'm going to dissent a bits. I think you could waste a lot of time on this for no good reason.

I have thousands of 1km x 1km Elevation Tiles (2m resolution) in ERDAS IMG format. I want to join all of these files into one large file or single IMG file,

Why do you want to do this? (It never hurts to say the purpose!)

How many thousands of images? How large would the single IMG file be? You might want to check that this will be workable in Maifold 8 before starting the merge process.

Also, Manifold 8 is not at its strongest with this sort of task. Yes, you can combine any number of raster tiles by copy and paste, and that can be scripted, just as firsttube and dale have said. But other tools are faster and more convenient. Global Mapper is probably the easiest, and quickly pays for itself if you need to do a lot of this. GDAL is free and equally powerful, if you're happy working at the command line. Radian Studio is also much more powerful for this sort of task than Manifold 8--both for merging the mosaic and, of course, for viewing and analysing it.

firsttube


1,439 post(s)
#30-Mar-17 16:59

Attached is a script that imports all IMG files from a given directory on your computer and creates a composite surface component using the imported surfaces. I tried it with 285 IMG files, and it did take some time. You have to ensure that while it's running that you don't use the clipboard in any other application. Un-comment lines 48 and 52 to try it on just 5 files first.

Attachments:
Batch_import_img_create_composite.map


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

antoniocarlos

609 post(s)
#30-Mar-17 17:08

This is a great script First to be.

What about if you want to make the mozaic look smooth. That is, reduce the seams between images. Not sure about the correct RS terminology but is it color correction or histogram matching? Can this be done with Radian? ArcGIS has such a function but the results with 50+ images grey scale images that I have are not good


How soon?

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.