Hexagon Geospatial
MENU

ERDAS IMAGINE Q&A

ERDAS IMAGINE, the world’s leading geospatial data authoring system, supplies tools for all your Remote Sensing and Photogrammetry needs.
Showing results for 
Search instead for 
Do you mean 

How to set/change Map Model Info for any raw raster images in batch mode?

by ParthaR. on ‎03-30-2016 11:47 AM (1,032 Views)

Question

How to set/change Map Model Info for any  raw raster  images in batch mode?

Answer

Below are the instructions  for using the Batch tool to update the Map Model  information for your image files.

 
If your input raw raster  images do not already contain map coordinate information, you will have to create a text file that contains a comma-separated list of the upper-left x (ulx) and upper-left y (uly) coordinates for each of your images, one set of coordinates per line.

 

Using a simple text editor ( or the “Text Editor” in IMAGINE : File > View > “View Text File), create a comma-separated list of the upper-left x (ulx) and upper-left y (uly) coordinates for each of your images, one set of coordinates per line. Make sure that there are no spaces after the commas (e.g.- 1062354.0,2062356.0). The list of coordinates must correspond (be in the same order) with your images that you will input into the Batch tool later. Save this file with a .TXT extension.

If your input raster  images do have map coordinate information, you do not have to create the text file containing the coordinates for each of your images. Instead, create a new image catalog (select the Catalog icon from “Manage Data” > “Catalog” > “Image Catalog”,  to open the Image Catalog tool) and add all of your images into the new catalog.  You will use the information stored in the Ulx and Uly columns of the image catalog  to populate variables in the Batch tool later. 

 


Batch update your Map Model:

1. Using the  “Edit Image Metadata” or the “Image Command tool”  (from the main IMAGINE menu > Home” > “Information” “Metadata Dropdown list” > “Edit Image Metadata”), select one of your image files that you want to add the map information to (ULX, ULY, pixel size, projection category, and units).

  1. Enable the Change Map Model checkbox and select the Options button. Enter the X and Y coordinates for the upper left corner of your image, and the X and Y pixel dimensions. Select your projection category, and set the desired units. Click "OK"
  2. in the Map Info Options window and then click "Batch" instead of "OK" in the Image Command window. This will open the Batch Commands Editor window where you will be see the following command :

 

imagecommand '$(Input1)' -map 1.0841140000000000e+006 2.0623860000000000e+006 8.0000000000000000e+000 8.0000000000000000e+000 us_survey_feet 'Lambert Conformal Conic' -meter imagecommand

 

 

  1. Also there are four choices in the “Variables” dropdown list. Please select the second option: “ One or more inputs, one output” , which will create multiple outputs from multiple inputs.

 

  1. You now need to enter a few variables into the command line so that it will recognize the input files and the ULX and ULY coordinates of each image and not the coordinates that you originally defined. You must create these three variables. Click the “Edit” button in the Batch dialogue  and change the default “input1” variable name to "Input", and set its Type to "User".


Then click the ”Add”  button to create another variable. Name the second variable "a_ulx", and set its Type to "User", then click the ”Add”  button to create another variable. Name the third variable "b_uly", and set its Type to "User".

 

Now that you have created your variables, it is time to insert them into the Batch command line.

 

 

 

In the under the Commands in the batch Commands Editor,  highlight the value of the upper left X, then click the “edit” button.  Then in the Variables editor dialog, click the newly created  variable “a_ulx” , under the Variables, and click the “Insert” button.  Similarly under the Commands in the batch Commands Editor,  highlight the value of the upper left Y, then click the “edit” button.  Then in the Variables editor dialog, click the newly created  variable “b_uly” , under the Variables, and click the “Insert” button.

This will change the X and Y coordinate value in the command line to $(a_ulx),  $(b_uly) respectively as shown below in the command:

 

d '$(Input)' -map $(a_ulx) $(b_uly) 8.0000000000000000e+000 8.0000000000000000e+000 us_survey_feet 'Lambert Conformal Conic' -meter imagecommand

 

 

Now click the “Input” variable tab  in the Batch Command Editor, and click the “Add files” button at the bottom left  corner.  Select all the files by using  Shift+ Click. This will populate your Input column with all of the images.

 


If you had created a text file with your image's upper-left x and upper-left y map coordinates, follow these steps to populate the a_ulx and b_uly columns in the batch  tool. Highlight the “a_ulx”  column tab in the Batch Tool, and click the dropdown list next to the same. You will see so many options there. One of them is Import, please select that. An Import Data dialog comes. Add the Text file that you
created earlier which contains the ULX and ULY coordinates for all of your input files. In the Import Column Data dialogue set the Separator Character to "Comma" and set other parameters if required.

Click OK to import your columns into the Batch  tool. All of your columns should now be populated with the appropriate information. Do the same with variable “b_uly”

 

If you did not create a text file with your images coordinates, but created a new image catalog instead, follow these steps to populate the a_ulx and b_uly columns in the batch tool. Highlight the Ulx and Uly columns in the image catalog, right-click and select copy. Now highlight the a_ulx and b_uly columns in the batch tool, right-click on the headings and select Paste. All of your columns should now be populated with the appropriate information. Click the “Run Now”  button

 

You have just updated the Map Model information for all of your files.

Contributors