
Public Member Functions | |
| vtElevationGrid () | |
| vtElevationGrid (const vtElevationGrid &rhs) | |
| vtElevationGrid (const DRECT &area, int iColumns, int iRows, bool bFloat, const vtProjection &proj) | |
| virtual | ~vtElevationGrid () |
| vtElevationGrid & | operator= (const vtElevationGrid &rhs) |
| bool | Create (const DRECT &area, int iColumns, int iRows, bool bFloat, const vtProjection &proj) |
| void | FreeData () |
| bool | ConvertProjection (vtElevationGrid *pOld, const vtProjection &NewProj, float bUpgradeToFloat, bool progress_callback(int)=NULL) |
| bool | ReprojectExtents (const vtProjection &proj_new) |
| void | Scale (float fScale, bool bDirect, bool bRecomputeExtents=true) |
| void | ComputeHeightExtents () |
| void | Offset (const DPoint2 &delta) |
| int | ReplaceValue (float value1, float value2) |
| bool | FillGaps (DRECT *area=NULL, bool progress_callback(int)=NULL) |
| bool | FillGapsSmooth (DRECT *area=NULL, bool progress_callback(int)=NULL) |
| bool | LoadFromFile (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFrom3TX (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromASC (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromDEM (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromTerragen (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromCDF (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromDTED (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromGTOPO30 (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromGLOBE (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromGRD (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromDSAA (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromPGM (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromRAW (const char *szFileName, int width, int height, int bytes_per_element, float vertical_units, bool bBigEndian, bool progress_callback(int)) |
| bool | LoadFromMicroDEM (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromXYZ (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromXYZ (FILE *fp, const char *format, bool progress_callback(int)=NULL) |
| bool | LoadFromHGT (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromBT (const char *szFileName, bool progress_callback(int)=NULL, vtElevGridError *err=NULL) |
| bool | LoadBTHeader (const char *szFileName, vtElevGridError *err=NULL) |
| bool | LoadWithGDAL (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | LoadFromNTF5 (const char *szFileName, bool progress_callback(int)=NULL) |
| vtString | GetErrorMsg () |
| bool | SaveTo3TX (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | SaveToGeoTIFF (const char *szFileName) const |
| bool | SaveToBMP (const char *szFileName) const |
| bool | SaveToTerragen (const char *szFileName) const |
| bool | SaveToBT (const char *szFileName, bool progress_callback(int)=NULL, bool bGZip=false) |
| bool | SaveToSTM (const char *szFileName, bool progress_callback(int)=NULL) |
| bool | SaveToPlanet (const char *szDirName, bool progress_callback(int)=NULL) |
| bool | SaveToASC (const char *szFileName, bool progress_callback(int)=NULL) const |
| bool | SaveToVRML (const char *szFileName, bool progress_callback(int)=NULL) const |
| bool | SaveToRAWINF (const char *szFileName, bool progress_callback(int)=NULL) const |
| bool | SaveToPNG16 (const char *fname) |
| void | SetFValue (int i, int j, float value) |
| void | SetValue (int i, int j, short value) |
| short | GetValue (int i, int j) const |
| float | GetFValue (int i, int j) const |
| float | GetFValueSafe (int i, int j) const |
| float | GetClosestValue (const DPoint2 &p) const |
| float | GetFilteredValue (const DPoint2 &p) const |
| const char * | GetDEMName () |
| DRECT | GetAreaExtents () const |
| bool | IsFloatMode () const |
| void | FillWithSingleValue (float fValue) |
| void | GetEarthLocation (int i, int j, DPoint3 &loc) const |
| vtProjection & | GetProjection () |
| const vtProjection & | GetProjection () const |
| void | SetProjection (const vtProjection &proj) |
| bool | GetCorners (DLine2 &line, bool bGeo) const |
| void | SetCorners (const DLine2 &line) |
| short * | GetData () |
| float * | GetFloatData () |
| const short * | GetData () const |
| const float * | GetFloatData () const |
| void | SetScale (float sc) |
| float | GetScale () const |
| bool | HasData () |
| bool | FindAltitudeOnEarth (const DPoint2 &p, float &fAltitude, bool bTrue=false) const |
| virtual float | GetElevation (int iX, int iZ, bool bTrue=false) const |
| virtual void | GetWorldLocation (int i, int j, FPoint3 &loc, bool bTrue=false) const |
| void | SetupConversion (float fVerticalExag=1.0f) |
| float | GetWorldValue (int i, int j, bool bTrue=false) const |
| bool | FindAltitudeAtPoint (const FPoint3 &p3, float &fAltitude, bool bTrue=false, int iCultureFlags=0, FPoint3 *vNormal=NULL) const |
Protected Member Functions | |
| void | ComputeExtentsFromCorners () |
| void | ComputeCornersFromExtents () |
| bool | ParseNTF5 (OGRDataSource *pDatasource, vtString &msg, bool progress_callback(int)) |
| bool | GetXYZLine (const char *buf, const char *pattern, const char *format, int components, double *x, double *y, double *z) |
| bool | _AllocateArray () |
Protected Attributes | |
| bool | m_bFloatMode |
| short * | m_pData |
| float * | m_pFData |
| float | m_fVMeters |
| float | m_fVerticalScale |
| DPoint2 | m_Corners [4] |
| vtProjection | m_proj |
| vtString | m_strOriginalDEMName |
| vtString | m_strError |
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. |
|
|
Copy constructor. |
|
||||||||||||||||||||||||
|
Constructor: Creates a grid of given size.
|
|
|
Destructor |
|
|
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.
|
|
||||||||||||||||||||
|
Initializes an elevation grid by converting the contents of an another grid to a new projection.
|
|
||||||||||||||||||||||||
|
Create a grid of given size.
|
|
||||||||||||
|
Fill the gaps (heixels of value INVALID_ELVATION) in this grid, by interpolating from the valid values. This method uses a simple, unoptimized algorithm to move across the grid, one column at a time, averaging the surrounding pixels to fill each gap.
|
|
||||||||||||
|
Fill the gaps (heixels of value INVALID_ELVATION) in this grid, by interpolating from the valid values. This method attempts to be a little better than FillGaps(), by keeping an entire second grid for the interpolated results on each pass, to avoid some cases of the results getting "smeared" left to right. However, this makes it much slower on most data.
|
|
||||||||||||||||||||||||
|
Simple elevation test for perfectly regular grid terrain. Find altitude (y) and (optionally) surface normal, given (x,z) world coordinates. This approach is very straightforward, so it could be significantly sped up if needed.
Implements vtHeightField3d. |
|
||||||||||||||||
|
Return the elevation value at a given point in earth coordinates.
Implements vtHeightField. |
|
|
Free any memory being used by this class for elevation data. |
|
|
Returns the geographic extents of the *area* covered by grid. |
|
|
Get the height of the grid at a specific world coordinate (nearest neighbor) 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 interpolated height of the grid at a specific world coordinate. This method is generous in allowing points 1/2 grid cell outside the grid. |
|
||||||||||||
|
Get an elevation value from the grid.
|
|
||||||||||||
|
Get an elevation value from the grid.
|
|
|
Get the data size of the grid heixels (height elements): |
|
||||||||||||
|
Loads just the header information from a BT (Binary Terrain) file.
|
|
||||||||||||
|
Loads from a 3TX ascii grid file. Projection is Geo WGS84, extents are always 1 degree in size. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from a Arc/Info compatible ASCII grid file. Projection is read from a corresponding .prj file. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||||||
|
Loads from a BT (Binary Terrain) file.
|
|
||||||||||||
|
Loads from a netCDF file. Elevation values are assumed to be integer meters. Projection is assumed to be geographic. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads elevation from a USGS DEM file. Some non-standard variations of the DEM format are supported. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Helper function for LoadFromGRD, loads from a Surfer ascii grid file (GRD) Projection is always geographic and elevation is floating-point.
|
|
||||||||||||
|
Loads from a DTED file.
|
|
||||||||||||
|
Load from a file whose type is not known a priori. This will end up calling one of the Load* member functions. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from a NOAA GlOBE file. In fact, there is no "GLOBE format", GLOBE files are delivered as raw data, which can be intepreted using a variety of separate header files. Using the GLOBE server "Select Your Own Area" feature results in 2 files, a header with a .hdr extension and data with a .bin extension. This method reads those file. Pass the filename of the .hdr file to this function, and it will automatically look for a corresponding .bin file in the same location. Projection is always geographic and elevation is integer meters. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from a Surfer binary grid file (GRD) GRD does not contain any information about CRS, so the following assumption is made: UTM zone 1. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from a GTOPO30 (or SRTM30) 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. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from an "HGT" file, which is the format used by the USGS SRTM FTP site for their 1-degree blocks of SRTM data. It is simply a raw block of signed 2-byte data, in WGS84 geographic coords. The file will either be: 2,884,802 bytes (for 3 arcsec, 1201*1201) or 25,934,402 bytes (for 1 arcsec, 3601*3601) You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from a MicroDEM format file. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads an elevation grid from an UK Ordnance Survey NTF level 5 file using the OGR library.
|
|
||||||||||||
|
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). You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||||||||||||||||||||||
|
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. You should call SetupConversion() after loading if you will be doing heightfield operations on this grid.
|
|
||||||||||||
|
Loads from an "XYZ file", which is a simple text file containing a set of grid points in the form X,Y,Z - where X and Y are ground coordinates, and Z is elevation. The values may be separated either by commas (X, Y, Z) or by whitespace (X Y Z).
|
|
||||||||||||
|
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.
|
|
|
Offset the entire elevation grid horizontally.
|
|
|
Assignment operator.
|
|
||||||||||||
|
Replace one value with another. For example, replace all heixels of value INVALID_ELEVATION with 0.0.
|
|
|
Reprojects an elevation grid by converting just the extents to a new projection. This is much faster than creating a new grid and reprojecting every heixel, but it only produces correct results when the difference between the projections is only a horizontal shift. For example, this occurs when the only difference between the old and new projection is choice of Datum.
|
|
||||||||||||
|
Writes an Arc/Info compatible ASCII grid file. Projection is written to a corresponding .prj file.
|
|
|
Write the elevation grid to a 8-bit BMP file. Much information is lost, including precision, sign, and geographic location. |
|
||||||||||||||||
|
Writes the grid to a BT (Binary Terrain) file. The current BT format version (1.3) is written.
|
|
|
Write the elevation grid to a 16-bit greyscale GeoTIFF. |
|
||||||||||||
|
Write elevation to the MSI Planet (Marconi) format.
|
|
|
Write elevation a 16-bit greyscale PNG file. |
|
||||||||||||
|
Write elevation to a .raw file along with an .inf file which describes the data for the purpose of exporting to MS Flight Simulator 2004 via their MSFS SDK 'resample' utility.
|
|
||||||||||||
|
Write elevation to the STM (Simple Terrain Model) format created by Michael Garland for his 'Scape' Terrain Simplification software.
|
|
|
Writes the grid to a TerraGen Terrain file.
|
|
||||||||||||
|
Write elevation to a VRML file which contains a single ElevationGrid node.
|
|
||||||||||||||||
|
Scale all the valid elevation values in the grid by a given factor.
|
|
||||||||||||||||
|
Set an elevation value to the grid.
|
|
|
Set up the terrain's coordinate systems, including the conversion from Earth coordinates to the World coordinates of the terrain itself. You should call this method after loading or creating a vtElevationGrid, before using methods on it such as FindAltitudeOnEarth or GetSpacing. For explanation of vtlib/vtdata world coordinates, please see http://vterrain.org/Doc/coords.html
|
| ||||||||||||||||