-------------------------------------------------------------------------------- MODULE DTITRANS
--------------------------------------------------------------------------------
DTITRANS performs the following operations on raster data held in a DTI format:
--------------------------------------------------------------------------------
Command Qualifiers Defaults
/DESCRIPTOR None /FILE_TYPE /FILE_TYPE=LSLA (see text) /FOUR=control-file-spec /FOUR='HERE:RECTIFY.DAT' /IFF=IFF-file-spec /IFF='LSL$IF:DTITRANS.IFF' /IMAGEMAP=Image-orientation-file /IMAGEMAP='LSL$RCP:TRANSP.DAT' /[NO]LOG /NOLOG /PROJECTIVE=control-file-spec /PROJECTIVE='RECTIFY.DAT' /[NO]PROMPT /NOPROMPT /RESAMPLE /RESAMPLE=LINEAR (see text) /[NO]ROUND_ORIGIN /NOROUND_ORIGIN /[NO]SHIFT /NOSHIFT /THREE=control-file-spec /THREE='RECTIFY.DAT' /[NO]TRANSFORM /TRANSFORM /TWO=control-file-spec /TWO='RECTIFY.DAT' /[NO]WINDOW /NOWINDOW
DTI-input-file-spec
Specifies the input DTI file.
Any part of the file specification that is not supplied will be completed from the default of "LSL$DTI:DTI.DTI;0"
DTI-output-file-spec
Specifies the name of the DTI file to be created.
Any part of the file-spec that is not specified will be completed from the parsed input file-spec.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DESCRIPTOR
- Selects the option to create and set the fields of a DTI Projection record, or to modify an existing DTI Projection record. This option is only valid if the input DTI file has a 'LSLA' header.
If the input file does not contain a DTI Projection record, DTITRANS will insert a record by extending the size of the file header. If the input file already contains a Projection record, the contents of the record will be displayed, and may be edited. In both cases the operations are performed 'in situ'.
/FOUR=control-file-spec
- Specifies that a four point transformation will be carried out to rectify an image from one coordinate system to another, using control points read from the specified ASCII file.
The default specification for the control file is 'RECTIFY.DAT'.
/FILE_TYPE
- Determines what style of DTI file header is created by the module. The following options are available:
/FILE_TYPE=LSLA (default) A DTI file with a 'LSLA' header, and with a DTI Projection record is created. The format of the DTI Projection record is described below and in the DTILIB Reference Manual.
/FILE_TYPE=TED4 A DTI file with a 'TED4' header and no DTI Projection record is created. If the transformation is to Geographicals, the relevant fields in the DSI record are set by the module. A blank ACC record is created.
/FILE_TYPE=UHL1 A DTI file with a 'UHL1' header and no DTI Projection record is created. If the transformation is to Geographicals, the relevant fields in the UHL record are set by the module.
For full details of the different DTI header structures, the user is referred to the DTILIB Reference Manual.
/IFF=IFF-file-spec
- Creates an IFF file containing registration marks in the form of border and grid ticks that may be overlaid on the transformed image map. The registration ticks are written to layer 0 of the IFF file, and are given a feature code of 0. The grid ticks define a 1km grid.
The default specification for the output IFF file is 'LSL$IF:DTITRANS.IFF'
This qualifier is only allowed if /IMAGEMAP has also been specified.
/IMAGEMAP=image-orientation-file-spec
- This option allows an image map to be generated using transformation parameters determined by the IMAGEPROCESS (SATMAP) image orientation module and read from the specified image orientation file.
The default specification for the orientation file is 'LSL$RCP:TRANSP.DAT'.
/LOG
/NOLOG (default)
- Generates a display on SYS$OUTPUT indicating the progress of the transformation and resampling operations.
The default is /NOLOG.
/PROJECTIVE=control-file-spec
- Specifies that a projective transformation will be carried out to rectify an image from one coordinate system to another, using control points read from the specified ASCII file.
The default specification for the control file is 'RECTIFY.DAT'.
/PROMPT
/NOPROMPT (default)
- Forces the module to prompt for details of all input DTI projection parameters, irrespective of whether all or some of these parameters are available from the DTI header records.
This qualifier is generally only used in situations where the projection information contained in the input DTI file is unset or is known to be unreliable.
/RESAMPLE
- Selects the algorithm to be used when resampling the input data values.
/RESAMPLE=NINT. A Nearest Neighbour algorithm is used. The value of the node in the transformed DTI file is taken as the data value of the nearest node in the input DTI file.
This algorithm is useful in situations were it is important to maintain the original input matrix values, but has the disadvantage that in the process of rounding, a node may be offset by up to half the sample interval. This may be visually apparent when the output image is displayed.
/RESAMPLE=LINEAR. The value of the node in the transformed DTI file is derived from the nearest four nodes in the input file using bi-linear interpolation.
The advantage of this method is that it results in a smooth image without the problem of image discontinuity exhibited by the nearest neighbour approach. The default is /RESAMPLE=LINEAR
/ROUND_ORIGIN
/NOROUND_ORIGIN (default)
- Forces the origin offset of the DTI file to be a multiple of the sampling interval.
The default is /NOROUND_ORIGIN.
/SHIFT
/NOSHIFT (default)
- Specifies that the module is to apply a constant x and y shift to all coordinates before any transformation and/or resampling operation. The extent of the coordinate shift is defined by the user when the module prompts for projection data for the output DTI file. The shift is achieved by modifying the local origin values of the output DTI file.
This option is not valid when /IMAGEMAP has been selected.
The default is /NOSHIFT
/THREE=control-file-spec
- Specifies that a three point transformation will be carried out to rectify an image from one coordinate system to another, using control points read from the specified ASCII file.
The default specification for the control file is 'RECTIFY.DAT'.
/TRANSFORM (default)
/NOTRANSFORM
- Specifies that the module is to perform a projection change operation on the input DTI file. The module will prompt for any input projection data that cannot be derived from the header records of the input DTI file, and for output projection data. The number and nature of the output projection parameters varies with the selected projection.
/NOTRANSFORM specifies that the module is to perform a resampling operation on the input DTI file, without any projection change. The input DTI file may be resampled to either a coarser or finer resolution grid. If /NOTRANSFORM is specified the user is prompted only for output sample values.
This option is invalid when /IMAGEMAP has been selected.
/TWO=control-file-spec
- Specifies that a two point transformation will be carried out to rectify an image from one coordinate system to another, using control points read from the specified ASCII file.
The default specification for the control file is 'RECTIFY.DAT'.
/WINDOW
/NOWINDOW (default)
- Causes the module to prompt the user for SW and NE coordinates that define a rectangular area of interest in the input DTI file, and a rectangular area of interest in the output file. Only those nodes that fall within the defined area of interest are considered for transformation or resampling.
The default is /NOWINDOW ie. all the data values in the input DTI file are used.
DTI files output from DTITRANS are created by default with an 'LSLA' (LSL Type A) header and with a DTI Projection record. The Projection record contains a projection and spheroid code and associated parameters, and the coordinates of address (1,1) in the matrix. The record is analogous to an IFF version 2 Map Descriptor (MD) entry. The coding conventions adopted by the IMP module ITRANS are followed.
The DTI Projection record holds the following information:
When the data in the DTI file is held in Geographicals the units may be in radians, seconds of arc, degrees of arc or tenths of seconds of arc. Tenths of seconds of arc is the default.
When the data is recorded on a projection the units may be metres (default) or feet.
The units codes recorded in the DTI Projection record are:
0 Unset 1 Feet 2 Metres 3 Seconds of arc (only valid if projection is 100) 4 Degrees of arc (only valid if projection is 100) 5 Radians (only valid if projection is 100) 102 mm on the source document 104 thousands of an inch on source document 110 1/10 seconds of arc (only valid if projection is 100)
The coordinate values are held in the units specified in the Projection record. The coordinates of other nodes in the matrix may be determined using these values, and the matrix sample interval values.
The grid values are held in the units specified in the Projection record. The x and y grid values may be different, and are constant for the entire matrix.
All geographical data is ultimately related to a particular spheroid.
The spheroid is the geometrical model of the earth that was used when the original survey was carried out. It is not possible, using DTITRANS, to convert data from one spheroid to another.
The spheroids supported by DTITRANS, and the code recorded in the DTI Projection record are:
0 Clarke 1866 1 Clarke 1880 2 Bessel 3 New International 1967 4 International 1924 (Hayford 1909) 5 World Geodetic System 72 (WGS 72) 6 Everest 7 World Geodetic System 66 (WGS 66) 8 Geodetic Reference System 1980 (GRS 1980) 9 Airy 10 Modified Everest 11 Modified Airy 12 Walbeck 13 Southeast Asia 14 Australian National 15 Krassovsky 16 Hough 17 Mercury 1960 18 Modified Mercury 1968 19 Sphere of radius 6370997 M 20 Sphere of radius 6371229.3M 21 Clarke 1880 (IGN) 22 World Geodetic System 84 (WGS 84) 101 User specified spheroid
Appendix A of the IMP Reference Manual gives full details of these spheroids.
When a user specified spheroid is defined, then information about the length of the semi-major axis, and the length of the semi-minor axis or eccentricity squared, is also recorded in the Projection record.
The projections that DTITRANS supports are:
0 Unset 1 Universal Transverse Mercator 2 State Plane Coordinates 3 Albers Conical Equal Area 4 Lambert Conformal Conic 5 Mercator 6 Polar Stereographic 7 Polyconic 8 Equidistant Conic 9 Transverse Mercator 10* Stereographic 11* Lambert Azimuthal Equal Area 12* Azimuthal Equidistant 13* Gnomonic 14* Orthographic 15* General Vertical Near-Side Perspective 16* Sinusoidal 17* Equirectangular 18* Miller Cylindrical 19* Van der Grinten 20 Oblique Mercator (Hotine) 21* Oblique Mercator (Spherical) 22 Stereographic (UKSL formulae) 23 Cassini 24 Krovak 25 Bonne 26* Mollweide 27* Hammer-Aitoff 28* Winkel III 29* Modified-Stereographic 100 Geographic (ie. Latitude and Longitude) 101 UK national grid (a special case of 9)
1) Those projections marked with a '*' are only defined for a sphere, not a spheroid
2) Data can be held in geographicals (ie. Latitude and Longitude) by specifying projection code 100 Currently the DTI Projection record is created and modified only by the module DTITRANS. It is designed to reduce the amount of information a user must enter when carrying out a series of projection changes on a set of data, and to enable the automatic registration of raster and vector geographic data.
The Projection record is always appended on to the end of any DTI header information that may exist in an input 'LSLA' type DTI file.
DTITRANS will carry out a projection change unless the /NOTRANSFORM, /DESCRIPTOR, /IMAGEMAP, /TWO, /THREE, /FOUR or /PROJECTIVE options are selected. Projection change on raster data involves both a coordinate transformation using parameters derived from the input and output projection values, and the calculation of the data value at the transformed coordinate position by resampling the input data values.
In order to calculate the size of the output DTI file, the transformation parameters are first applied directly to the 4 corners of the input matrix. The minima and maxima of these transformed coordinates in conjunction with the output sample values determine the size of the output matrix.
Subsequently an inverse transformation is applied. The transformation is applied to each point in the output matrix in order to determine its corresponding position in the input matrix. The value of the transformed point is determined from the input matrix values using one of the resampling techniques described below. If the transformed point lies outside the input matrix, a null value is assigned to the point. For DTI files holding byte data this is 0, while for all other data types a value of -32767 is used.
The resampling options available in the program are nearest neighbour, in which the value of the matrix point in the transformed image is taken as the value of the nearest matrix point in the original image, and bilinear interpolation (default) in which the value of the transformed matrix point is taken as the weighted average of the nearest 4 points in the input image. The advantage of the nearest neighbour method is that it is simple to compute, and the value from the original image is used without modification. The disadvantage is that in the process of rounding the transformed value to the nearest matrix point, discontinuities that may be visually apparent in the output image may be introduced. In contrast bilinear interpolation produces a smooth image without apparent discontinuity, but has the disadvantage that the input matrix values are altered, and computation times are increased.
When carrying out plane transformations on data in a DTI file, DTITRANS uses an ASCII file of control points to define the two coordinate spaces. Each control file has four or more lines of input/output points in the format XINPUT YINPUT XOUTPUT YOUTPUT. The control file may contain blank lines and comment lines, the comment lines are identified by a '!' or ';' as the first character and must appear on separate lines from the control points. An example control file might be:
!This is an example control file
!and here is the first row of control points 11567.009 45389.873 490000 280000 ;and the second 12896.7 88742.607 490000 281000
!and the third and fourth, preceeded by a blank line. 55468.886 46672.245 491000 280000 56487.076 88921.502 491000 281000 ;and that's the file [EOB]
The plane transformation is similar to the projection transformation, the difference being, that instead of carrying out a projection calculation to determine the forward and backward matrices, one of the following plane transformations is applied.
This transformation will force the 4 input points to fit the four output points exactly, but it is not obvious how other points in the file will be distorted. It is thought to be useful for correcting paper distortion, as when data is digitised from a paper map based on known exact control points such as graticule intersections.
This transformation is called the "Extended four point" transformation in other Laser-Scan programs.
This transformation uses a projective algorithm and will force the 4 input points to fit the four output points exactly.
This transformation is sufficient to correct for rotation, scaling, translation and shearing. This means that shapes may be altered, but in a predictable way (e_.g_. a square may be transformed into a parallelogram).
This transformation is also known as the "Affine" transformation.
This transformation is sufficient to correct for rotation, scaling and translation only. This means that the shapes of features will not be altered.
This transformation is called the "Orthogonal" transformation in other Laser-Scan programs.
By default, a plane transformation will try to preserve the input file resolution, and calculate an output grid pixel to account for any change in the relative sizes of the input and output DTI files. If the output DTI is required at a coarser or finer resolution, the user must give the desired sampling when prompted with the new calculated grid sizes.
Using the /THREE and /TWO qualifiers with four sets of coordinates, or giving more than four control points, over determines the transformation, so a least squares solution is applied. This means that the final coordinates of the control points may be slightly different from the target values. Where the maximum of these discrepancies is greater than 1/1000th of the range of the target control point values then the operator is asked if the transformation is to be accepted.
--------------------------------------------------------------------------------
$DTITRANS_Input-DTI-file: OS44000800 _Output-DTI-file: TEST Existing Projection Data for source DTI file: Spheroid : 9 (Airy) Projection : 101 (UK national grid) Units : 2 (metres) Local origin : 440000.000 (Eastings) 80000.000 (Northings) Sample values : 50.000 (Eastings) 50.000 (Northings) Enter projection data for destination DTI file ********************************************** Enter projection code (101): ? Allowable projections and their codes are:- 0 Unset 1 Universal Transverse Mercator 2 State Plane Coordinates 3 Albers Conical Equal Area 4 Lambert Conformal Conic 5 Mercator 6 Polar Stereographic 7 Polyconic 8 Equidistant Conic 9 Transverse Mercator 10* Stereographic 11* Lambert Azimuthal Equal Area 12* Azimuthal Equidistant 13* Gnomonic 14* Orthographic 15* General Vert Near-Side Persp 16* Sinusoidal 17* Equirectangular 18* Miller Cylindrical 19* Van der Grinten 20 Oblique Mercator (Hotine) 21* Oblique Mercator (Spherical) 22 Stereographic (UKSL formulae) 100 Geographic (ie Lat and Long) 101 UK national grid Note: projections marked "*" are defined for the sphere, not the spheroid. If a spheroid is defined, then the sphere with the same surface area as the spheroid is used Enter projection code (101): 100 ( Geographic (ie Lat and Long)) Enter unit code (110): (1/10 seconds of arc) Define sample intervals as Latitude Longitude (0.0, 0.0): 10 20<CR> Final Projection Data for output DTI file ***************************************** Spheroid : 9 (Airy) Projection : 100 (Geographic (ie Lat and Long)) Units : 110 (1/10 seconds of arc) Local origin : 1822177.245 (Latitude) -51643.070 (Longitude) Sample values : 10.000 (Latitude) 20.000 (Longitude) ELAPSED: 0 00:02:49.94 CPU: 0:01:08.36 BUFIO: 67 DIRIO: 18 FAULTS: 516 $
Since the input and output DTI files were not specified on the input command line, DTITRANS prompts for the file specifications of the two files.
The user is asked to enter projection information for the output DTI file.
Note that in response to the prompt "Enter projection code", the user has
typed "?" in order to obtain a list of all available projection codes.
The user is prompted in addition for a unit code, and has accepted the
default of 110 (1/10 seconds of arc) by pressing
On entering all the output projection data, confirmation is printed on the terminal, and DTITRANS proceeds to transform and resample the input matrix.
$DTITRANS/LOG OS44000800 MERCATORExisting Projection Data for source DTI file: Spheroid : 9 (Airy) Projection : 101 (UK national grid) Units : 2 (metres) Local origin : 440000.000 (Eastings) 80000.000 (Northings) Sample values : 50.000 (Eastings) 50.000 (Northings) Enter projection data for destination DTI file ********************************************** Enter projection code (101): 5 ( Mercator) The Mercator projection requires the following additional information:- Latitude that has true scale in DDD MM SS.SS format ( 0 00 00.000N): 49N Longitude of the central meridian in DDD MM SS.SS format ( 0 00 00.000E): 2W Eastings of the origin of the projection (0.0): Northings of the origin of the projection (0.0): Enter unit code (2): (metres) Define sample intervals as Eastings Northings (50.0, 50.0): 100 100 Final Projection Data for output DTI file ***************************************** Spheroid : 9 (Airy) Projection : 5 (Mercator) Latitude of true scale : 49 00 00.000N Longitude of the central meridian : 2 00 00.000W Eastings of origin : 0.000 Northings of origin : 0.000 Units : 2 (metres) Local origin : 41372.472 (Eastings) 4285745.865 (Northings) Sample values : 100.000 (Eastings) 100.000 (Northings) +----------------------------------------------------------------+ | | | Transforming and Resampling Matrix Points | | | +----------------------------------------------------------------+ ELAPSED: 0 00:34:48.87 CPU: 0:00:29.39 BUFIO: 124 DIRIO: 4 FAULTS: 330
The input DTI file contained a complete and valid projection record so the user was not prompted for any input projection data. The user was however asked to enter data for the output projection system. Output to a Mercator projection was selected. This projection requires four additional pieces of information. Since the input projection is different from the target projection, defaults of 0.0 are supplied.
The /LOG qualifier was present on the command line, so that details of the processing operation are displayed on the terminal. If the program is being run on a CRT an indication of the percentage complete will also be shown.
$DTITRANS/WINDOW OS44000800 MERCATORExisting Projection Data for source DTI file: Spheroid : 9 (Airy) Projection : 101 (UK national grid) Units : 2 (metres) Local origin : 440000.000 (Eastings) 80000.000 (Northings) Sample values : 50.000 (Eastings) 50.000 (Northings) Define input window as Eastings Northings (440000.0, 80000.0, 460000.0, 100000.0):440000.0 80000.0 450000.0 90000.0 Enter projection data for destination DTI file ********************************************** Enter projection code (101): 5 ( Mercator) The Mercator projection requires the following additional information:- Latitude that has true scale in DDD MM SS.SS format ( 0 00 00.000N): 49N Longitude of the central meridian in DDD MM SS.SS format ( 0 00 00.000E): 2W Eastings of the origin of the projection (0.0): Northings of the origin of the projection (0.0): Enter unit code (2): (metres) Define sample intervals as Eastings Northings (50.0, 50.0): Define output window as Eastings Northings (41372.472, 4285854.342, 51813.705, 4296295.559): Final Projection Data for output DTI file ***************************************** Spheroid : 9 (Airy) Projection : 5 (Mercator) Latitude of true scale : 49 00 00.000N Longitude of the central meridian : 2 00 00.000W Eastings of origin : 0.000 Northings of origin : 0.000 Units : 2 (metres) Local origin : 41372.472 (Eastings) 4285854.342 (Northings) Sample values : 50.000 (Eastings) 50.000 (Northings) ELAPSED: 0 00:02:33.93 CPU: 0:00:40.55 BUFIO: 58 DIRIO: 7 FAULTS: 423
$DTITRANS/NOTRANSFORM/LOG OS44000800 TESTExisting Projection Data for source DTI file: Spheroid : 9 (Airy) Projection : 101 (UK national grid) Units : 2 (metres) Local origin : 440000.000 (Eastings) 80000.000 (Northings) Sample values : 50.000 (Eastings) 50.000 (Northings) Enter projection data for destination DTI file ********************************************** Define sample intervals as Eastings Northings (50.0, 50.0): 30.5 60.5 +----------------------------------------------------------------+ | | | Resampling Matrix Points | | | +----------------------------------------------------------------+ ELAPSED: 0 00:01:27.50 CPU: 0:00:12.20 BUFIO: 105 DIRIO: 14 FAULTS: 341
$DTITRANS/DESCRIPTOR TEST1 Enter projection data for source DTI file ***************************************** Enter spheroid code (0): 9(Airy) Enter projection code (0): 101 ( UK national grid) Enter unit code (2): (metres) Define local origin as Eastings Northings (0.0, 0.0): 440000.0 80000.0 Define sample intervals as Eastings Northings (50.0, 50.0): ELAPSED: 0 00:00:45.14 CPU: 0:00:00.47 BUFIO: 24 DIRIO: 4 FAULTS: 264
$ DTITRANS/LOG/IMAGEMAP=PARAMS.DAT/IFF=TEST SPOT SPOT_RECTIFIEDEnter projection data for destination DTI file ********************************************** Enter spheroid code (0): (Clarke 1866) Enter projection code (0): ( Unset) Enter unit code (2): (metres) Define sample intervals as Eastings Northings (1.0, 1.0): 10 10 Final Projection Data for output DTI file ***************************************** Spheroid : 0 (Clarke 1866) Projection : 0 (Unset) Units : 2 (metres) Local origin : 874031.932 (Eastings) 3170437.401 (Northings) Sample values : 10.000 (Eastings) 10.000 (Northings) %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[LSL.IFF]TEST.IFF;2 opened for write +----------------------------------------------------------------+ | | | Transforming and Resampling Matrix Points | | | +----------------------------------------------------------------+ ELAPSED: 0 00:00:18.08 CPU: 0:00:01.34 BUFIO: 48 DIRIO: 54 FAULTS: 588
$ DTITRANS/RESAMPLE=NINT/WINDOW/LOG/FOUR=SP9800_REC.DAT SP9800 SP_OUTMATRIX module DTITRANS of 15:49:23 20-JUL-90 Define input window as Eastings Northings (0.0, 0.0, 1142.0, 1172.0): Enter projection data for destination DTI file ********************************************** Enter spheroid code (0): 9 (Airy) Enter projection code (0): 101 ( UK national grid) Enter unit code (2): (metres) Define sample intervals as Eastings Northings (1.0, 1.0): Define output window as Eastings Northings (489883.717, 279861.507, 491098.795, 281112.207): 490000 280000 491000 281000 Final Projection Data for output DTI file ***************************************** Spheroid : 9 (Airy) Projection : 101 (UK national grid) Units : 2 (metres) Local origin : 490000.000 (Eastings) 280000.000 (Northings) Sample values : 1.000 (Eastings) 1.000 (Northings) +----------------------------------------------------------------+ | | | Transforming and Resampling Matrix Points | | | +----------------------------------------------------------------+ %100.00 Total of 1002001 matrix points processed ELAPSED: 0 00:05:43.05 CPU: 0:04:31.64 BUFIO: 1055 DIRIO: 936 FAULTS: 3323
See dtitransmsg.html generated from DTITRANSMSG.RNO.