Showing results for 
Search instead for 
Do you mean 

Geodetic Reprojection of Raster Imagery

by Technical Evangelist on ‎03-22-2018 08:59 AM (2,913 Views)

 

Download model

 

Description:

 

geodeticreprojectraster_v16_5_0.gmdx
reproject_model.PNG

 

 

This Model takes an image with an existing map coordinate system (whether it's via a geometric calibration or an actual ortho-image) and resamples the image from the input Coordinate Reference System (CRS) to a user-selected CRS (and ortho-resamples at the same time if the input is a geometrically calibrated image).  This is a task which can easily be achieved in the regular ERDAS IMAGINE user interface, however use of a Spatial Model to perform this task makes Batch reprojecting large numbers of images as a service much easier.

 

The input image must either be an ortho-image, or a raw (file coordinate) image that already has a geometric model calibration associated with the data. Such association is automatically the case in ERDAS IMAGINE for data such as NITFs or TIFFs supplied by DigitalGlobe or other satellite data vendors. Or geometric models can be manually associated (or existing models fine-tuned) through other methods, such as the use of IMAGINE Photogrammetry block triangulation, manual GCP editing and rigorous sensor model solution, the Calibrate with Sensor Model and Terrain tool, etc. No matter what methodology is used, this Model expects the input image to be already associated with a geometric model - it simply uses that model to resample from one CRS to another CRS.

 

In the case of input imagery with a 3D geoemtric model calibration (e.g. RPCs), an optional raster DEM filename can be used for the elevation source for the 3D geometric model . If no DEM Filename is specified, the elevation source set on the model  saved with the image will be used. If the geometric model being used is not 3D (such as when the input image is already an ortho-image), any specified DEM will be ignored and has no effect. In the absence of other sources of DEM information ERDAS IMAGINE is delivered with a global DEM ($IMAGINE_HOME\etc\globalterrainsources\globaldem2.jp2) and a higher resolution version can be downloaded from the Hexagon Geospatial web site (http://download.hexagongeospatial.com/downloads/global-dem-data).

 

The pixel size (and units) of the output image can be manually specified if a specific size is required (e.g. 1m x 1m pixels). Or the fields can be left blank and a default value will be derived in a manner that maintains the size of the pixels in map space. Note that if a pixel size is specified it will be translated into the units of the output CRS. For example, if an output pixel size of 4m x 4m is specified, but the output CRS is Lat/Lon, the 4m values will be automatically translated to Decimal Degrees when the model runs.

 

Note that if you use this particular Model to reproject a DEM, it will only reproject the horizontal coordinate system, not the vertical. So it would not translate the vertical datum from, say, Mean Sea Level to WGS84. A slightly different Model would be required to do that. I may take a stab at producing a model of this variety in a future, separate Spatial Recipe post. 

 

Also note, if your input imagery contains wedges of "background" (e..g. DN values of 0) at the edges, but these locations have not been marked as NoData, you may wish to mark them as NoData prior to running this Model. Such an assignment could also be made inside the Model as well, through use of a Set to NoData operator after the Raster Input, if desired.

 

Input parameters: 

 

Raster Filename In: The name of the input raster dataset. The raster should provide a full set of PCS information (projection type, spheroid, datum, parameters, etc.) necessary to perform a geodetic reprojection from one PCS to another.

Optional DEM: DEM to be optionally used for orthorectification. Can be left blank if no DEM available or is already defined by the Input Image's 3D geometric model.

Raster Filename Out: The name of the output raster dataset.

Projected Coordinate System (PCS): Define the output 2D Projected Coordinate System to use for reprojecting the input image to. The default is Lat/Lon.

Resample Method: The interpolation type to be used when reprojecting the input image. Valid values are "Nearest Neighbor", "Bilinear Interpolation", "Cubic Convolution", "LaGrange", and "Bicubic Spline".

Cell Size Rule: Define if you will manually Specify the output Pixel Size (using the fields below), or derive it from the input raster size (Same As Input) or use the Minimum or Maximum pixel dimensions of the input raster.

Pixel Width Optional value for the output pixel x size. A value will be calculated if left blank and Cell Size Rule is set to Same As Input. Value and Units will be translated to the PCS selected.

Pixel Height: Optional value for the output pixel y size. A value will be calculated if left blank and Cell Size Rule is set to Same As Input. Value and Units will be translated to the PCS selected.

Pixel Units: Units to be used for Pixel Width and Height values. Value and Units will be translated to the PCS selected when the Model runs.

Force Square Pixels: If True, output pixels with have equal values for Pixel Width and Height (in the dimensions of the target PCS)

 

reproject_dialog.png

 

Batch Processing

 

If using the Model to batch reproject several images, go to the Spatial Modeler tab / Execute group / Run pull-down and select Run in Batch. This will launch the standard Batch Editor dialog with the reprojection model command loaded and already variabalised for use. Note that since there are 10 Port Input operators in the Model (the purple colored operators on the left of the Model) there are 10 corresponding input variable columns to be completed in the Batch Editor CellArray. Each row in the CellArray will effectively represent an individual execution of the orthorectify command on a specific input image. There are numerous ways to utilize the Batch Editor to use the loaded command, but a common approach would be as follows:

 

  • Select the RasterFilenameIn column (by clicking on its header) and click Add Files.
  • Use the File Chooser to select those input images you wish to batch reproject and add them to the CellArray list. Alternatively you can drag-n-drop files from Windows Explorer onto the CellArray to queue those files.
  • Depending on what you did with the Model prior to clicking Run in Batch you may wish to remove the first Row at this stage (by clicking on 1 in the Row column, right clicking and Delete Selection)
  • Note that the variable column for RasterFilenameOut name has been autopopulated based on a pre-defined pattern. If you wish to alter this naming pattern, or location of the output files, use the Variable Editor by clicking on the Edit button and then selecting RasterFilenameOut in the Variable list. The same applies to the other variables.
  • If you are going to provide OptionalDEM filename(s) turn on the Use Filechooser to Edit Name checkbox and then click in the Cell you want to define a OptionalDEM filename for. This will bring up a File Chooser for you to select the appropriate DEM filename to use with the corresponding InputImage. Repeat for each other row you wish to define an optional DEM for, Alternatively, If you want to use the same DEM (e.g. a Global DEM or Elevation Library) for multiple InputImages, you can turn on the Show Full Pathname checkbox, select an existing displayed path and filename for a DEM in the CellArray, copy that string and Paste it into other OptionalDEM cells.
  • To edit the PixelHeigth, PixelWidth, ResampleMethod and PixelUnits turn off the Use Filechooser to Edit Name checkbox. Click in the Cell to be altered and type the desired value. Again, if using the same value in multiple places you can Copy / Paste the string, or use the CellArray Formula function to populate the fields in selected rows / columns (or modify the appropriate Variable).
  • Once the commands are populated satisfactorily, click Submit to set up parallel processing of the jobs and/or to schedule processing times.

However, if using the Model to batch reproject several images it is often easiest to remove those Port Inputs for values which will not vary through the set of input images to be batched. For example, if all input images will be batch reprojected to 1m by 1m pixels, go ahead and delete the Pixel Width, Pixel Height and Pixel Units Port Inputs and set the required values on the Define Processing Area operator input ports themselves prior to going to the Spatial Modeler tab / Execute group / Run pull-down and selecting Run in Batch. Otherwise any values left with Port Input operators on them must be populated with values in the Batch Command Editor CellArray - they cannot be left blank with the intent of automatically using default values.

 

Another approach would be to wrap the majority of the existing model into an Iterator operator and use a Multi Filename Input operator to construct a list of images to be reprojected and use that to control the Iterator execution. This would bypass the Batch Editor entirely. Again, I may take a stab at producing a model of this variety in a future, separate Spatial Recipe post. 

 

 

 

   

 

Comments
by Technical Evangelist
on ‎03-23-2018 06:12 AM

No. Define Processing Area translates information, it does not set missing information.

by
‎03-23-2018 06:17 AM - edited ‎03-23-2018 06:18 AM

OK - then answer to my question is no and I stay waiting for that enhancement request to turn reality Smiley Happy

 

 

 

by Technical Evangelist
on ‎03-23-2018 06:24 AM

You might want to vote for it then?

by
on ‎03-23-2018 06:35 AM

"You might want to vote for it then?"

 

Ouch - you got me. Voting done .... if giving hexpoints is the way to do it Smiley LOL

 

 

 

Courses
Contributors