OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimUsgsDemTileSource Class Reference

#include <ossimUsgsDemTileSource.h>

Inheritance diagram for ossimUsgsDemTileSource:
ossimImageHandler ossimImageSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimUsgsDemTileSource ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual bool open ()
 Returns true if the "theImageFile can be opened. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands in the image. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 reduced_res_level=0) const
 Returns the number of lines in the image. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 reduced_res_level=0) const
 Returns the number of samples in the image. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Retuns the min pixel value. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
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. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the width of the output tile. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the height of the output tile. More...
 
virtual ossim_uint32 getImageTileWidth () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual bool isOpen () const
 Derived classes must implement this method to be concrete. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Override base-class method to make sure the internal geometry is explored before extending. More...
 
- Public Member Functions inherited from ossimImageHandler
 ossimImageHandler ()
 Constructor (default): More...
 
virtual ~ossimImageHandler ()
 Destructor: Derived classes should implement. More...
 
virtual void initialize ()
 initialize Does nothing in this class. More...
 
virtual bool openOverview ()
 Searches for an overview. More...
 
virtual bool openOverview (const ossimFilename &overview_file)
 Calls closeOverview(), then attempts to open the overview_file. More...
 
virtual void closeOverview ()
 If theOverview is initialized it will be deleted and set to NULL. More...
 
virtual const ossimImageHandlergetOverview () const
 
virtual bool hasOverviews () const
 
virtual ossimFilename createDefaultOverviewFilename () const
 
virtual ossimFilename createDefaultGeometryFilename () const
 
virtual ossimFilename createDefaultMetadataFilename () const
 
virtual ossimFilename createDefaultHistogramFilename () const
 
virtual ossimFilename createDefaultValidVerticesFilename () const
 
virtual bool writeValidImageVertices (const std::vector< ossimIpt > &vertices, const ossimFilename &file=ossimFilename(""))
 Outputs vertices to file and updates the internal vertex array variable "theValidImageVertices". More...
 
virtual bool openValidVertices (const ossimFilename &vertices_file)
 Opens the valid image vertices file and sets theValidImageVerticesFile variable. More...
 
virtual bool openValidVertices ()
 Creates vertices file name based on image, then tries to open. More...
 
virtual bool open (const ossimFilename &imageFile, ossim_uint32 entryIndex)
 Opens the image file. More...
 
virtual bool open (const ossimFilename &imageFile)
 
virtual bool open (std::shared_ptr< ossim::ImageHandlerState > state)
 
virtual void close ()
 Deletes the overview and clears the valid image vertices. More...
 
virtual bool buildHistogram (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histogram for image file. More...
 
virtual bool buildAllHistograms (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histograms for all image entries. More...
 
virtual bool buildOverview (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for theImageFile. More...
 
virtual bool buildAllOverviews (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for all image entries. More...
 
virtual bool buildOverview (const ossimFilename &filename, ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build an over file for filename. More...
 
ossimRefPtr< ossimMultiResLevelHistogramgetImageHistogram () const
 Fetches the current entry image's histogram. More...
 
virtual void setImageGeometry (ossimImageGeometry *geom)
 Sets the image geometry object. More...
 
virtual void saveImageGeometry () const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 This returns all decimation for all levels. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 This returns the total number of decimation levels. More...
 
virtual ossim_uint32 getNumberOfReducedResSets () const
 This method is obsolete. More...
 
virtual void setFilename (const ossimFilename &filename)
 Sets the filename. More...
 
virtual const ossimFilenamegetFilename () const
 Returns the filename. More...
 
virtual bool isValidRLevel (ossim_uint32 resLevel) const
 Determines if the passed in reslution level is valid. More...
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 Connection rule. More...
 
virtual void getValidImageVertices (vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual bool isBandSelector () const
 Indicates whether or not the image handler can control output band selection via the setOutputBandList method. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &band_list)
 If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled. More...
 
virtual bool setOutputToInputBandList ()
 If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity. More...
 
virtual bool isIdentityBandList (const std::vector< ossim_uint32 > &bandList) const
 Convenience method to see if band list is identity. More...
 
virtual bool isImageTiled () const
 Indicates whether or not the image is tiled internally. More...
 
virtual bool hasMetaData () const
 
virtual ossimRefPtr< ossimNBandLutDataObjectgetLut () const
 
virtual bool hasLut () const
 
virtual void loadMetaData ()
 There is an external file with an omd extension. More...
 
virtual void setMinPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set min pixel value. More...
 
virtual void setMaxPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set max pixel value. More...
 
virtual void setNullPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set null pixel value. More...
 
virtual ossim_uint32 getCurrentEntry () const
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual void getEntryNames (std::vector< ossimString > &entryNames) const
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
ossimFilename getFilenameWithThisExtension (const ossimString &ext, bool set_e0_prefix=false) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 Initializes theGeometry from USGS DEM header. More...
 
virtual ~ossimUsgsDemTileSource ()
 
const ossimUsgsDemTileSourceoperator= (const ossimUsgsDemTileSource &rhs)
 
 ossimUsgsDemTileSource (const ossimUsgsDemTileSource &)
 
template<class T >
bool fillBuffer (T, const ossimIrect &tile_rect, const ossimIrect &clip_rect, ossimImageData *tile)
 Returns true on success, false on error. More...
 
void gatherStatistics ()
 
- Protected Member Functions inherited from ossimImageHandler
virtual ossimRefPtr< ossimImageGeometrygetExternalImageGeometry () const
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual bool getOverviewTile (ossim_uint32 resLevel, ossimImageData *result)
 Method to get an overview tile. More...
 
bool initVertices (const char *file)
 Opens file and attempts to initialize the valid image vertices. More...
 
virtual void completeOpen ()
 Will complete the opening process. More...
 
void initImageParameters (ossimImageGeometry *geom) const
 Convenience method to set things needed in the image geometry from the image handler. More...
 
virtual void establishDecimationFactors ()
 Virtual method determines the decimation factors at each resolution level. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &inBandList, std::vector< ossim_uint32 > &outBandList)
 Convenience method to set output band list. More...
 
void getFilenameWithNoExtension (ossimFilename &f) const
 Get filename with no extension, using supplentary directory for dirname if set. More...
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

ossimDemGridtheDem
 
ossimRefPtr< ossimImageDatatheTile
 
ossim_float64 theNullValue
 
ossim_float64 theMinHeight
 
ossim_float64 theMaxHeight
 
bool theFeetFlag
 
bool theIsDemFlag
 
ossimScalarType theScalarType
 This can be either OSSIM_SINT16 or OSSIM_FLOAT32. More...
 
- Protected Attributes inherited from ossimImageHandler
ossimFilename theImageFile
 
ossimFilename theOverviewFile
 
ossimFilename theSupplementaryDirectory
 
ossimRefPtr< ossimImageHandlertheOverview
 
vector< ossimIpttheValidImageVertices
 
ossimImageMetaData theMetaData
 
ossimRefPtr< ossimImageGeometrytheGeometry
 
ossimRefPtr< ossimNBandLutDataObjecttheLut
 
std::vector< ossimDpttheDecimationFactors
 
ossimString theImageID
 
ossim_uint32 theStartingResLevel
 theStartingResLevel If set to something other than zero(default) this is indicative that the reader is an overview. More...
 
bool theOpenOverviewFlag
 If true opening of overviews will be attempted. More...
 
ossimPixelType thePixelType
 
std::shared_ptr< ossim::ImageHandlerState > m_state
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Additional Inherited Members

- Public Types inherited from ossimImageHandler
enum  ossimImageHandlerOverviewCompressionType {
  OSSIM_OVERVIEW_COMPRESSION_NONE = 0, OSSIM_OVERVIEW_COMPRESSION_JPEG, OSSIM_OVERVIEW_COMPRESSION_LZW, OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
  OSSIM_OVERVIEW_COMPRESSION_PACKBITS
}
 
- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Detailed Description

Definition at line 24 of file ossimUsgsDemTileSource.h.

Constructor & Destructor Documentation

◆ ossimUsgsDemTileSource() [1/2]

ossimUsgsDemTileSource::ossimUsgsDemTileSource ( )

Definition at line 43 of file ossimUsgsDemTileSource.cpp.

44  :
46  theDem(0),
47  theTile(0),
48  theNullValue(0.0),
49  theMinHeight(0.0),
50  theMaxHeight(0.0),
51  theFeetFlag(false),
52  theIsDemFlag(false),
54 {
55  // Construction not complete. Users should call "open" method.
56 }
ossimScalarType theScalarType
This can be either OSSIM_SINT16 or OSSIM_FLOAT32.
ossimRefPtr< ossimImageData > theTile
16 bit signed integer
ossimImageHandler()
Constructor (default):

◆ ~ossimUsgsDemTileSource()

ossimUsgsDemTileSource::~ossimUsgsDemTileSource ( )
protectedvirtual

Definition at line 58 of file ossimUsgsDemTileSource.cpp.

References theDem, and theTile.

59 {
60  if (theDem)
61  {
62  delete theDem;
63  theDem = 0;
64  }
65  theTile = 0;
66 }
ossimRefPtr< ossimImageData > theTile

◆ ossimUsgsDemTileSource() [2/2]

ossimUsgsDemTileSource::ossimUsgsDemTileSource ( const ossimUsgsDemTileSource )
protected

Definition at line 560 of file ossimUsgsDemTileSource.cpp.

561 {
562 }

Member Function Documentation

◆ fillBuffer()

template<class T >
bool ossimUsgsDemTileSource::fillBuffer ( ,
const ossimIrect tile_rect,
const ossimIrect clip_rect,
ossimImageData tile 
)
protected

Returns true on success, false on error.

Definition at line 173 of file ossimUsgsDemTileSource.cpp.

References ossimImageData::getBuf(), ossimDemGrid::getElevation(), ossimDemGrid::getHeader(), ossimDemHeader::getSpatialResZ(), ossimImageData::getWidth(), ossimIrect::lr(), MTRS_PER_FT, theDem, theFeetFlag, theNullValue, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

177 {
178  const ossim_uint32 TILE_WIDTH = tile->getWidth();
179 
180  T* d = static_cast<T*>(tile->getBuf());
181 
182  ossim_float32 spatialResZ = theDem->getHeader().getSpatialResZ();
183  if (spatialResZ == 0.0) spatialResZ = 1.0;
184 
185  // Compute the starting offset.
186  ossim_uint32 offset = (clip_rect.ul().y - tile_rect.ul().y) * TILE_WIDTH +
187  clip_rect.ul().x - tile_rect.ul().x;
188 
189  for (ossim_int32 line = clip_rect.ul().y; line <= clip_rect.lr().y; ++line)
190  {
191  // Loop in the longitude or sample direction.
192  int samp_offset = 0;
193  for (ossim_int32 samp = clip_rect.ul().x; samp <= clip_rect.lr().x; ++samp)
194  {
195  ossim_float32 p = theDem->getElevation(samp, line);
196  if (p != theNullValue)
197  {
198  p *= spatialResZ;
199  if (theFeetFlag) p = p * MTRS_PER_FT;
200  }
201  d[offset + samp_offset] = static_cast<T>(p);
202  ++samp_offset;
203  }
204  offset += TILE_WIDTH;
205  }
206 
207  return true;
208 }
virtual ossim_uint32 getWidth() const
float ossim_float32
const ossimIpt & ul() const
Definition: ossimIrect.h:274
unsigned int ossim_uint32
const ossimIpt & lr() const
Definition: ossimIrect.h:276
#define MTRS_PER_FT
double getSpatialResZ() const
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossimDemHeader const & getHeader() const
ossim_int32 x
Definition: ossimIpt.h:141
ossim_float32 getElevation(long x, long y) const
int ossim_int32

◆ gatherStatistics()

void ossimUsgsDemTileSource::gatherStatistics ( )
protected

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimUsgsDemTileSource::getImageGeometry ( )
virtual

Override base-class method to make sure the internal geometry is explored before extending.

Reimplemented from ossimImageHandler.

Definition at line 369 of file ossimUsgsDemTileSource.cpp.

References ossimImageGeometryRegistry::extendGeometry(), ossimRefPtr< T >::get(), ossimImageHandler::getExternalImageGeometry(), getInternalImageGeometry(), ossimImageGeometry::getProjection(), ossimImageHandler::initImageParameters(), ossimImageGeometryRegistry::instance(), and ossimImageHandler::theGeometry.

370 {
371  if ( !theGeometry )
372  {
373  // Check for external geom:
375 
376  if ( !theGeometry )
377  {
378  // Check the internal geometry first to avoid a factory call.
380 
381  // At this point it is assured theGeometry is set.
382 
383  //---
384  // WARNING:
385  // Must create/set theGeometry at this point or the next call to
386  // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
387  // as it does a recursive call back to ossimImageHandler::getImageGeometry().
388  //---
389 
390  // Check for set projection.
391  if ( !theGeometry->getProjection() )
392  {
393  // Try factories for projection.
395  }
396  }
397 
398  // Set image things the geometry object should know about.
400  }
401 
402  return theGeometry;
403 }
static ossimImageGeometryRegistry * instance()
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
Initializes theGeometry from USGS DEM header.
ossimRefPtr< ossimImageGeometry > theGeometry
virtual bool extendGeometry(ossimImageHandler *handler) const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).

◆ getImageRectangle()

ossimIrect ossimUsgsDemTileSource::getImageRectangle ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in.

Note that rrds 0 is the highest resolution rrds.

Reimplemented from ossimImageHandler.

Definition at line 211 of file ossimUsgsDemTileSource.cpp.

References getNumberOfLines(), and getNumberOfSamples().

Referenced by getTile().

212 {
213  return ossimIrect(0,
214  0,
215  getNumberOfSamples(reduced_res_level) - 1,
216  getNumberOfLines(reduced_res_level) - 1);
217 }
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of lines in the image.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of samples in the image.

◆ getImageTileHeight()

ossim_uint32 ossimUsgsDemTileSource::getImageTileHeight ( ) const
virtual

Returns the tile width of the image or 0 if the image is not tiled.

Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 502 of file ossimUsgsDemTileSource.cpp.

503 {
504  return 0;
505 }

◆ getImageTileWidth()

ossim_uint32 ossimUsgsDemTileSource::getImageTileWidth ( ) const
virtual

Returns the tile width of the image or 0 if the image is not tiled.

Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 497 of file ossimUsgsDemTileSource.cpp.

498 {
499  return 0;
500 }

◆ getInternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimUsgsDemTileSource::getInternalImageGeometry ( ) const
protectedvirtual

Initializes theGeometry from USGS DEM header.

This is called by base ossimImageHandler::getImageGeometry if theGeometry is not set. External callers should not go through this method but call "getImageGeometry" instead for efficiency reasons.

Returns
Pointer to geometry or null if header not found.

Reimplemented from ossimImageHandler.

Definition at line 406 of file ossimUsgsDemTileSource.cpp.

References ossimDemGrid::getHeader(), and theDem.

Referenced by getImageGeometry().

407 {
409 
410  if (theDem)
411  {
412  const ossimDemHeader HDR = theDem->getHeader();
413  if (traceDebug())
414  {
416  << "ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:"
417  << "\nDEM Header:"
418  << std::endl;
420  }
421 
422  // The DEM's image geometry is a map projection, obtained here via KWL:
423  ossimKeywordlist proj_kwl;
424  if ( HDR.getImageGeometry(proj_kwl) )
425  {
426  if (traceDebug())
427  {
429  << "ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:"
430  << "keyword list:\n" << proj_kwl
431  << std::endl;
432  }
433 
434  // Capture for next time.
437  createProjection(proj_kwl);
438  if ( proj.valid() )
439  {
440  geom->setProjection(proj.get());
441  }
442  }
443  }
444 
445  return geom;
446 }
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
static ossimProjectionFactoryRegistry * instance()
ossimDemHeader const & getHeader() const
std::ostream & print(std::ostream &out) const
Print method.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool getImageGeometry(ossimKeywordlist &kwl, const char *prefix=NULL) const

◆ getLongName()

ossimString ossimUsgsDemTileSource::getLongName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 512 of file ossimUsgsDemTileSource.cpp.

513 {
514  return ossimString("usgs dem reader");
515 }

◆ getMaxPixelValue()

double ossimUsgsDemTileSource::getMaxPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the max pixel of the band.

Reimplemented from ossimImageHandler.

Definition at line 541 of file ossimUsgsDemTileSource.cpp.

References ossimImageMetaData::getMaxPix(), ossimImageMetaData::getNumberOfBands(), theMaxHeight, and ossimImageHandler::theMetaData.

542 {
544  {
545  return theMetaData.getMaxPix(band);
546  }
547  return theMaxHeight;
548 }
double getMaxPix(ossim_uint32 band) const
ossim_uint32 getNumberOfBands() const
ossimImageMetaData theMetaData

◆ getMinPixelValue()

double ossimUsgsDemTileSource::getMinPixelValue ( ossim_uint32  band = 0) const
virtual

Retuns the min pixel value.

If there was an external eta data file then use the meta data from that file. If not given then we will return the default min

Reimplemented from ossimImageHandler.

Definition at line 532 of file ossimUsgsDemTileSource.cpp.

References ossimImageMetaData::getMinPix(), ossimImageMetaData::getNumberOfBands(), ossimImageHandler::theMetaData, and theMinHeight.

533 {
534  if(band < theMetaData.getNumberOfBands())
535  {
536  return theMetaData.getMinPix(band);
537  }
538  return theMinHeight;
539 }
double getMinPix(ossim_uint32 band) const
ossim_uint32 getNumberOfBands() const
ossimImageMetaData theMetaData

◆ getNullPixelValue()

double ossimUsgsDemTileSource::getNullPixelValue ( ossim_uint32  band = 0) const
virtual

Each band has a null pixel associated with it.

The null pixel represents an invalid value.

Reimplemented from ossimImageHandler.

Definition at line 527 of file ossimUsgsDemTileSource.cpp.

References theNullValue.

528 {
529  return theNullValue;
530 }

◆ getNumberOfInputBands()

ossim_uint32 ossimUsgsDemTileSource::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual requirement from ImageHandler class.

Implements ossimImageSource.

Definition at line 517 of file ossimUsgsDemTileSource.cpp.

518 {
519  return 1;
520 }

◆ getNumberOfLines()

ossim_uint32 ossimUsgsDemTileSource::getNumberOfLines ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the number of lines in the image.

Satisfies pure virtual requirement from ImageHandler class.

Implements ossimImageHandler.

Definition at line 463 of file ossimUsgsDemTileSource.cpp.

References ossimDemGrid::getHeight(), ossimImageHandler::getNumberOfLines(), theDem, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getImageRectangle().

464 {
465  ossim_uint32 result = 0;
466  if (reduced_res_level == 0)
467  {
468  if (theDem)
469  {
470  result = theDem->getHeight();
471  }
472  }
473  else if (theOverview.valid())
474  {
475  result = theOverview->getNumberOfLines(reduced_res_level);
476  }
477  return result;
478 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
long getHeight() const
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview

◆ getNumberOfOutputBands()

ossim_uint32 ossimUsgsDemTileSource::getNumberOfOutputBands ( ) const
virtual

Returns the number of bands in a tile returned from this TileSource.

Reimplemented from ossimImageSource.

Definition at line 522 of file ossimUsgsDemTileSource.cpp.

Referenced by getTile().

523 {
524  return 1;
525 }

◆ getNumberOfSamples()

ossim_uint32 ossimUsgsDemTileSource::getNumberOfSamples ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the number of samples in the image.

Satisfies pure virtual requirement from ImageHandler class.

Implements ossimImageHandler.

Definition at line 480 of file ossimUsgsDemTileSource.cpp.

References ossimImageHandler::getNumberOfSamples(), ossimDemGrid::getWidth(), theDem, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getImageRectangle().

481 {
482  ossim_uint32 result = 0;
483  if (reduced_res_level == 0)
484  {
485  if (theDem)
486  {
487  result = theDem->getWidth();
488  }
489  }
490  else if (theOverview.valid())
491  {
492  result = theOverview->getNumberOfSamples(reduced_res_level);
493  }
494  return result;
495 }
long getWidth() const
bool valid() const
Definition: ossimRefPtr.h:75
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getOutputScalarType()

ossimScalarType ossimUsgsDemTileSource::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 448 of file ossimUsgsDemTileSource.cpp.

References theScalarType.

449 {
450  return theScalarType;
451 }
ossimScalarType theScalarType
This can be either OSSIM_SINT16 or OSSIM_FLOAT32.

◆ getShortName()

ossimString ossimUsgsDemTileSource::getShortName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 507 of file ossimUsgsDemTileSource.cpp.

508 {
509  return ossimString("usgs dem");
510 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimUsgsDemTileSource::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual
Returns
the requested region of interest

Reimplemented from ossimImageSource.

Definition at line 68 of file ossimUsgsDemTileSource.cpp.

References ossimRefPtr< T >::get(), ossimDataObject::getDataObjectStatus(), ossimImageData::makeBlank(), OSSIM_NULL, ossimImageData::setImageRectangle(), theTile, and ossimRefPtr< T >::valid().

70 {
71  if (theTile.valid())
72  {
73  // Image rectangle must be set prior to calling getTile.
74  theTile->setImageRectangle(tile_rect);
75 
76  if ( getTile( theTile.get(), resLevel ) == false )
77  {
79  {
80  theTile->makeBlank();
81  }
82  }
83  }
84 
85  return theTile;
86 }
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageData > theTile
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
virtual void makeBlank()
Initializes data to null pixel values.

◆ getTile() [2/2]

bool ossimUsgsDemTileSource::getTile ( ossimImageData result,
ossim_uint32  resLevel = 0 
)
virtual

Method to get a tile.

Parameters
resultThe tile to stuff. Note The requested rectangle in full image space and bands should be set in the result tile prior to passing. It will be an error if: result.getNumberOfBands() != this->getNumberOfOutputBands()
Returns
true on success false on error. If return is false, result is undefined so caller should handle appropriately with makeBlank or whatever.

Reimplemented from ossimImageSource.

Definition at line 88 of file ossimUsgsDemTileSource.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), fillBuffer(), getImageRectangle(), ossimImageData::getImageRectangle(), ossimImageData::getMaxPix(), ossimImageData::getMinPix(), ossimImageData::getNullPix(), ossimImageData::getNumberOfBands(), getNumberOfOutputBands(), ossimImageHandler::getOverviewTile(), ossimIrect::intersects(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), ossimImageData::makeBlank(), OSSIM_FLOAT32, ossimReferenced::ref(), ossimImageData::setMaxPix(), ossimImageData::setMinPix(), ossimImageData::setNullPix(), status, theScalarType, theTile, ossimReferenced::unref(), and ossimImageData::validate().

90 {
91  bool status = false;
92 
93  //---
94  // Not open, this tile source bypassed, or invalid res level,
95  // return a blank tile.
96  //---
97  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
98  result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
99  {
100  result->ref(); // Increment ref count.
101 
102  //---
103  // Check for overview tile. Some overviews can contain r0 so always
104  // call even if resLevel is 0. Method returns true on success, false
105  // on error.
106  //---
107  status = getOverviewTile(resLevel, result);
108 
109  if (status) // From old code. Not sure if still needed.
110  {
114  }
115 
116  if (!status) // Did not get an overview tile.
117  {
118  status = true;
119 
120  ossimIrect tile_rect = result->getImageRectangle();
121 
122  ossimIrect image_rect = getImageRectangle(resLevel);
123 
124  //---
125  // See if any point of the requested tile is in the image.
126  //---
127  if ( tile_rect.intersects(image_rect) )
128  {
129  ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
130 
131  if ( !tile_rect.completely_within(clip_rect) )
132  {
133  // Start with a blank tile.
134  result->makeBlank();
135  }
136 
137  // Load the tile buffer with data from the dem cell.
139  {
141  tile_rect,
142  clip_rect,
143  result);
144  }
145  else
146  {
148  tile_rect,
149  clip_rect,
150  result);
151  }
152  if (status == true)
153  {
154  result->validate();
155  }
156  }
157  else // No intersection: if ( tile_rect.intersects(image_rect) )
158  {
159  result->makeBlank();
160  }
161  }
162 
163  result->unref(); // Decrement ref count.
164  }
165 
166  return status;
167 }
ossimScalarType theScalarType
This can be either OSSIM_SINT16 or OSSIM_FLOAT32.
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > theTile
float ossim_float32
32 bit floating point
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
void ref() const
increment the reference count by one, indicating that this object has another pointer which is refere...
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
Definition: ossimIrect.cpp:425
virtual void setNullPix(ossim_float64 null_pix)
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
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.
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
void unref() const
decrement the reference count by one, indicating that a pointer to this object is referencing it...
virtual const ossim_float64 * getMinPix() const
return status
virtual void makeBlank()
Initializes data to null pixel values.
virtual void setMaxPix(ossim_float64 max_pix)
bool fillBuffer(T, const ossimIrect &tile_rect, const ossimIrect &clip_rect, ossimImageData *tile)
Returns true on success, false on error.
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 void setMinPix(ossim_float64 min_pix)

◆ getTileHeight()

ossim_uint32 ossimUsgsDemTileSource::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 458 of file ossimUsgsDemTileSource.cpp.

References ossimImageData::getHeight(), theTile, and ossimRefPtr< T >::valid().

459 {
460  return ( theTile.valid() ? theTile->getHeight() : 0 );
461 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageData > theTile
virtual ossim_uint32 getHeight() const

◆ getTileWidth()

ossim_uint32 ossimUsgsDemTileSource::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 453 of file ossimUsgsDemTileSource.cpp.

References ossimImageData::getWidth(), theTile, and ossimRefPtr< T >::valid().

454 {
455  return ( theTile.valid() ? theTile->getWidth() : 0 );
456 }
virtual ossim_uint32 getWidth() const
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageData > theTile

◆ isOpen()

bool ossimUsgsDemTileSource::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 550 of file ossimUsgsDemTileSource.cpp.

References theDem.

Referenced by getTile().

551 {
552  return (theDem ? true : false );
553 }

◆ loadState()

bool ossimUsgsDemTileSource::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Keywords picked up by this method: dem_type: usgs_dem scalar_type: ossim_sint16 (default) or scalar_type: ossim_float32

Reimplemented from ossimImageHandler.

Definition at line 313 of file ossimUsgsDemTileSource.cpp.

References ossimKeywordlist::find(), and ossimImageHandler::loadState().

315 {
316  if (ossimImageHandler::loadState(kwl, prefix))
317  {
318  //***
319  // Look for "dem_type: usgs_dem" key value pair.
320  // Note: If not in the keyword list the "open" will look for it on
321  // disk.
322  //***
323  const char* lookup = kwl.find(prefix, DEM_TYPE_KW);
324  if (lookup)
325  {
326  ossimString s = lookup;
327  s.downcase();
328  if (s == USGS_DEM_KW) theIsDemFlag = true;
329  }
330 
331  //---
332  // Look for scalar type override.
333  //
334  // Note: We only allow float or signed 16 bit.
335  //---
336  lookup = kwl.find(prefix, ossimKeywordNames::SCALAR_TYPE_KW);
337  if (lookup)
338  {
339  ossimScalarType st =
341  getEntryNumber(lookup));
342  if ( (st == OSSIM_FLOAT32) || (st == OSSIM_SINT16))
343  {
344  theScalarType = st;
345  }
346  else
347  {
348  if (traceDebug())
349  {
351  << "ossimUsgsDemTileSource::loadState WARNING:"
352  << "\nInvalid scalar type: "
354  getEntryString(st)
355  << std::endl;
356  }
357  }
358  }
359 
360  if (open())
361  {
362  return true;
363  }
364  }
365 
366  return false;
367 }
ossimScalarType theScalarType
This can be either OSSIM_SINT16 or OSSIM_FLOAT32.
virtual bool open()
Returns true if the "theImageFile can be opened.
const char * find(const char *key) 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.
16 bit signed integer
32 bit floating point
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimScalarType
static const char * SCALAR_TYPE_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ open()

bool ossimUsgsDemTileSource::open ( )
virtual

Returns true if the "theImageFile can be opened.

If the extension is not equal to ".dem" this will attempt to look for an ".omd" file with the keyword pair "dem_type: usgs_dem" in it.

Optionally users can change the scalar type from signed 16 bit to float with the keyword pair "scalar_type: ossim_float32"

Implements ossimImageHandler.

Definition at line 219 of file ossimUsgsDemTileSource.cpp.

220 {
221  static const char MODULE[] = "ossimUsgsDemTileSource::open";
222 
223  if (traceDebug())
224  {
225  CLOG << "DEBUG:"
226  << "\nAttempting to parse file: " << theImageFile.c_str()
227  << std::endl;
228  }
229 
231 
232  if (theIsDemFlag)
233  {
234  // Open up the file for reading.
236  std::ios_base::in | std::ios_base::binary);
237  if (is.good())
238  {
239  // Start out with a fresh dem.
240  if (theDem) delete theDem;
241 
242  //---
243  // Set the null to -32768. This will also be the missing data values.
244  //---
246 
247  //---
248  // Read the dem.
249  //
250  // NOTE: This defines the missing data value. It should be the
251  // same as null for mosaicing and min/max calculations.
252  //---
254  theDem->read(is);
255 
256  is.close();
257  }
258  else
259  {
260  theIsDemFlag = false;
261  }
262  }
263 
264  if (theIsDemFlag)
265  {
267  true : false;
268 
273 
274  completeOpen();
275 
276  //---
277  // Set up the tiles. Note the blank tile will not get initialized to
278  // save memory. This includes setting the min and max pixel value
279  // gathered from the statistics.
280  //---
282  theTile->initialize();
283 
284  if (traceDebug())
285  {
286  CLOG << setiosflags(ios::fixed) << setprecision(5) << "DEBUG:"
287  << "\nNull pix: " << (theTile->getNullPix(0))
288  << "\nMin pix: " << (theTile->getMinPix(0))
289  << "\nMax pix: " << (theTile->getMaxPix(0))
290  << "\nlines: " << theDem->getHeight()
291  << "\nsamples: " << theDem->getWidth()
292  << std::endl;
293  }
294  }
295 
296  return theIsDemFlag;
297 }
ossim_int32 getElevationUnits() const
virtual const ossim_float64 * getMaxPix() const
#define CLOG
Definition: ossimTrace.h:23
ossimFilename theImageFile
long getWidth() const
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
#define OSSIM_DEFAULT_NULL_PIX_SINT16
double getMinimumElev() const
ossimRefPtr< ossimImageData > theTile
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
static bool isUsgsDem(const ossimFilename &file)
Does basic sanity checks to see if file is a dem.
long getHeight() const
virtual const ossim_float64 * getNullPix() const
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
virtual const ossim_float64 * getMinPix() const
long read(ossim::istream &dem, bool incrementalRead=false)
#define MTRS_PER_FT
virtual void completeOpen()
Will complete the opening process.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimDemHeader const & getHeader() const
double getMaximumElev() const

◆ operator=()

const ossimUsgsDemTileSource & ossimUsgsDemTileSource::operator= ( const ossimUsgsDemTileSource rhs)
protected

Definition at line 555 of file ossimUsgsDemTileSource.cpp.

556 {
557  return rhs;
558 }

◆ saveState()

bool ossimUsgsDemTileSource::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 299 of file ossimUsgsDemTileSource.cpp.

References ossimKeywordlist::add().

301 {
302  // Save of the dem type keyword.
303  kwl.add(prefix, DEM_TYPE_KW, USGS_DEM_KW, true);
304 
305  // Save the scalar type.
306  kwl.add(prefix,
308  ossimScalarTypeLut::instance()->getEntryString(theScalarType));
309 
310  return ossimImageHandler::saveState(kwl, prefix);
311 }
ossimScalarType theScalarType
This can be either OSSIM_SINT16 or OSSIM_FLOAT32.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
static const char * SCALAR_TYPE_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

Member Data Documentation

◆ theDem

ossimDemGrid* ossimUsgsDemTileSource::theDem
protected

◆ theFeetFlag

bool ossimUsgsDemTileSource::theFeetFlag
protected

Definition at line 182 of file ossimUsgsDemTileSource.h.

Referenced by fillBuffer().

◆ theIsDemFlag

bool ossimUsgsDemTileSource::theIsDemFlag
protected

Definition at line 183 of file ossimUsgsDemTileSource.h.

◆ theMaxHeight

ossim_float64 ossimUsgsDemTileSource::theMaxHeight
protected

Definition at line 181 of file ossimUsgsDemTileSource.h.

Referenced by getMaxPixelValue().

◆ theMinHeight

ossim_float64 ossimUsgsDemTileSource::theMinHeight
protected

Definition at line 180 of file ossimUsgsDemTileSource.h.

Referenced by getMinPixelValue().

◆ theNullValue

ossim_float64 ossimUsgsDemTileSource::theNullValue
protected

Definition at line 179 of file ossimUsgsDemTileSource.h.

Referenced by fillBuffer(), and getNullPixelValue().

◆ theScalarType

ossimScalarType ossimUsgsDemTileSource::theScalarType
protected

This can be either OSSIM_SINT16 or OSSIM_FLOAT32.

Default = OSSIM_SINT16 Can be changed via ".omd" file keyword:

Definition at line 189 of file ossimUsgsDemTileSource.h.

Referenced by getOutputScalarType(), and getTile().

◆ theTile

ossimRefPtr<ossimImageData> ossimUsgsDemTileSource::theTile
protected

The documentation for this class was generated from the following files: