ReadDted

Synopsis

Reads DTED format GIS data sets.

Parameters

Name Type Description UI Control

Filename string DTED file to read from. File Browser
StartRow int Initial row to read Field Box
StartColumn int Initial column to read Field Box
NumberOfRows int Number of Output Rows to Write (read_dted)
Number of Input Rows to Read (read_dted_alt)
Field Box
NumberOfRows int Number of Output Columns to Write (read_dted)
Number of Input Columns to Read (read_dted_alt)
Field Box
XScaleFactor float Horizontal Scaling Factor Field Box
YScaleFactor float Vertical Scaling Factor Field Box
ActivateFlag int Specifies if output should be updated Toggle

Output Ports

Name Type Description

out_fld Mesh[+Node_Data] output field containing 2D uniform field
out_obj DataObject directly renderable output object

Description

The Digital Terrain Elevation Data (DTED) file format was developed by the National Imagery and Mapping Agency. It stores a uniform matrix of terrain elevation values. This can be used for basic analysis of terrain elevation, slope or surface roughness. The modules in this project allow data in the DTED format to be read into AVS/Express. As DTED files can be very large and can be tiled these modules allow the user to specify which portion of the DTED file should be read and an amount by which it should be scaled. This allows AVS/Express to work solely on the significant data and provides options by which memory problems can be overcome.

Differences between read_dted and read_dted_alt

The modules in this project provide two alternative ways of specifying which portions of the DTED file should be loaded. Both of these alternatives ask the user to specify a rectangular area of the data that should be read. This is done by specifying the start position, width and height of the rectangle. If the rectangular area extends outside of the input data an error will be raised and no data will be loaded. For both alternatives the start position is specified as a coordinate in the coordinate system of the input DTED file. It should be noted that DTED files use a 1-based coordinate system.

The way in which the height and width of the area are specified are different for each alternative macro. The read_dted macro asks the user to specify the desired width and height of the output uniform scalar field. The macro then uses the scaling factor to calculate the width and height of desired area in input file coordinates. Conversely the read_dted_alt macro asks the user to specify the desired width and height of the area in the input file. The scaling factor is then used to calculate width and height of the output uniform scalar field.

These two alternative method are provided so that the project can be easily used in many application areas. This project was supplied to the IAC by a third party and initially only allowed the output width and height to be specified. Although this may appear to be a strange way of operating, in GIS applications several data tiles may have to be combined together and this is easier if the output size is fixed. However it was felt that in other applications this way of working would be counter-intuitive. Therefore the second, alternative method was added.

If this system appears over-complicated a few rules should be remembered. If no scaling is to be performed then it does not matter which method is used as the width and height of the input will equal the width and height of the output. If the read_dted macro is used changing the scaling factors will change the amount of input data read in. If the read_dted_alt module is used changing the scaling factors will change the size of the output field.

Notes on Scaling

The ReadDted modules do allow data to be scaled up or down. However it should be noted that this is done very simply. If data is scaled up values are replicated. If data is scaled down values are discarded. No attempt is made to reduce errors by interpolating between data points. If other forms of scaling are required the data should be read in with scaling factors of one, and an appropriate Express module should be used to scale the data. However if memory usage is a major concern you may wish to use the ReadDted scaling. The ReadDted module scales the data as it is read in. Hence if data is being scaled down significant amounts of memory may be saved.

Parameters

Filename

The name of the DTED format file that should be read. The string should be the fully qualified name of the file. AVS/Express environment variables can be used. If the file does not have an extension of dt0, dt1 or dt2 then an extension of dt1 is added.

StartRow StartColumn

These integer parameters specify the starting position of the rectangular area read from the input data. The starting position is specified in relation to the top left of input data. Since the coordinate system is one-based the origin of the input data coordinate system is at {1,1}. If no values are specified for these parameters they will default to the origin.

read_dted : NumberOfRows NumberOfColumns

These integer parameters specify the width and height of the output uniform scalar field. If no values are specified for these parameters they will be set so that all rows and columns are read from the DTED file.

read_dted_alt : NumberOfRows NumberOfColumns

These integer parameters specify the width and height of the rectangular area read from the input DTED file. If no values are specified for these parameters they will be set so that all rows and columns are read from the DTED file.

XScaleFactor YScaleFactor

These floating point parameters specify the amount by which the input data should be scaled to give the output field. In both forms of the ReadDted macro the scaling factor is specified as the scaling factor from the input data to the output Express field.

ActivateFlag

This integer parameter allows the user to control whether the ReadDted module responds to updates. If the parameter is set to zero the module does not respond to any changing parameters. If the parameter is set to any other value the module responds as normal. By using this parameter the user can setup the various positioning options without having to repeatedly reload the data file.

Output Ports

out_fld

The output field is a 2D uniform scalar field containing node data of type short.

out_obj

The GDobject version of the output, suitable for direct connection to the viewer.

Utility Macros

The ReadDtedCore low-level module contains references to all the procedural code used by this project. The ReadDtedCoreAlt low-level module is a modified version of the ReadDtedCore module that adjusts the module parameters by using V code only. Both of these modules use the same parameter block i.e. ReadDtedParams.

The Functional macro, Read_Dted, uses the ReadDtedCore module. The User macro, read_dted, uses this macro and the User Interface macro, Read_Dted_UI. The alternative versions of these macros modify the originals so that they use the appropriate alternative component. More detailed information on the structure of these macros can be found in the dtedmacs.v file.

Example

The example application ReadDtedEg is provided. This application demonstrates how to use both the read_dted and read_dted_alt macros. The same DTED file is read by both macros and the output fields displayed in two separate windows. By using the user interfaces of the macros the differences in behaviour of the normal and alternative macros should be visible.

Other Notes

The low-level ReadDtedMods library containing the low-level module ReadDtedCore does not specify a process. By default the express process will be used.

Files

iac_proj/rd_dted/dtedmods.v contains the V definitions of the ReadDtedCore and ReadDtedCoreAlt modules, and the ReadDtedParams parameter block.

iac_proj/rd_dted/dtedmacs.v contains the V definitions of the Read_Dted_UI and Read_Dted_UI_Alt User Interface macros, the Read_Dted and Read_Dted_Alt Functional macros, the read_dted and read_dted_alt User macros and the ReadDtedEg example application.

Author

Steve Walker, AVS Inc.
Andrew Dodd, International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

N/A