/usr/include/ossim/imaging/ossimDtedElevationImageSource.h is in libossim-dev 1.7.21-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | //----------------------------------------------------------------------------
// Copyright (C) 2005 David Burken, all rights reserved.
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: David Burken
//
// Description:
//
// Contains class declaration of ossimDtedElevationImageSource.
//
// $Id: ossimDtedElevationImageSource.h 9094 2006-06-13 19:12:40Z dburken $
//----------------------------------------------------------------------------
#ifndef ossimDtedElevationImageSource_HEADER
#define ossimDtedElevationImageSource_HEADER
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/base/ossimFilename.h>
#include <ossim/base/ossimGrect.h>
// Forward class declarations.
class ossimImageData;
class ossimImageChain;
class ossimDtedTileSource;
class ossimConnectableObject;
class ossimMapProjection;
class ossimIrect;
/**
* Class to return large area blocks of data as an ossimImageData object from
* multiple dted cells. Source dted cells must be of the same resolution and
* in the standard dted directory stucture.
*
* Example directory structure:
*
* dted_level2_directory
* / \
* / \
* w099 w100
* / \ / \
* / \ / \
* n32.dt2 n33.dt2 n32.dt2 n33.dt2
*/
class OSSIMDLLEXPORT ossimDtedElevationImageSource
{
public:
enum ResamplerType
{
NEAREST_NEIGHBOR = 0,
BILINEAR = 1
};
/**
* Default constructor
*/
ossimDtedElevationImageSource();
/**
* Destructor
*/
virtual ~ossimDtedElevationImageSource();
/**
* @param rect Requested rectangle.
*
* @param lines Number of lines. This will determine the
* post spacing in the latitude direction.
*
* @param samples Number of samples. This will determine the post spacing
* in the longitude direction.
*/
ossimRefPtr<ossimImageData> getBlock(const ossimGrect& rect,
ossim_uint32 lines,
ossim_uint32 samples) const;
/**
* @param directory Directory to search for dted cells.
*
* @note Directory should be in a standard dted format.
*
* @note All cells in the directory should be of same resolution.
*/
void setDirectory(const ossimFilename& directory);
/**
* @param directory Will be initialized to the current dted directory.
*/
void getDirectory(ossimFilename& directory) const;
/**
* @param ext Should be the extension of cells in the directory like
* "dt1", "dt2".
*
* @note All cells in the directory should have same extension.
*/
void setCellExtension(const ossimString& ext);
/**
* @param ext Will be initialized to the current cell extension.
*/
void getCellExtension(ossimString& ext) const;
/**
* @param type Enumerated resampler type.
*/
void setResamplerType(ossimDtedElevationImageSource::ResamplerType type);
/**
* @return Resampler type.
*/
ossimDtedElevationImageSource::ResamplerType getResamplerType() const;
private:
/**
* Finds all cells in "theDirectory" for rectangle passed in.
*
* @param rect Rectangle of requested elevation block.
*
* @param vf Vector of ossimFilenames to initialize with cells that are
* present and overlap rect.
*
* @note vf will be cleared upon entring this method, so if vf.empty() is
* true than no cells were found.
*/
void findCells(const ossimGrect& rect,
vector<ossimFilename>& vf) const;
/**
* Main resample method.
*
* @param rect Rectangle of requested elevation block.
*
*/
void resampleCell(const ossimGrect& rect,
const ossimFilename& dtedFile,
ossimImageData& id,
const ossimDpt& postSpacing) const;
/**
* Specialized resample method. Uses ossimDtedHandler and its
* getHeightAboveMSL method to fill rect.
*/
void resampleCellBilinear(const ossimGrect& rect,
const ossimFilename& dtedFile,
ossimImageData& id,
const ossimDpt& postSpacing) const;
/**
* Specialized resample method. Uses ossimDtedTileSource to fill a patch,
* then resamples to post spacing using nearest neighbor.
*/
void resampleCellNearestNeighbor(const ossimGrect& rect,
const ossimFilename& dtedFile,
ossimImageData& id,
const ossimDpt& requestedPostSpacing)const;
/**
* @param rect Ground rectangle.
*
* @param lines Number of desired lines in latitude direction.
*
* @param samples Number of desired samples in the longitude direction.
*
* @param result
* result.y = (rect.ul().latd - rect.ll().latd) / lines
* result.x = (rect.lr().lond - rect.ll().lond) / samples
*/
void getPostSpacing(const ossimGrect& rect,
ossim_uint32 lines,
ossim_uint32 samples,
ossimDpt& result) const;
/**
* Aligns clip rect to requested rect with respect to post spacing.
*/
void snap(const ossimGrect& rect,
const ossimDpt& postSpacing,
ossimGrect& clipRect) const;
/**
* @return The index for gpt into id's buf. If point does not intersect
* the rectangle an "OSSIM_UINT_NAN" is returned.
*/
ossim_uint32 computeIndex(const ossimImageData& id,
const ossimGrect& idRect,
const ossimGpt& gpt,
const ossimDpt& postSpacing) const;
/**
* @return Returns the rLevel that is equal to, or greater than the
* requestedPostSpacing.
*/
ossim_uint32 computeRLevel(ossim_uint32 numberOfRLevels,
const ossimDpt& requestedPostSpacing,
const ossimDpt& cellPostSpacing) const;
ossimConnectableObject* createRawChain(const ossimFilename& file) const;
ossimImageChain* createMosaic(
const std::vector<ossimFilename>& inputs) const;
ossimImageChain* createMosaic(
const std::vector<ossimConnectableObject*>& inputs) const;
ossimMapProjection* getView(ossimConnectableObject* container) const;
void computeImageRect(const ossimMapProjection* view,
const ossimGrect& grect,
ossimIrect& irect) const;
ossimFilename theDirectory;
ossimString theCellExtension;
ResamplerType theResamplerType;
};
#endif /* End of #ifndef ossimDtedElevationImageSource_HEADER */
|