28 static ossimTrace traceDebug(
"ossimElevImage:debug");
77 theLatSpacing(latSpacing),
78 theLonSpacing(lonSpacing),
79 theNumberOfLines(numberLines),
80 theNumberOfSamps(numberSamples)
126 if( (w != tileW) || (h != tileH) )
130 if((w*h)!=(tileW*tileH))
161 cerr <<
"ossimElevImageSource::getTile ERROR:\nOverviews not supported!" 190 clip_rect.
ul().
x - tile_rect.
ul().
x;
198 (clip_rect.
lr().
y - image_rect.
ul().
y);
199 if (start_lat < -90.0)
201 start_lat = -(start_lat + 180.0);
205 (clip_rect.
ul().
x - image_rect.
ul().
x);
218 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
220 double lat = start_lat;
228 if (lat > 90) lat = 180.0 - lat;
230 offset -= tile_width;
234 if (lon > 180.0) lon = lon - 360.0;
240 double lon = start_lon;
241 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
246 if (start_lon > 180.0)
254 if (lat < -90.0) lat = -(lat + 180.0);
263 const char* prefix)
const 265 static const char MODULE[] =
"ossimElevImageSource::saveState";
270 <<
" ERROR detected in keyword list! State not saved." 327 static const char MODULE[] =
"ossimElevImageSource::loadState";
332 <<
" ERROR detected in keyword list! State not load." 353 <<
"\nRequired keyword not found: " 355 <<
"\nReturning false" 372 <<
"\nRequired keyword not found: " 374 <<
"\nReturning false" 392 <<
"\nRequired keyword not found: " 394 <<
"\nReturning false" 411 <<
"\nRequired keyword not found: " 413 <<
"\nReturning false" 431 <<
"\nRequired keyword not found: " 433 <<
"\nReturning false" 450 <<
"\nRequired keyword not found: " 452 <<
"\nReturning false" 496 static const char MODULE[] =
"ossimElevImageSource::initialize";
498 if (traceDebug())
CLOG <<
" Entered..." << endl;
508 cerr << MODULE <<
"ERROR:\nNULL elevation manager pointer!" 509 <<
"\nObject not initialized!" << endl;
518 cerr << MODULE <<
"ERROR:" 519 <<
"\nMust set latitude/longitude spacing and number of line and" 521 <<
"Object not initialized!" << endl;
531 cerr << MODULE <<
"ERROR:\nBogus tie point." 532 <<
"\nObject not initialized!" << endl;
559 cout <<
"Initializing elevation manager..." << endl;
563 time_t start_t = time(NULL);
568 if (lat < -90.0) lat = -(lat + 180.0);
576 if (lat > 90) lat = 180 - lat;
580 if (lon > 180.0) lon -= 360.0;
582 time_t stop_t = time(NULL);
583 cout <<
"Finished loop two..." << endl;
584 cout <<
"Elapsed time for loop two: " << (stop_t - start_t) << endl;
608 if (reduced_res_level != 0)
610 cerr <<
"ossimElevImageSource::getImageRectangle ERROR:" 611 <<
"\nOnly R0 is supported." << endl;
639 cerr <<
"ossimElevImageSource::getDecimationFactor ERROR:" 640 <<
"\nReduced res sets currently not supported!" 652 decimations.push_back(pt);
688 cout <<
"ossimElevImageSource::changeTileSize DEBUG:" 689 <<
"\nx size: " <<
size.x
690 <<
"\ny size: " <<
size.y
696 cerr <<
"ossimElevImageSource::changeTileSize ERROR:" 697 <<
"\nObject not initialized! Returning..." << endl;
715 if (reduced_res_level)
717 cerr <<
"ossimElevImageSource::getNumberOfLines ERROR:" 718 <<
"\nReduced res sets currently not supported!" 728 if (reduced_res_level)
730 cerr <<
"ossimElevImageSource::getNumberOfSamples ERROR:" 731 <<
"\nReduced res sets currently not supported!" 743 cerr <<
"ossimElevImageSource::getMinPixelValue ERROR:" 744 <<
"\nReduced res sets currently not supported!" 765 cerr <<
"ossimElevImageSource::getMaxPixelValue ERROR:" 766 <<
"\nReduced res sets currently not supported!" 790 cout <<
"ossimElevImageSource::setMinPixelValue DEBUG:" 791 <<
"\nMin pixel value: " << min_pix
797 cerr <<
"ossimElevImageSource::setMinPixelValue ERROR:" 798 <<
"\nObject not initialized!" 810 cout <<
"ossimElevImageSource::setMaxPixelValue DEBUG:" 811 <<
"\nMax pixel value: " << max_pix
817 cerr <<
"ossimElevImageSource::setMinPixelValue ERROR:" 818 <<
"\nObject not initialized!" virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
static const char * MIN_VALUE_KW
ossim_uint32 theNumberOfSamps
virtual double getHeightAboveMSL(const ossimGpt &)=0
Height access methods:
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
virtual const ossim_float64 * getMaxPix() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
ossimRefPtr< ossimImageData > theTile
double lond() const
Will convert the radian measure to degrees.
Represents serializable keyword/value map.
virtual void changeTileSize(const ossimIpt &size)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const ossimErrorCode OSSIM_OK
virtual ossim_uint32 getNumberOfInputBands() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const char * find(const char *key) const
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
static const char * MAX_VALUE_KW
ossim_uint32 height() const
static const char * NUMBER_LINES_KW
static const char * TIE_POINT_LON_KW
ossim_float64 theLonSpacing
const ossimIpt & ul() const
virtual ossim_uint32 getHeight() const
static const ossimErrorCode OSSIM_ERROR
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
bool intersects(const ossimIrect &rect) const
virtual void getDecimationFactors(vector< ossimDpt > &decimations) const
double latd() const
Will convert the radian measure to degrees.
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void setHeight(ossim_uint32 height)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
virtual ossimDataObjectStatus validate() const
virtual void initialize()
ossimElevSource * theElevManager
unsigned int ossim_uint32
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
unsigned long toULong() const
virtual void setWidth(ossim_uint32 width)
ossim_uint32 theNumberOfLines
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
const ossimIpt & lr() const
ossim_uint32 width() const
ossimIrect clipToRect(const ossimIrect &rect) const
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
virtual double getMinHeightAboveMSL() const
Access methods for the bounding elevations:
virtual void setOrigin(const ossimIpt &origin)
virtual const ossim_float64 * getMinPix() const
virtual ~ossimElevImageSource()
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
ConnectableObjectList theInputObjectList
Holds a list of input objects.
virtual void setMaxPixelValue(ossim_float64 max_pix)
virtual void setMaxPix(ossim_float64 max_pix)
virtual ossimErrorCode getErrorStatus() const
virtual double getMaxHeightAboveMSL() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual const void * getBuf() const
virtual void setErrorStatus() const
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.
static const char * TIE_POINT_LAT_KW
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
#define RTTI_DEF1(cls, name, b1)
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
bool theOutputListIsFixedFlag
Indicates whether the theOutputObjectList is fixed.
virtual ossim_uint32 getNumberOfDecimationLevels() const
Will return the number of resolution levels.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void setMinPix(ossim_float64 min_pix)
virtual void setMinPixelValue(ossim_float64 min_pix)
static const char * NUMBER_SAMPLES_KW
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossim_float64 theLatSpacing