#include <ElevationGrid.h>
Public Methods | |
| vtElevationGrid () | |
| vtElevationGrid (DRECT area,int iColumns,int iRows,bool bFloat,vtProjection proj) | |
| ~vtElevationGrid () | |
| bool | ConvertProjection (vtElevationGrid *pOld,vtProjection &NewProj,void progress_callback(int)=NULL) |
| bool | LoadFromDEM (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromASC (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromTerragen (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromCDF (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromDTED (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromGTOPO30 (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromGRD (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromPGM (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadFromRAW (const char *szFileName,int width,int height,int bytes_per_element,float vertical_units) |
| bool | LoadFromBT (const char *szFileName,void progress_callback(int)=NULL) |
| bool | LoadBTHeader (FILE *fp) |
| bool | LoadWithGDAL (const char *szFileName,void progress_callback(int)) |
| void | SaveToTerragen (FILE *fp) |
| void | SaveToBT (FILE *fp) |
| void | ComputeHeightExtents () |
| void | GetHeightExtents (float &fMinHeight,float &fMaxHeight) |
| void | GetDimensions (int &nColumns,int &nRows) |
| DPoint2 | GetSpacing () |
| bool | ContainsPoint (float x,float y) |
| void | SetFValue (int i,int j,float value) |
| void | SetValue (int i,int j,short value) |
| int | GetValue (int i,int j) |
| float | GetFValue (int i,int j) |
| float | GetClosestValue (double x,double y) |
| float | GetFilteredValue (double x,double y) |
| char* | GetDEMName () |
| DRECT& | GetGridExtents () |
| DRECT | GetAreaExtents () |
| void | SetGridExtents (DRECT &ext) |
| bool | IsFloatMode () |
| void | ColorDibFromElevation1 (vtDIB *pDIB,RGBi color_ocean) |
| vtProjection& | GetProjection () |
| void | GetCorners (DLine2 &line,bool bGeo) |
| void | SetCorners (DLine2 &line) |
Protected Methods | |
| void | ComputeExtentsFromCorners () |
| void | ComputeCornersFromExtents () |
Protected Attributes | |
| DRECT | m_area |
| int | m_iColumns |
| int | m_iRows |
| bool | m_bFloatMode |
| short* | m_pData |
| float* | m_pFData |
| DPoint2 | m_Corners [4] |
| vtProjection | m_proj |
Height elements ("heixels") can be either integer (2 bytes) or floating point (4 bytes). Heixel values are always in meters. Areas of unknown elevation are represented by the value INVALID_ELEVATION.
To load a grid from a file, first create an empty grid, then call the appropriated Load method.
|
|
Constructor: Creates an empty grid. |
|
|
Constructor: Creates a grid of given size.
|
|
|
Destructor |
|
|
Use the height data in the grid to fill a bitmap with a shaded color image.
|
|
|
For a grid whose absolute extents are known, use those extents to imply the 4 corners coordinates. |
|
|
For a grid whose 4 corners coordinates are known, use those corners to imply absolute extents. |
|
|
Scans the grid to compute the minimum and maximum height values.
|
|
|
Test if a point is within the extents of the grid. |
|
|
Initializes an elevation grid by converting the contents of an another grid to a new projection.
|
|
|
Return geographic extents of the *area* covered by grid. |
|
|
Get the height of the grid at a specific world coordinate. The value of the gridpoint closest to the specified location is returned. If the location is not within the extents of the grid, INVALID_ELEVATION is returned.
|
|
|
Return the embedded name of the DEM is it has one |
|
|
Get the grid size of the grid. The values are placed into the arguments by reference.
|
|
|
Get an elevation value from the grid.
|
|
|
Get the interpolated height of the grid at a specific world coordinate. The value is linearly interpolated between the surrounding gridpoints. If the location is not within the extents of the grid, INVALID_ELEVATION is returned.
|
|
|
Return geographic extents of the grid. |
|
|
Gets the minimum and maximum height values. The values are placed in the arguments by reference. You must have first called ComputeHeightExtents. |
|
|
Get the grid spacing, the width of each column and row. |
|
|
Get an elevation value from the grid.
|
|
|
Get the data size of the grid: |
|
|
Loads just the header information from a BT (Binary Terrain) file. This can be useful if you want to check the information such as the size of the data, without reading the entire file.
|
|
|
Loads from a Arc/Info compatible ASCII grid file. Projection is read from a corresponding .prj file.
|
|
|
Loads from a BT (Binary Terrain) file. Both the current version (1.1) and older BT versions are supported.
|
|
|
Loads from a netCDF file. Elevation values are assumed to be integer meters. Projection is assumed to be geographic.
|
|
|
Loads elevation from a USGS DEM file. If the data from DEM is in meters, then values are stored as shorts. If DEM data is in feet, then height data will be stored in float, to preserve the precision of the original data. Some non-standard variations of the DEM format are supported.
|
|
|
Loads from a DTED file. Should support DTED0, DTED1 and DTED2 files, although it has only been tested on DTED0. Projection is assumed to be geographic and elevation is integer meters.
|
|
|
Loads from a Surfer binary grid file (GRD) Projection is always geographic and elevation is floating-point.
|
|
|
Loads from a GTOPO30 file. GTOPO30 files are actually composed of at least 2 files, a header with a .hdr extension and data with a .dem extension. Pass the filename of the .hdr file to this function, and it will automatically look for a corresponding .dem file in the same location. Projection is always geographic and elevation is integer meters.
|
|
|
Loads from a PGM (Portable Gray Map) file. Both PGM Binary and ASCII varieties are supported. PGM does not contain any information about geographic location, so the following assumptions are made: UTM coordinates, 1-meter spacing, origin at (0,0).
|
|
|
Loads from a RAW file (a naked array of elevation values). The file will not contain any information about at all about data size, data type, or projection, so this information must be passed in as arguments.
|
|
|
Loads from a Terragen Terrain file.
|
|
|
Loads an elevation grid using the GDAL library. The GDAL library supports a very large number of formats, including SDTS-DEM. See http://www.remotesensing.org/gdal/formats_list.html for the complete list of GDAL-supported formats.
|
|
|
Writes the grid to a BT (Binary Terrain) file. The current BT format version (1.1) is written.
|
|
|
Writes the grid to a TerraGen Terrain file.
|
|
|
Set an elevation value to the grid.
|
|
|
Set the geographic extents of the grid. |
|
|
Set an elevation value to the grid.
|
1.2.4 written by Dimitri van Heesch,
© 1997-2000