1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
5 * Tecorrec is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * Tecorrec is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with Tecorrec. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _tcSrtmData_h_
21 #define _tcSrtmData_h_
25 * @brief Block of raw SRTM elevation data.
37 /// Block of raw SRTM elevation data.
38 class tcSrtmData
: public QObject
45 * Constructors + destructor
49 * @param lon Longitude in degrees.
50 * @param lat Latitude in degrees.
51 * @param file File to read data from.
53 tcSrtmData(int lon
, int lat
, QFile
& file
, QObject
* progressObj
, const char* progressMember
);
56 virtual ~tcSrtmData();
62 /// Get the longitude in degrees.
65 /// Get the latitude in degrees.
68 /// Get the number of scan lines.
71 /// Get the number of samples in each scan line.
74 /// Find the geographical angles between samples.
75 tcGeo
sampleResolution() const;
77 /// Get the geographical coordinate of a sample.
78 tcGeo
sampleCoordinate(int line
, int sample
) const;
80 /// Does data exist for a sample?
81 bool sampleExists(int line
, int sample
) const;
83 /// Get the altitude at a sample (interpolating gaps).
84 uint16_t sampleAltitude(int line
, int sample
, bool corrected
= false, bool* exists
= 0) const;
86 /// Get the altitude at a coordinate.
87 float sampleAltitude(const tcGeo
& coord
, bool corrected
= false, bool* exists
= 0) const;
93 /// Correct the altitude at a sample.
94 void setSampleAltitude(int line
, int sample
, uint16_t altitude
);
96 /// Fill voids using bilinear interpolation.
97 void fillVoidsBilinear();
99 /// Fill voids using bicubic interpolation.
100 void fillVoidsBicubic();
108 /// Process notifier.
109 void progressing(const QString
& message
);
117 /// Index into the data array.
118 unsigned int indexData(int corrected
, int line
, int sample
) const;
126 /// Longitude in degrees.
129 /// Latitude in degrees.
132 /// Number of scan lines.
135 /// Number of samples per scan line.
138 /** Fixed resolution elevation data.
139 * Indexed by correction, scanline, sample.
140 * Most significant bit means that original data is missing.