User's Guide

REMAP

Changes the map projection of an image

Function:

Generates a geometric mapping grid that defines a transformation from one map projection to another. The image may then be re-mapped into the specified map projection using RESAMPLE and the geometric mapping grid.

Parameters:

INSPACE(-- )
Input image. The input projection and location information is read from the specified image's DDR. If INSPACE is NULL, input projection and location information is obtained from IPROJKEY, PIXSIZ, and TVAL. Windowing is ignored unless the COORS parameter is NULL.

OUTSPACE(--)
Output image. This image will not be created. The output projection and location information is read from the specified image DDR. If NULL, output projection and location information is obtained from OPROJKEY, PIXSIZ, COORS, and TVAL. Windowing is ignored.

OUTGRID
Output grid file. Output geometric mapping grid file containing the geometric mapping grid, statistical information related to the gridding process, as well as projection and framing information of the output space.

INPROJ(--)
Input projection definition file. This file contains projection-related information describing the image projection. INPROJ can contain more than one set of projection parameters. IPROJKEY and OPROJKEY specify the projections to be used. If there are two sets of projection parameters with the same projection key, the first occurance is used.

INPROJ is generated by PROJPRM and a description of the file may be found in the LAS Programmer's Manual. INPROJ is ignored if both INSPACE and OUTSPACE are specified.

IPROJKEY(--)
Input projection key. The key of the projection in INPROJ which describes the input coordinate system. If INSPACE is NULL, IPROJKEY must be specified. Ignored if INSPACE is specified.

OPROJKEY(--)
Output projection key. The key of the projection system in INPROJ which describes the output coordinate system. If OUTSPACE is NULL, OPROJKEY must be specified. Ignored if OUTSPACE is specified.

PIXSIZ(--)
Pixel dimensions. Defines the dimension of each pixel in the transformed (output) coordinate space and, optionally, in the input coordinate space. The first value is the dimension in the line (Y) direction, and the second value is the dimension in the sample (X) direction. If OUTSPACE is NULL, the first two values are the Y and X pixel dimensions for the output space. If OUTSPACE is specified, INSPACE is NULL, and four values are entered, the first two values are the Y and X pixel

dimensions in the output space and the second two values are the Y and X values in the input space. If only two values are specified, they are the Y and X values for the input space. If both OUTSPACE and INSPACE are NULL, the first two values are the Y and X pixel dimensions in the output space, The next two values are the Y and X pixel dimensions in the input space. If INSPACE is specified, the third and fourth PIXSIZ values are ignored. If both OUTSPACE and INSPACE are specified and two PIXSIZ values are entered, these values will be used to override the pixel dimensions from OUTSPACE.

COORS(--)
Coordinates. These coordinates are used to define the frame of the output area. Coordinates are entered as Y (latitude or northing), X (longitude or easting). Five different modes of processing are possible. See User Note 3.

COORUNIT(DEG)
Coordinate units. The type of units in which COORS are entered.

  = DMS: Degree Minutes Seconds (+DDDMMMSSS.SS)
  = RAD: Radians
  = DEG: Degrees
  = SEC: Seconds
  = PRO: Projection coordinates in output space

LSCOORS(1,1)
Line/sample coordinates. The image coordinates of the first coordinate pair entered in COORS when projection parameters are being specified directly. The default is the upper-left corner of the output image space (1,1).

NL(--)
Number of lines. The number of lines in the output area, specified when only the first projection coordinate pair is given in COORS, or when OUTSPACE is specified and the number of lines specified in OUTSPACE's DDR is to be overridden.

NS(--)
Number of samples. The number of samples in the output area, specified when only the first projection coordinate pair is given in COORS, or when OUTSPACE is specified and the number of samples specified in OUTSPACE's DDR is to be overridden.

ROTANG(0.0)
Rotation angle. The positive or negative rotation angle in degrees relative to the output image center. A positive angle represents a clockwise rotation and a negative angle represents a counterclockwise rotation.

TVAL(--)
Tie point values. A set of four tie point pairs giving line and sample coordinates and corresponding latitude/Y, longitude/X coordinates for the first tie point; followed by tie point pairs giving line and sample coordinates and corresponding latitude/Y, longitude/X coordinates for the second tie point. The tie points may not coincide.

TVALUNIT(DEG)
Tie point units. The type of units in which the latitude/Y and longitude/X values in TVAL are entered.


  = DMS: Degree Minutes Seconds (+DDDMMMSSS.SS)
  = RAD: Radians
  = DEG: Degrees
  = SEC: Seconds
  = PRO: Projection coordinates in input space

TOLVAL(0.015625)
Tolerance value. Tolerance (in pixels) for reducing the density of geometric mapping grid points. If NLGRID and NSGRID are specified, TOLVAL is ignored.

NLGRID(--)
Number of lines per grid cell. The number of lines contained in each output grid cell. If NLGRID is NULL, the geometric mapping grid size is set to the maximum and then reduced according to TOLVAL.

NSGRID(--)
Number of samples per grid cell. The number of samples contained in each output grid cell. If NSGRID is NULL, the geometric mapping grid size is set to the maximum and then reduced according to TOLVAL.

PRINT(TERM)
Output destination. The destination of the output.

  = --:        No Report
  = TERM:      Terminal.  Output is sent to the user's 
               terminal.
  = LP:        Line printer.  Output is sent to the 
               printer defined by $PRINTER.
  = Filename:  User-supplied filename.  Output is sent 
               to the user-supplied file with the 
               extension ".prt".

Examples:

  1. LAS> remap inspace=image inproj=proj outgrid=reproj oprojkey="out" pixsiz=(100.0,100.0) coors=(41.35,-107.75,37.90,-100.10) coorunit=deg rotang=0.0 print=(term,lp)

    The input projection and location information is obtained from the input image DDR. The output projection information is obtained from the PROJ;PROJ projection definition file with a key of "OUT." The output image is framed around an upper-left latitude/longitude of 41.35 north, 107.75 west and a lower right corner of 37.90 north, 100.10 west. A rotation is not applied to the resulting output image frame. All information printed is written to both the terminal and a printer. The resulting geometric mapping grid is written to REPROJ;GRID.

  2. LAS> remap inproj=proj outgrid=reproj oprojkey="out" iprojkey="geog" pixsiz=(80,80,3,3) coors=(36.0,-86.0,35.0,-84.0) coorunit=deg rotang=0.0 tval=(1,1,36,-86,1201,2401,35,-84) tvalunit=deg print=term

    The input projection and location information is obtained via parameters instead of from an image DDR. Both the input and output projection parameters are read from the projection definition file PROJ;PROJ. Input location information is determined from the tie points in TVAL and the PIXSIZ (3rd and 4th elements). In this example, the input image has a latitude/longitude of 36,-86 degrees at input image pixel (1,1) and a latitude/longitude of 35,-84 at pixel (1201,2401). The pixel size of the input image is 3 arc seconds by 3 arc seconds. (The units of arc seconds are found in the parameter definition file record for the input projection parameters, implied for this example.) The output image frame is obtained in the same manner as in Example 1, using different coordinates. A rotation is not applied to the resulting output image frame. All information printed is written to the terminal. The resulting geometric mapping grid is written to REPROJ;GRID.

  3. LAS> remap inspace=image inproj=proj outgrid=reproj oprojkey="out" pixsiz=(30.0,30.0) print=term

    The entire input image is re-mapped to the output projection specified in the projection definition file PROJ;PROJ. The output image frame will be (approximately) the entire input image frame. The pixel size of the output image is 30 meters in the line direction by 30 meters in the sample direction. Output is to the terminal only, and the resulting geometric mapping grid is written to REPROJ;GRID.

Description/Algorithm:

REMAP determines the input and output space (image) framing and projection parameters.

The input space parameters may be determined in one of two ways. If an input image was given in INSPACE, the projection parameters and image/ projection corners are obtained from the image DDR. If any needed information is invalid, a fatal error occurs. If INSPACE is NULL, projection parameters are read from the projection definition file described by INPROJ and IPROJKEY, the input image pixel size is obtained from PIXSIZ (elements 3 and 4), and image location information is derived from the tie points entered in TVAL.

The output space parameters may also be determined in one of two ways. If an image name was given in OUTSPACE, the projection parameters and image/projection

corners are obtained from the image DDR. If any needed information is invalid, a fatal error occurs. If OUTSPACE is NULL, projection parameters are read from the projection definition file described by INPROJ and OPROJKEY, the input image pixel size is obtained from PIXSIZ (elements 1 and 2). Five different methods are provided for specifying the output space frame:

  Method 1:

     o  The user defines the upper-left and lower-right corner
        coordinates of the area of interest in geographic 
        coordinates.  This forms a rectangle in geographic 
        coordinates.

     o  This rectangular space is projected into the output 
        projection coordinate system.  This usually results in 
        a non-rectangular area.

     o  The boundaries of this projected area are searched for 
        minimum and maximum X and Y coordinates in the output 
        projection coordinate system.  This forms a minimum 
        bounding rectangle in the output space of the area of 
        interest.

     o  The upper-left corner (the minimum X, maximum Y) is 
        adjusted outward to the next X and Y multiples of the 
        pixel size.  This is an arbitrary step which simplifies 
        the combining of images with different scales.  It does 
        not alter the internal image geometry, it only slightly 
        adjusts the size of the image frame.

     o  The upper-left corner projection coordinate is assigned 
        to image coordinate (1,1).


  Method 2:

     o  The user defines:  

        a.  An output space projection coordinate at some image 
            coordinate defined by LSCOOR.  When LSCOOR defaults 
            to image coordinate (1,1), the output space 
            coordinate given is the upper-left corner of the 
            output space.  
        b.  The lower-right corner in the output projection 
            space.

     o  REMAP adjusts the first coordinate given to image 
        coordinate (1,1) to get the minimum X and the maximum Y 
        projection coordinate.  The second coordinate pair given 
        is the maximum X and the minimum Y coordinate.  The 
        output space is now defined.


  Method 3:

     o  The user defines an output space projection coordinate 
        at some image coordinate defined by LSCOOR, as in Method 
        2.

     o  The user enters the number of output image lines and 
        samples.

     o  The coordinate entered is adjusted to image coordinate 
        (1,1) to get the minimum X and the maximum Y projection 
        coordinates.

     o  The maximum X and minimum Y coordinates are calculated 
        using PIXSIZ and the number of lines and samples from 
        the minimum X and maximum Y projection coordinate.

   Method 4:

     o  When COORS and OUTSPACE are NULL, an input image with 
        a valid DDR must be specified in INSPACE.  Image 
        windows maybe used with this method.

     o  The projection coordinates of the input image corners
        are transformed into output space coordinates and the
        minimum and maximum projection coordinates are 
        determined, forming a minimum bounding rectangle in
        the output space.

     o  The upper-left corner (the minimum X, maximum Y) is 
        adjusted outward to the next X and Y multiples of the 
        pixel size.  This is an arbitrary step which simplifies 
        the combining of images with different scales.  It does 
        not alter the internal image geometry; it only slightly 
        adjusts the size of the image frame.

     o  The upper-left corner projection coordinate is assigned 
        to image coordinate (1,1).

        (The user has little control over the output image framing
         parameters with this method, but this method is the most 
         automatic.)

   Method 5:

     o  When COORS is NULL and OUTSPACE is specified, method 3 is used.
        The image coordinate is the upper left corner of OUTSPACE.  
        When the values NL, NS, and PIXSIZ are defaulted they are 
        taken from the DDR.  These values can be overridden by 
        entering an appropriate value.   

When a transformation has been established, it is applied to create the geometric mapping grid. The user can control the density of the mapping grid in two ways:

1.  The default technique is to perform a sampling of the error
    at regular intervals over the image (both rows and columns).
    At these intervals, a slice of a grid is created and reduced 
    to the minimum density that allows the grid to meet the 
    allowed error tolerance (TOLVAL) in all sampled areas.

2.  The user has the option to specify the number of lines and 
    samples in each grid cell.  From these, the number of rows 
    and columns in the geometric mapping grid are calculated.  
    If the number of rows and columns exceed the maximum size 
    of 4095 x 4095, the number of lines and samples in each grid 
    cell are adjusted to fit the maximum grid size.  The user 
    is then informed of the adjustment.  Using this option, it 
    is assumed the user is aware of potential gridding errors
    due to grid density; grid reduction techniques are not 
    applied.

The output geometric mapping grid file contains the mapping grid point values, projection information and framing information needed by RESAMPLE to fill the output image's DDR.

Nonfatal Error Messages:

  1. [remap-warn] Nonfatal error encountered

    A non-fatal error was encountered during processing. The message displayed immediately preceding this error message is the specific error encountered. Processing continues.

  2. [remap-nrows] Number of grid rows exceeded maximum. Number of grid rows set to maximum

    The number of geometric mapping grid rows exceeded the maximum allowed. This error occurs when the user enters too small a grid spacing (NLGRID) for the window given. The number of rows is set to the maximum (4095).

  3. [remap-ncols] Number of grid columns exceeded maximum. Number of grid columns set to maximum

    The number of geometric mapping grid columns exceeded the maximum allowed. This error occurs when the user enters too small a grid spacing (NSGRID) for the window given. The number of columns is set to the maximum (4095).

Fatal Error Messages:

  1. [remap-fatal] Fatal error encountered

    The error message displayed immediately preceding this message is the specific error encountered. Processing is terminated.

  2. [remap-pixsiz] Input and output pixel size must be specified

    The input and the output pixel size must be specified if INSPACE is not specified.

  3. [remap-frame] Framing coordinates must be specified

    The output image framing parameters must be specified if INSPACE is not specified.

  4. [remap-noproj] Projection information not available from DDR

    Input projection and location was to be read from the INPUT or OUTPUT image DDR; however, the DDR contained some invalid information. Correct the DDR information or specify the input projection and location parameters using INPROJ, IPROJKEY, PIXSIZ, TVAL, and TVALUNIT.

  5. [remap-tiepts] Tie points coincide

    Tie points are coincident in either line, sample or latitude, longitude. Correct the tie point coordinates.

  6. [remap-nomap] Unable to re-map to selected output frame

    REMAP was unable to create a valid geometric mapping grid for the selected output frame. This occurs mainly with global data sets. This condition is due to assumptions made during the process of gridding the output space frame into the geometric mapping grid for the image resampler, RESAMPLE. RESAMPLE performs a locally linear interpolation between grid points--some projection changes are not representable in this manner.

  7. [remap-points] Tie point values must be specified

    The tie point values must be specified if the INSPACE parameter is not specified.

  8. [remap-break] Error determining framing coordinates

    REMAP was unable to determine the framing coordinates. This mainly occurs with global data sets. Break the image into small sections and run REMAP on each section individually.

  9. [remap-proj] Source of projection information not fully specified

    The source of the projection information was not specified. If INSPACE was not specified, INPROJ and INPROJKEY must be specified. If OUTSPACE was not specified, INPROJ and OPROJKEY must be specified.

  10. [remap-invalid] NL/NS/NLGRID/NSGRID must be greater than zero

    The NL (also NS, NLGRID, and NSGRID) parameter was specified to be an invalid value. If specified, it must be greater than zero.

User Notes:

  1. The maximum grid size is 4095 x 4095. It is suggested that the user not actually make grids this dense since it would consume greater than 250 MB of memory.
  2. The DSPGRID module can be used to display the grid.

  3. For diagrams and more information on the framing and gridding process, refer to the Geometric Manipulation Package Overview Document, GEOMPOD.

  4. The five possible uses of COORS are as follows:

    1. When four values are specified and COORUNIT = DMS, RAD, SEC, or DEG, the upper-left and lower-right corners of a geographic input space are defined. These corner coordinates, along with the pixel dimensions, make up the framing parameters. The framing parameters are projected into the specified output projection space, and minima and maxima in X and Y are recorded along the borders of the projected space. These minima and maxima are used to define the boundaries of the output space.

    2. When four values are specified and COORUNIT = PRO, a coordinate somewhere within the output space frame and the lower-right corner coordinate in the output projection space are given. The first coordinate is paired with LSCOOR and is adjusted internally to pixel 1,1. These coordinates are the minimum and maximums in X and Y and are used to define the boundaries of the output space.

    3. When two values are specified and COORUNIT = PRO, a coordinate somewhere within the output space frame is given. This coordinate is paired with LSCOOR to determine the upper-left corner coordinate in the output space. This mode of processing requires that NL and NS also are given. When NL and NS are combined with PIXSIZ, the lower-right corner of the output space projection can be found, giving minimum and maximum coordinates in X and Y and thus defining the boundaries of the output space.

    4. When COORS is NULL and OUTSPACE is also NULL, the entire input image is re-mapped using the approximate frame of the input image. Thus, the user has little control over the output image framing parameters; however, this method is the most automatic. An input image window is taken into consideration with this method of processing.

    5. When COORS is NULL and OUTSPACE is specified, the third method is used with the coordinate from the upper left of OUTSPACE being used. The pixel size (PIXSIZ), number of lines (NL) and number of samples (NS) are also used from OUTSPACE. Any of these values can be overridden by specifying a value in one of the following: PIXSIZ, COORS, NL, NS.