37 static ossimTrace traceDebug(
"ossimUsgsDemTileSource:debug");
39 static const char DEM_TYPE_KW[] =
"dem_type";
40 static const char USGS_DEM_KW[] =
"usgs_dem";
180 T* d =
static_cast<T*
>(tile->
getBuf());
183 if (spatialResZ == 0.0) spatialResZ = 1.0;
187 clip_rect.
ul().
x - tile_rect.
ul().
x;
201 d[offset + samp_offset] =
static_cast<T
>(p);
204 offset += TILE_WIDTH;
221 static const char MODULE[] =
"ossimUsgsDemTileSource::open";
236 std::ios_base::in | std::ios_base::binary);
286 CLOG << setiosflags(ios::fixed) << setprecision(5) <<
"DEBUG:" 300 const char* prefix)
const 303 kwl.
add(prefix, DEM_TYPE_KW, USGS_DEM_KW,
true);
323 const char* lookup = kwl.
find(prefix, DEM_TYPE_KW);
341 getEntryNumber(lookup));
351 <<
"ossimUsgsDemTileSource::loadState WARNING:" 352 <<
"\nInvalid scalar type: " 416 <<
"ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:" 429 <<
"ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:" 430 <<
"keyword list:\n" << proj_kwl
437 createProjection(proj_kwl);
466 if (reduced_res_level == 0)
483 if (reduced_res_level == 0)
552 return (
theDem ?
true :
false );
ossimScalarType theScalarType
This can be either OSSIM_SINT16 or OSSIM_FLOAT32.
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
virtual ossimString getShortName() const
static ossimImageGeometryRegistry * instance()
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
Initializes theGeometry from USGS DEM header.
ossimRefPtr< ossimImageGeometry > theGeometry
ossim_float64 theMinHeight
virtual bool open()
Returns true if the "theImageFile can be opened.
virtual const ossim_float64 * getMaxPix() const
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
virtual ossim_uint32 getNumberOfBands() const
ossimFilename theImageFile
virtual ossim_uint32 getTileHeight() const
Returns the height of the output tile.
virtual void setImageRectangle(const ossimIrect &rect)
const ossimUsgsDemTileSource & operator=(const ossimUsgsDemTileSource &rhs)
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
std::basic_ifstream< char > ifstream
Class for char input file streams.
const char * find(const char *key) const
#define OSSIM_DEFAULT_NULL_PIX_SINT16
ossimRefPtr< ossimImageData > theTile
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
const ossimIpt & ul() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
bool intersects(const ossimIrect &rect) const
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
virtual bool extendGeometry(ossimImageHandler *handler) const
virtual void initialize()
Initialize the data buffer.
void ref() const
increment the reference count by one, indicating that this object has another pointer which is refere...
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
bool completely_within(const ossimIrect &rect) const
virtual ossim_uint32 getTileWidth() const
Returns the width of the output tile.
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimString getLongName() const
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
virtual void setNullPix(ossim_float64 null_pix)
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
static ossimImageDataFactory * instance()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static bool isUsgsDem(const ossimFilename &file)
Does basic sanity checks to see if file is a dem.
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual ossimIrect getImageRectangle() const
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
const ossimIpt & lr() const
static ossimString downcase(const ossimString &aString)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
ossimIrect clipToRect(const ossimIrect &rect) const
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of lines in the image.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of samples in the image.
void unref() const
decrement the reference count by one, indicating that a pointer to this object is referencing it...
static ossimProjectionFactoryRegistry * instance()
virtual const ossim_float64 * getMinPix() const
long read(ossim::istream &dem, bool incrementalRead=false)
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual void makeBlank()
Initializes data to null pixel values.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
virtual void completeOpen()
Will complete the opening process.
ossimImageMetaData theMetaData
ossimRefPtr< ossimImageHandler > theOverview
virtual void setMaxPix(ossim_float64 max_pix)
This class defines an abstract Handler which all image handlers(loaders) should derive from...
bool fillBuffer(T, const ossimIrect &tile_rect, const ossimIrect &clip_rect, ossimImageData *tile)
Returns true on success, false on error.
ossim_float64 theNullValue
virtual const void * getBuf() const
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
static const char * SCALAR_TYPE_KW
ossimDemHeader const & getHeader() const
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in...
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
#define RTTI_DEF1(cls, name, b1)
virtual ~ossimUsgsDemTileSource()
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Override base-class method to make sure the internal geometry is explored before extending.
ossim_float64 theMaxHeight
ossim_float32 getElevation(long x, long y) const
virtual void setMinPix(ossim_float64 min_pix)
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.