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

#include <ossimGeoPdfReader.h>

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

Classes

struct  ossimFrameEntryData
 

Public Member Functions

 ossimGeoPdfReader ()
 default construtor More...
 
virtual ~ossimGeoPdfReader ()
 virtural destructor More...
 
virtual ossimString getShortName () const
 Returns short name. More...
 
virtual ossimString getLongName () const
 Returns long name. More...
 
virtual ossimString getClassName () const
 Returns class name. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 Method to grab a tile(rectangle) from image. More...
 
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 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 ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const
 Gets number of lines for res level. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const
 Gets the number of samples for res level. More...
 
virtual bool open ()
 Open method. More...
 
virtual bool isOpen () const
 Method to test for open file stream. More...
 
virtual void closeEntry ()
 Method to close current entry. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () 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. More...
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
- 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 getImageRectangle (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. 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 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 double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. 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 void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
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 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 ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. 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 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

std::vector< ossimFrameEntryDatagetIntersectingEntries (const ossimIrect &rect)
 It is important to note that each frame is organized into an easting northing type orientation. More...
 
- 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)
 

Private Member Functions

ossimProjectiongetGeoProjection ()
 
ossimProjectiongetVPGeoProjection ()
 
ossimProjectiongetLGIDictGeoProjection ()
 
ossimProjectiongetProjectionFromStr (ossimString projContents)
 
ossimDrect computeBoundingRect (ossimRefPtr< ossimImageGeometry > geoImage)
 
void setPodofoInfo (PoDoFo::PdfObject *object)
 
void setPodofoRefInfo (PoDoFo::PdfObject *object)
 
void setPodofoArrayInfo (PoDoFo::PdfObject *object)
 
void setPodofoDictInfo (PoDoFo::PdfObject *object)
 
void parseTileStructure (std::vector< ossimString > tileInfo)
 
void setPodofoImageInfo ()
 
void buildFrameEntryArray ()
 
void buildTileInfo (ossimString tileInfo)
 
void resetCacheBuffer (ossimFrameEntryData entry)
 
template<class T >
void fillTile (T, const ossimIrect &clip_rect, ossimImageData *tile)
 

Private Attributes

ossimIrect m_imageRect
 
ossim_uint32 m_numberOfBands
 Has sub image offset. More...
 
ossim_uint32 m_numberOfLines
 
ossim_uint32 m_numberOfSamples
 
ossim_int32 m_numOfFramesVertical
 
ossim_int32 m_numOfFramesHorizontal
 
ossim_int32 m_currentRow
 
ossim_int32 m_currentCol
 
std::map< ossim_int32, ossim_int32m_frameWidthVector
 
std::map< ossim_int32, ossim_int32m_frameHeightVector
 
ossimScalarType m_scalarType
 
ossimRefPtr< ossimImageDatam_tile
 
std::map< ossimString, ossimString, ossimStringLtstrm_podofoProjInfo
 
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
 
std::map< ossim_int32, PoDoFo::PdfObject * > m_podofoImageObjs
 
PoDoFo::PdfMemDocument * m_pdfMemDocument
 
bool m_isLGIDict
 
bool m_isJpeg
 
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
 
ossimRefPtr< ossimImageDatam_cacheTile
 
ossimIpt m_cacheSize
 
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
 
std::vector< std::vector< std::vector< PoDoFo::PdfObject * > > > m_frameEntryArray
 

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
 
- 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
 

Detailed Description

Definition at line 42 of file ossimGeoPdfReader.h.

Constructor & Destructor Documentation

◆ ossimGeoPdfReader()

ossimGeoPdfReader::ossimGeoPdfReader ( )

default construtor

Definition at line 136 of file ossimGeoPdfReader.cpp.

137  : ossimImageHandler(),
139  m_numberOfBands(0),
140  m_numberOfLines(0),
144  m_currentRow(-1),
145  m_currentCol(-1),
149  m_tile(0),
150  m_pdfMemDocument(NULL),
151  m_isLGIDict(false),
152  m_isJpeg(true),
153  m_pageVector(0),
154  m_cacheTile(0),
155  m_cacheSize(0),
156  m_cacheId(-1),
158 {
159 }
PoDoFo::PdfMemDocument * m_pdfMemDocument
ossimScalarType m_scalarType
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
ossim_int32 m_currentRow
std::vector< std::vector< std::vector< PoDoFo::PdfObject * > > > m_frameEntryArray
ossim_uint32 m_numberOfSamples
#define OSSIM_INT_NAN
ossim_int32 m_currentCol
ossim_uint32 m_numberOfBands
Has sub image offset.
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
ossimRefPtr< ossimImageData > m_cacheTile
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
ossimImageHandler()
Constructor (default):
8 bit unsigned integer
ossim_int32 m_numOfFramesVertical
ossim_uint32 m_numberOfLines
ossim_int32 m_numOfFramesHorizontal
ossimRefPtr< ossimImageData > m_tile

◆ ~ossimGeoPdfReader()

ossimGeoPdfReader::~ossimGeoPdfReader ( )
virtual

virtural destructor

Definition at line 161 of file ossimGeoPdfReader.cpp.

References closeEntry().

162 {
163  closeEntry();
164 }
virtual void closeEntry()
Method to close current entry.

Member Function Documentation

◆ buildFrameEntryArray()

void ossimGeoPdfReader::buildFrameEntryArray ( )
private

Definition at line 1255 of file ossimGeoPdfReader.cpp.

References m_frameEntryArray, m_frameHeightVector, m_frameWidthVector, m_imageRect, m_numberOfBands, m_numberOfLines, m_numberOfSamples, m_numOfFramesHorizontal, m_numOfFramesVertical, m_podofoImageObjs, m_podofoTileInfo, and size.

1256 {
1257  m_frameWidthVector.clear();
1258  m_frameHeightVector.clear();
1259  ossim_int32 row = 0;
1260  ossim_int32 col = 0;
1261  if (m_podofoImageObjs.size() > 0 && m_podofoTileInfo.size() > 0)
1262  {
1263  //Podofo libary may skip some objects when reading file which cause the count of objects
1264  //different between tile info and image info. need offset to correct it.
1265  std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> >::iterator itTileEnd;
1266  itTileEnd = m_podofoTileInfo.end();
1267  itTileEnd--;
1268 
1269  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator itObjeEnd;
1270  itObjeEnd = m_podofoImageObjs.end();
1271  itObjeEnd--;
1272 
1273  ossim_int32 indexOffset = itTileEnd->first - itObjeEnd->first;
1274 
1275  std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> >::iterator it = m_podofoTileInfo.begin();
1276  //get number of vertical frames and number of horizontal frames
1277  while (it != m_podofoTileInfo.end())
1278  {
1279  ossim_int32 index = it->first;
1280  if (indexOffset > 0)
1281  {
1282  index = index - indexOffset;
1283  }
1284  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator itObj = m_podofoImageObjs.find(index);
1285  if (itObj != m_podofoImageObjs.end())
1286  {
1287  row = it->second.first;
1288  col = it->second.second;
1289  if (m_numOfFramesHorizontal <= col)
1290  {
1292  }
1293  if (m_numOfFramesVertical <= row)
1294  {
1295  m_numOfFramesVertical = row;
1296  }
1297  }
1298  it++;
1299  }
1300 
1301  //set up array size
1304 
1306  for(ossim_uint32 index = 0; index < m_frameEntryArray.size(); index++)
1307  {
1309  }
1310 
1311  //build array
1312  it = m_podofoTileInfo.begin();
1313  std::vector<PoDoFo::PdfObject*> tmpObjVector;
1314  while (it != m_podofoTileInfo.end())
1315  {
1316  ossim_int32 index = it->first;
1317  if (indexOffset > 0)
1318  {
1319  index = index - indexOffset;
1320  }
1321  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator itObj = m_podofoImageObjs.find(index);
1322  if (itObj != m_podofoImageObjs.end())
1323  {
1324  ossim_int32 rowCount = it->second.first;
1325  ossim_int32 colCount = it->second.second;
1326  m_frameEntryArray[rowCount][colCount].push_back(itObj->second);
1327  }
1328  it++;
1329  }
1330 
1331  //calculate lines and samples
1332  for (row = 0; row < m_numOfFramesVertical; ++row)
1333  {
1334  PoDoFo::PdfObject* tmpObj = m_frameEntryArray[row][0][0];
1335  PoDoFo::PdfImage image(tmpObj);
1336  int height = image.GetHeight();
1337  m_frameHeightVector[row] = height;
1338  }
1339 
1340  for (col = 0; col < m_numOfFramesHorizontal; ++col)
1341  {
1342  PoDoFo::PdfObject* tmpObj = m_frameEntryArray[0][col][0];
1343  PoDoFo::PdfImage image(tmpObj);
1344  int width = image.GetWidth();
1345  m_frameWidthVector[col] = width;
1346  }
1347 
1348  std::map<ossim_int32, ossim_int32>::iterator itWidth = m_frameWidthVector.begin();
1349  while (itWidth != m_frameWidthVector.end())
1350  {
1351  m_numberOfSamples = m_numberOfSamples + itWidth->second;
1352  itWidth++;
1353  }
1354 
1355  std::map<ossim_int32, ossim_int32>::iterator itHeight = m_frameHeightVector.begin();
1356  while (itHeight != m_frameHeightVector.end())
1357  {
1358  m_numberOfLines = m_numberOfLines + itHeight->second;
1359  itHeight++;
1360  }
1362 
1363  //get the number of bands
1364  if (m_frameEntryArray[0][0].size() > 2)
1365  {
1367  }
1368  else
1369  {
1370  PoDoFo::PdfObject* tmpObject = m_frameEntryArray[0][0][0];
1371  PoDoFo::PdfMemStream* pStream = dynamic_cast<PoDoFo::PdfMemStream*>(tmpObject->GetStream());
1372  pStream->Uncompress();
1373  ossim_int32 length = pStream->GetLength();
1375  }
1376  }
1377 }
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
std::vector< std::vector< std::vector< PoDoFo::PdfObject * > > > m_frameEntryArray
ossim_uint32 m_numberOfSamples
ossim_uint32 m_numberOfBands
Has sub image offset.
std::map< ossim_int32, PoDoFo::PdfObject * > m_podofoImageObjs
yy_size_t size
unsigned int ossim_uint32
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
ossim_int32 m_numOfFramesVertical
ossim_uint32 m_numberOfLines
ossim_int32 m_numOfFramesHorizontal
int ossim_int32

◆ buildTileInfo()

void ossimGeoPdfReader::buildTileInfo ( ossimString  tileInfo)
private

Definition at line 424 of file ossimGeoPdfReader.cpp.

References m_podofoTileInfo, and ossimString::split().

Referenced by parseTileStructure().

425 {
426  std::vector<ossimString> tmpKeyValue = tileInfo.split(" ");
427 
428  if (tmpKeyValue.size() > 1)
429  {
430  std::vector<ossimString> layerNameVector = tmpKeyValue[0].split("_");
431  ossim_int32 col = layerNameVector[layerNameVector.size()-2].toInt();
432  ossim_int32 row = layerNameVector[layerNameVector.size()-1].toInt();
433  std::pair<ossim_int32, ossim_int32> tileRowCol;
434  tileRowCol = make_pair(row, col);
435  ossim_int32 tileIndex = tmpKeyValue[1].toInt();
436 
437  m_podofoTileInfo[tileIndex] = tileRowCol;
438  }
439 }
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
int ossim_int32

◆ closeEntry()

void ossimGeoPdfReader::closeEntry ( )
virtual

Method to close current entry.

Note
There is a bool kdu_compressed_source::close() and a void ossimImageHandler::close(); hence, a new close to avoid conflicting return types.

Definition at line 674 of file ossimGeoPdfReader.cpp.

References ossimImageHandler::close(), m_cacheTile, m_frameEntryArray, m_frameHeightVector, m_frameWidthVector, m_pageVector, m_pdfMemDocument, m_podofoImageObjs, m_podofoProjInfo, m_podofoTileInfo, and m_tile.

Referenced by ~ossimGeoPdfReader().

675 {
676  m_tile = 0;
677  m_cacheTile = 0;
678  m_podofoProjInfo.clear();
679  m_podofoTileInfo.clear();
680  m_frameWidthVector.clear();
681  m_frameHeightVector.clear();
682 
683  if (m_pdfMemDocument)
684  {
685  std::map<int, PoDoFo::PdfObject*>::iterator it = m_podofoImageObjs.begin();
686  while (it != m_podofoImageObjs.end())
687  {
688  m_pdfMemDocument->FreeObjectMemory(it->second);
689  it++;
690  }
691  }
692  m_podofoImageObjs.clear();
693 
694  if (m_frameEntryArray.size() > 0)
695  {
696  for (ossim_uint32 i = 0; i < m_frameEntryArray.size(); i++)
697  {
698  std::vector< std::vector<PoDoFo::PdfObject*> > tmpVector = m_frameEntryArray[i];
699  for (ossim_uint32 j = 0; j < tmpVector.size(); j++)
700  {
701  std::vector<PoDoFo::PdfObject*> tmpVector1 = tmpVector[j];
702  for (ossim_uint32 k = 0; k < tmpVector1.size(); k++)
703  {
704  m_pdfMemDocument->FreeObjectMemory(tmpVector1[k]);
705  }
706  }
707  }
708  }
709  m_frameEntryArray.clear();
710 
711  if (m_pdfMemDocument != NULL)
712  {
713  delete m_pdfMemDocument;
714  m_pdfMemDocument = 0;
715  }
716 
717  for(ossim_uint32 i = 0; i < m_pageVector.size(); ++i)
718  {
719  if(m_pageVector[i])
720  {
721  delete m_pageVector[i];
722  }
723  }
724  m_pageVector.clear();
725 
727 }
PoDoFo::PdfMemDocument * m_pdfMemDocument
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
std::vector< std::vector< std::vector< PoDoFo::PdfObject * > > > m_frameEntryArray
std::map< ossim_int32, PoDoFo::PdfObject * > m_podofoImageObjs
unsigned int ossim_uint32
virtual void close()
Deletes the overview and clears the valid image vertices.
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
ossimRefPtr< ossimImageData > m_cacheTile
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
ossimRefPtr< ossimImageData > m_tile

◆ computeBoundingRect()

ossimDrect ossimGeoPdfReader::computeBoundingRect ( ossimRefPtr< ossimImageGeometry geoImage)
private

Definition at line 441 of file ossimGeoPdfReader.cpp.

References ossimString::contains(), ossimString::empty(), ossimMapProjection::forward(), ossimImageGeometry::getProjection(), getValueFromMap(), ossimProjection::inverse(), ossimMapProjection::isGeographic(), ossimDrect::ll(), ossimDrect::lr(), m_isLGIDict, m_numberOfLines, m_numberOfSamples, m_podofoProjInfo, OSSIM_RIGHT_HANDED, ossimString::push_back(), ossimMapProjection::setDecimalDegreesPerPixel(), ossimMapProjection::setMetersPerPixel(), ossimMapProjection::setUlEastingNorthing(), ossimMapProjection::setUlTiePoints(), ossimString::split(), ossimString::substitute(), ossimString::toString(), ossimString::trim(), ossimDrect::ul(), ossimDrect::ur(), ossimImageGeometry::worldToLocal(), ossimDpt::x, and ossimDpt::y.

442 {
443  // ossim_uint32 entry = 0;
444  ossimKeywordlist kwl;
445  ossimString pfx = "image";
446  pfx += ossimString::toString(0);
447  pfx += ".";
448 
449  double ll_lat = 0.0;
450  double ll_lon = 0.0;
451  double lr_lat = 0.0;
452  double lr_lon = 0.0;
453  double ul_lat = 0.0;
454  double ul_lon = 0.0;
455  double ur_lat = 0.0;
456  double ur_lon = 0.0;
457  ossimDrect rect2(ossimDpt(0,0), ossimDpt(0,0),ossimDpt(0,0),ossimDpt(0,0));
458 
459  ossimProjection* proj = geoImage->getProjection();
460  if (m_isLGIDict)
461  {
462  ossimString bBoxStr = getValueFromMap(m_podofoProjInfo, "Registration");
463  std::vector<ossimString> tmpVector = bBoxStr.split(")");
464  std::vector<ossimString> tmpVector1;
465  for (ossim_uint32 i = 0; i < tmpVector.size(); i++)
466  {
467  ossimString tmpStr = tmpVector[i];
468  if (tmpStr.contains("(") || tmpStr.contains(")"))
469  {
470  tmpStr = tmpStr.substitute("[", "", true).trim();
471  tmpStr = tmpStr.substitute("]", "", true).trim();
472  tmpStr = tmpStr.substitute("(", "", true).trim();
473  tmpStr = tmpStr.substitute(")", "", true).trim();
474  tmpVector1.push_back(tmpStr);
475  }
476  }
477 
478  if (tmpVector1.size() == 8)
479  {
480  ll_lon = tmpVector1[2].toDouble();
481  ll_lat = tmpVector1[3].toDouble();
482  ur_lon = tmpVector1[6].toDouble();
483  ur_lat = tmpVector1[7].toDouble();
484 
485  lr_lon = tmpVector1[6].toDouble();
486  lr_lat = tmpVector1[3].toDouble();
487  ul_lon = tmpVector1[2].toDouble();
488  ul_lat = tmpVector1[7].toDouble();
489  }
490  else if (tmpVector1.size() == 16)
491  {
492  ll_lon = tmpVector1[2].toDouble();
493  ll_lat = tmpVector1[3].toDouble();
494  lr_lon = tmpVector1[6].toDouble();
495  lr_lat = tmpVector1[7].toDouble();
496 
497  ur_lon = tmpVector1[10].toDouble();
498  ur_lat = tmpVector1[11].toDouble();
499  ul_lon = tmpVector1[14].toDouble();
500  ul_lat = tmpVector1[15].toDouble();
501  }
502  }
503  else
504  {
505  std::vector<ossimString> tmpVector;
506  ossimString coodStr = getValueFromMap(m_podofoProjInfo, "GPTS");
507  if (!coodStr.empty())
508  {
509  std::vector<ossimString> coodVector = coodStr.split(" ");
510 
511  for (ossim_uint32 i = 0; i < coodVector.size(); i++)
512  {
513  ossimString tmp = coodVector[i].trim();
514  if (!tmp.empty() && tmp.contains("[") == false && tmp.contains("]") == false)
515  {
516  tmpVector.push_back(tmp);
517  }
518  }
519 
520  ll_lat = tmpVector[0].toDouble();
521  ll_lon = tmpVector[1].toDouble();
522  lr_lat = tmpVector[2].toDouble();
523  lr_lon = tmpVector[3].toDouble();
524  ur_lat = tmpVector[4].toDouble();
525  ur_lon = tmpVector[5].toDouble();
526  ul_lat = tmpVector[6].toDouble();
527  ul_lon = tmpVector[7].toDouble();
528  }
529  }
530 
531  if(proj)
532  {
533  ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(proj);
534 
535  ossimDrect rect(ossimDpt(ul_lon, ul_lat),
536  ossimDpt(ur_lon, ur_lat),
537  ossimDpt(lr_lon, lr_lat),
538  ossimDpt(ll_lon, ll_lat), OSSIM_RIGHT_HANDED);
539 
540  std::vector<ossimGpt> points;
541  if (mapProj->isGeographic())
542  {
543  ossimGpt g1(ul_lat, ul_lon);
544  ossimGpt g2(ur_lat, ur_lon);
545  ossimGpt g3(lr_lat, lr_lon);
546  ossimGpt g4(ll_lat, ll_lon);
547 
548  points.push_back(g1);
549  points.push_back(g2);
550  points.push_back(g3);
551  points.push_back(g4);
552  ossimGpt tie(ul_lat, ul_lon);
553  mapProj->setUlTiePoints(tie);
554  if (m_numberOfLines != 0 && m_numberOfSamples != 0)
555  {
556  ossim_float64 scaleLat = (ul_lat - lr_lat)/m_numberOfLines;
557  ossim_float64 scaleLon = (lr_lon - ul_lon)/m_numberOfSamples;
558 
559  ossimDpt gsd(fabs(scaleLon), fabs(scaleLat));
560  mapProj->setDecimalDegreesPerPixel(gsd);
561  }
562  }
563  else if (!mapProj->isGeographic() && m_isLGIDict == false)
564  {
565  ossimGpt g1(ul_lat, ul_lon);
566  ossimGpt g2(ur_lat, ur_lon);
567  ossimGpt g3(lr_lat, lr_lon);
568  ossimGpt g4(ll_lat, ll_lon);
569 
570  points.push_back(g1);
571  points.push_back(g2);
572  points.push_back(g3);
573  points.push_back(g4);
574 
575  if (m_numberOfLines != 0 && m_numberOfSamples != 0)
576  {
577  ossimDpt ulEn = mapProj->forward(g1);
578  ossimDpt lrEn = mapProj->forward(g3);
579 
580  mapProj->setUlEastingNorthing(ulEn);
581 
582  ossim_float64 scaleLat = (ulEn.y - lrEn.y)/m_numberOfLines;
583  ossim_float64 scaleLon = (lrEn.x - ulEn.x)/m_numberOfSamples;
584 
585  ossimDpt gsd(fabs(scaleLon), fabs(scaleLat));
586  mapProj->setMetersPerPixel(gsd);
587  }
588  }
589  else
590  {
591  ossimGpt g1 = proj->inverse(rect.ul());
592  ossimGpt g2 = proj->inverse(rect.ur());
593  ossimGpt g3 = proj->inverse(rect.lr());
594  ossimGpt g4 = proj->inverse(rect.ll());
595 
596  points.push_back(g1);
597  points.push_back(g2);
598  points.push_back(g3);
599  points.push_back(g4);
600 
601  ossimDpt tie(ul_lon, ul_lat);
602  if (mapProj)
603  {
604  mapProj->setUlTiePoints(tie);
605  if (m_numberOfLines != 0 && m_numberOfSamples != 0)
606  {
607  ossim_float64 scaleLat = (ul_lat - lr_lat)/m_numberOfLines;
608  ossim_float64 scaleLon = (ur_lon - ll_lon)/m_numberOfSamples;
609  ossimDpt gsd(fabs(scaleLon), fabs(scaleLat));
610  mapProj->setMetersPerPixel(gsd);
611  }
612  }
613  }
614 
615  std::vector<ossimDpt> rectTmp;
616  rectTmp.resize(4);
617 
618  for(std::vector<ossimGpt>::size_type index=0; index < 4; ++index)
619  {
620  geoImage->worldToLocal(points[(int)index], rectTmp[(int)index]);
621  }
622 
623  rect2 = ossimDrect(rectTmp);
624 
625  }
626  return rect2;
627 }
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
Represents serializable keyword/value map.
double y
Definition: ossimDpt.h:165
bool contains(char aChar) const
Definition: ossimString.h:58
virtual ossimGpt inverse(const ossimDpt &pp) const
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool isGeographic() const
ossim_uint32 m_numberOfSamples
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
virtual void setMetersPerPixel(const ossimDpt &gsd)
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
double ossim_float64
virtual void setUlEastingNorthing(const ossimDpt &ulEastingNorthing)
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimString getValueFromMap(std::map< ossimString, ossimString, ossimStringLtstr > info, ossimString key)
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
double x
Definition: ossimDpt.h:164
bool empty() const
Definition: ossimString.h:411
virtual void setUlTiePoints(const ossimGpt &gpt)
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
ossim_uint32 m_numberOfLines

◆ fillTile()

template<class T >
void ossimGeoPdfReader::fillTile ( ,
const ossimIrect clip_rect,
ossimImageData tile 
)
private
Note
this method assumes that setImageRectangle has been called on theTile.

Definition at line 829 of file ossimGeoPdfReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), ossimRefPtr< T >::get(), ossimImageData::getBuf(), getClassName(), ossimDataObject::getDataObjectStatus(), ossimImageData::getImageRectangle(), ossimImageData::getNumberOfBands(), ossimImageData::getWidth(), ossimIrect::height(), ossimImageData::initialize(), ossimIrect::intersects(), ossimIrect::ll(), ossimImageData::loadTile(), m_cacheTile, m_isJpeg, ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimImageData::validate(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

832 {
833  if (m_isJpeg == true)
834  {
835  tile->loadTile(m_cacheTile.get());
836  }
837  else
838  {
839  const ossimIrect img_rect = tile->getImageRectangle();
841  if (!img_rect.intersects(src_rect) )
842  {
843  return; // Nothing to do here.
844  }
845 
846  // Check the clip rect.
847  if (!clip_rect.completely_within(img_rect))
848  {
849  return;
850  }
851 
852  ossimIrect clipRect = clip_rect.clipToRect(src_rect);
853  void* src = (void*)m_cacheTile->getBuf();
854  if (!src)
855  {
856  // Set the error...
859  "%s File %s line %d\nNULL pointer passed to method!");
860  return;
861  }
862 
863  // Check the status and allocate memory if needed.
864  if (tile->getDataObjectStatus() == OSSIM_NULL)
865  {
866  tile->initialize();
867  }
868 
869  // Get the width of the buffers.
870  ossim_uint32 num_bands = tile->getNumberOfBands();
871  ossim_uint32 s_width = src_rect.width();
872  ossim_uint32 d_width = tile->getWidth();
873  ossim_uint32 s_band_offset = s_width * src_rect.height();
874 
875  const T* s = static_cast<const T*>(src);
876 
877  ossim_uint32 destinationOffset = (clipRect.ul().y - img_rect.ul().y) * d_width +
878  (clipRect.ul().x - img_rect.ul().x);
879 
880  ossim_uint32 destinationIndex = destinationOffset;
881 
882  ossim_uint32 clipHeight = clipRect.height();
883  ossim_uint32 clipWidth = clipRect.width();
884 
885  ossim_uint32 sourceOffset = (src_rect.ll().y - clipRect.ul().y) * s_width +
886  (clipRect.ul().x - src_rect.ul().x);
887  ossim_uint32 sourceIndex = sourceOffset;
888 
889  // Copy the data.
890  for (ossim_uint32 band=0; band<num_bands; band++)
891  {
892  T* destinationBand = static_cast<T*>(tile->getBuf(band));
893  destinationIndex = destinationOffset;
894  sourceIndex = sourceOffset + s_band_offset*band;
895 
896  for (ossim_uint32 line = 0; line < clipHeight; ++line)
897  {
898  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
899  {
900  destinationBand[destinationIndex + sample]
901  = s[sourceIndex+sample];
902  }
903  sourceIndex -= s_width;
904  destinationIndex += d_width;
905  }
906  }
907  }
908  tile->validate();
909 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
const ossimIpt & ll() const
Definition: ossimIrect.h:277
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
virtual ossimString getClassName() const
Returns class name.
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
ossimRefPtr< ossimImageData > m_cacheTile
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ getClassName()

ossimString ossimGeoPdfReader::getClassName ( ) const
virtual

Returns class name.

Returns
"ossimGeoPdfReader"

Reimplemented from ossimObject.

Definition at line 239 of file ossimGeoPdfReader.cpp.

Referenced by fillTile().

240 {
241  return ossimString("ossimGeoPdfReader");
242 }

◆ getEntryList()

void ossimGeoPdfReader::getEntryList ( std::vector< ossim_uint32 > &  entryList) const
virtual
Parameters
entryListThis is the list to initialize with entry indexes.
Note
This implementation returns puts one entry "0" in the list.

Reimplemented from ossimImageHandler.

Definition at line 734 of file ossimGeoPdfReader.cpp.

References ossimImageHandler::getEntryList(), getNumberOfEntries(), and m_pageVector.

735 {
736  if (m_pageVector.size() > 0)
737  {
738  for (ossim_uint32 i = 0; i < getNumberOfEntries(); i++)
739  {
740  entryList.push_back(i);
741  }
742  }
743  else
744  {
746  }
747 }
virtual ossim_uint32 getNumberOfEntries() const
unsigned int ossim_uint32
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector

◆ getGeoProjection()

ossimProjection * ossimGeoPdfReader::getGeoProjection ( )
private

Definition at line 991 of file ossimGeoPdfReader.cpp.

References getLGIDictGeoProjection(), getVPGeoProjection(), and m_isLGIDict.

992 {
993  if (m_isLGIDict)
994  {
995  return getLGIDictGeoProjection();
996  }
997  else
998  {
999  return getVPGeoProjection();
1000  }
1001  return NULL;
1002 }
ossimProjection * getLGIDictGeoProjection()
ossimProjection * getVPGeoProjection()

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimGeoPdfReader::getImageGeometry ( )
virtual

Returns the image geometry object associated with this tile source or NULL if non defined.

The geometry contains full-to-local image transform as well as projection (image-to-world).

Reimplemented from ossimImageHandler.

Definition at line 936 of file ossimGeoPdfReader.cpp.

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

937 {
938  if ( !theGeometry )
939  {
940  // Check for external geom:
942 
943  if ( !theGeometry.valid() )
944  {
945  // Internnal geom:
947 
948  if ( !theGeometry.valid() )
949  {
951  }
952 
953  // Check for set projection.
954  if ( !theGeometry->getProjection() )
955  {
956  // Try factories for projection.
958  }
959  }
960 
961  // Set image things the geometry object should know about.
963  }
964  return theGeometry;
965 }
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool extendGeometry(ossimImageHandler *handler) const
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
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).

◆ getImageTileHeight()

ossim_uint32 ossimGeoPdfReader::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::getTileHeight which returns the output tile height which can be different than the internal image tile height on disk.

Implements ossimImageHandler.

Definition at line 926 of file ossimGeoPdfReader.cpp.

927 {
928  return 0;
929 }

◆ getImageTileWidth()

ossim_uint32 ossimGeoPdfReader::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 921 of file ossimGeoPdfReader.cpp.

922 {
923  return 0;
924 }

◆ getInternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimGeoPdfReader::getInternalImageGeometry ( ) const
virtual
Parameters
Methodto get geometry.

Reimplemented from ossimImageHandler.

Definition at line 967 of file ossimGeoPdfReader.cpp.

References m_pageVector.

Referenced by getImageGeometry().

968 {
970  if (m_pageVector.size() > 0)
971  {
972  geom = m_pageVector[0]->m_geoImage;
973  }
974  return geom;
975 }
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector

◆ getIntersectingEntries()

std::vector< ossimGeoPdfReader::ossimFrameEntryData > ossimGeoPdfReader::getIntersectingEntries ( const ossimIrect rect)
protected

It is important to note that each frame is organized into an easting northing type orientation.

This means that a frame at 0,0 is at the lower left corner. Each frame's pixel data is has 0,0 at the upper left.

It will take the curent region to render and then find all entries that intersect that region.

Parameters
rectthe current region to render.
Returns
The list of entry data objects found for this rect.

Definition at line 1379 of file ossimGeoPdfReader.cpp.

References ossimIrect::clipToRect(), ossimImageHandler::getImageRectangle(), ossimIrect::intersects(), isOpen(), ossimIrect::lr(), m_frameEntryArray, m_frameHeightVector, m_frameWidthVector, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

1380 {
1381  std::vector<ossimFrameEntryData> result;
1382 
1383  // make sure we have the Toc entry to render
1384  if(!isOpen()) return result;
1385 
1386  ossimIrect imageRect = getImageRectangle();
1387  if(rect.intersects(imageRect))
1388  {
1389  ossimIrect clipRect = rect.clipToRect(imageRect);
1390  ossimIrect frameRect(clipRect.ul().x/m_frameWidthVector[0],
1391  clipRect.ul().y/m_frameHeightVector[0],
1392  clipRect.lr().x/m_frameWidthVector[0],
1393  clipRect.lr().y/m_frameHeightVector[0]);
1394 
1395  for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
1396  {
1397  for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
1398  {
1399  ossim_int32 pixelRow = 0;
1400  ossim_int32 pixelCol = 0;
1401  for (ossim_int32 iRow = 0; iRow < row; ++iRow)
1402  {
1403  pixelRow = pixelRow + m_frameHeightVector[iRow];
1404  }
1405  for (ossim_int32 iCol = 0; iCol < col; ++iCol)
1406  {
1407  pixelCol = pixelCol + m_frameWidthVector[iCol];
1408  }
1409  std::vector<PoDoFo::PdfObject*> tempEntry = m_frameEntryArray[row][col];
1410  if(tempEntry.size() > 0)
1411  {
1412  result.push_back(ossimFrameEntryData(row,
1413  col,
1414  pixelRow,
1415  pixelCol,
1416  tempEntry));
1417  }
1418  }
1419  }
1420  }
1421 
1422  return result;
1423 }
virtual bool isOpen() const
Method to test for open file stream.
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
std::vector< std::vector< std::vector< PoDoFo::PdfObject * > > > m_frameEntryArray
const ossimIpt & ul() const
Definition: ossimIrect.h:274
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
const ossimIpt & lr() const
Definition: ossimIrect.h:276
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ getLGIDictGeoProjection()

ossimProjection * ossimGeoPdfReader::getLGIDictGeoProjection ( )
private

Definition at line 1023 of file ossimGeoPdfReader.cpp.

References ossimString::empty(), getProjectionFromStr(), getValueFromMap(), and m_podofoProjInfo.

Referenced by getGeoProjection().

1024 {
1025  ossimProjection* proj = NULL;
1026  ossimString projContents = getValueFromMap(m_podofoProjInfo, "Projection");
1027  if (!projContents.empty())
1028  {
1029  proj = getProjectionFromStr(projContents);
1030  }
1031  return proj;
1032 }
ossimString getValueFromMap(std::map< ossimString, ossimString, ossimStringLtstr > info, ossimString key)
ossimProjection * getProjectionFromStr(ossimString projContents)
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
bool empty() const
Definition: ossimString.h:411

◆ getLongName()

ossimString ossimGeoPdfReader::getLongName ( ) const
virtual

Returns long name.

Returns
"ossim mrsid reader"

Reimplemented from ossimObject.

Definition at line 234 of file ossimGeoPdfReader.cpp.

235 {
236  return ossimString("ossim geopdf reader");
237 }

◆ getNumberOfEntries()

ossim_uint32 ossimGeoPdfReader::getNumberOfEntries ( ) const
virtual
Returns
The number of entries (images) in the image file.

Reimplemented from ossimImageHandler.

Definition at line 729 of file ossimGeoPdfReader.cpp.

References m_pageVector.

Referenced by getEntryList().

730 {
731  return (ossim_uint32)m_pageVector.size();
732 }
unsigned int ossim_uint32
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector

◆ getNumberOfInputBands()

ossim_uint32 ossimGeoPdfReader::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 911 of file ossimGeoPdfReader.cpp.

References m_numberOfBands.

912 {
913  return m_numberOfBands;
914 }
ossim_uint32 m_numberOfBands
Has sub image offset.

◆ getNumberOfLines()

ossim_uint32 ossimGeoPdfReader::getNumberOfLines ( ossim_uint32  resLevel = 0) const
virtual

Gets number of lines for res level.

Parameters
resLevelReduced resolution level to return lines of. Default = 0
Returns
The number of lines for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 244 of file ossimGeoPdfReader.cpp.

References ossimImageHandler::getNumberOfLines(), m_numberOfLines, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

246 {
247  if (resLevel == 0)
248  {
249  return m_numberOfLines;
250  }
251  else if ( theOverview.valid() )
252  {
253  return theOverview->getNumberOfLines(resLevel);
254  }
255 
256  return 0;
257 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossimRefPtr< ossimImageHandler > theOverview
ossim_uint32 m_numberOfLines

◆ getNumberOfOutputBands()

ossim_uint32 ossimGeoPdfReader::getNumberOfOutputBands ( ) const
virtual

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

Note: we are supporting sources that can have multiple data objects. If you want to know the scalar type of an object you can pass in the

Reimplemented from ossimImageSource.

Definition at line 916 of file ossimGeoPdfReader.cpp.

References m_numberOfBands.

Referenced by getTile().

917 {
918  return m_numberOfBands;
919 }
ossim_uint32 m_numberOfBands
Has sub image offset.

◆ getNumberOfSamples()

ossim_uint32 ossimGeoPdfReader::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
virtual

Gets the number of samples for res level.

Parameters
resLevelReduced resolution level to return samples of. Default = 0
Returns
The number of samples for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 259 of file ossimGeoPdfReader.cpp.

References ossimImageHandler::getNumberOfSamples(), m_numberOfSamples, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

261 {
262  if (resLevel == 0)
263  {
264  return m_numberOfSamples;
265  }
266  else if ( theOverview.valid() )
267  {
268  return theOverview->getNumberOfSamples(resLevel);
269  }
270 
271  return 0;
272 }
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 m_numberOfSamples
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getOutputScalarType()

ossimScalarType ossimGeoPdfReader::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 931 of file ossimGeoPdfReader.cpp.

References m_scalarType.

932 {
933  return m_scalarType;
934 }
ossimScalarType m_scalarType

◆ getProjectionFromStr()

ossimProjection * ossimGeoPdfReader::getProjectionFromStr ( ossimString  projContents)
private

Definition at line 1425 of file ossimGeoPdfReader.cpp.

References ossimString::contains(), ossimString::empty(), getValueFromMap(), ossimString::split(), ossimString::substitute(), and ossimString::trim().

Referenced by getLGIDictGeoProjection().

1426 {
1427  std::vector<ossimString> tmpVector = projContents.split("\n");
1428  std::map<ossimString, ossimString, ossimStringLtstr> projectionMap;
1429 
1430  for (ossim_uint32 i = 0; i < tmpVector.size(); i++)
1431  {
1432  ossimString tmpStr = tmpVector[i];
1433  if (tmpStr.contains("/"))
1434  {
1435  std::vector<ossimString> tmpKeyValue = tmpStr.split(" ");
1436  ossimString key;
1437  ossimString valueStr;
1438  for (ossim_uint32 j = 0; j < tmpKeyValue.size(); j++)
1439  {
1440  if (tmpKeyValue[j].contains("/"))
1441  {
1442  key = tmpKeyValue[j].substitute("/", "", true).trim();
1443  }
1444  else
1445  {
1446  valueStr = tmpKeyValue[j].substitute(")", "", true).trim();
1447  valueStr = valueStr.substitute("(", "", true).trim();
1448  }
1449  }
1450  if (!key.empty() && !valueStr.empty())
1451  {
1452  projectionMap[key] = valueStr;
1453  }
1454  }
1455  }
1456 
1457  ossimString projCode = getValueFromMap(projectionMap, "ProjectionType");
1458  ossimString datumCode = getValueFromMap(projectionMap, "Datum");
1459 
1460  ossimString originLatitudeStr = getValueFromMap(projectionMap, originLatKey);
1461  ossimString centralMeridianStr = getValueFromMap(projectionMap, centralMeridianKey);
1462  ossimString standardParallelOneStr = getValueFromMap(projectionMap, standardParallelOneKey);
1463  ossimString standardParallelTwoStr = getValueFromMap(projectionMap, standardParallelTwoKey);
1464  ossimString falseEastingStr = getValueFromMap(projectionMap, falseEastingKey);
1465  ossimString falseNorthingStr = getValueFromMap(projectionMap, falseNorthingKey);
1466  ossimString scaleFactorStr = getValueFromMap(projectionMap, scaleFactorKey);
1467 
1468  if (projCode == "GEODETIC" || projCode == "GEOGRAPHIC")
1469  {
1470  ossimString codeName = "EPSG:4326";
1471  if (datumCode == "WD")
1472  {
1473  codeName = "EPSG:4322";
1474  }
1476  return proj;
1477  }
1478  else if (projCode == "UT")
1479  {
1480  ossimString zoneStr = getValueFromMap(projectionMap, zoneKey);
1481  ossimString hemisphereStr = getValueFromMap(projectionMap, hemisphereKey);
1482  ossimUtmProjection* utm = new ossimUtmProjection(zoneStr.toInt32());
1483  if (!datumCode.empty())
1484  {
1485  utm->setDatum(ossimDatumFactory::instance()->create(datumCode));
1486  }
1487 
1488  if (!zoneStr.empty())
1489  {
1490  utm->setZone(zoneStr.toInt32());
1491  }
1492 
1493  if (!hemisphereStr.empty())
1494  {
1495  utm->setHemisphere(*hemisphereStr.c_str());
1496  }
1497 
1498  return utm;
1499  }
1500  else if (projCode == "UP")
1501  {
1502  ossimString hemiStr = getValueFromMap(projectionMap, hemisphereKey);
1504 
1505  if (!datumCode.empty())
1506  {
1507  ups->setDatum(ossimDatumFactory::instance()->create(datumCode));
1508  }
1509 
1510  if (!hemiStr.empty())
1511  {
1512  ups->setHemisphere(*hemiStr.c_str());
1513  }
1514 
1515  return ups;
1516  }
1517  else if (projCode == "SPCS")
1518  {
1519  ossimString zoneStr = getValueFromMap(projectionMap, zoneKey);
1520 
1521  ossimString spcsCode;
1522  if (datumCode.upcase().contains("NAR"))
1523  {
1524  spcsCode = ossimString("NAD83_" + projCode + "_" + zoneStr);
1525  }
1526  else if (datumCode.upcase().contains("NAS"))
1527  {
1528  spcsCode = ossimString("NAD83_SPAF_" + zoneStr);
1529  }
1530 
1531  // State plane projections are represented in the EPSG database. Search for corresponding proj
1532  // by name. Name needs to be exact match as found in the EPSG database files:
1534  if (stateProj)
1535  {
1536  return stateProj;
1537  }
1538  }
1539  else if (projCode == "AC")
1540  {
1541  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1542 
1544 
1545  if (!datumCode.empty())
1546  {
1547  albers->setDatum(ossimDatumFactory::instance()->create(datumCode));
1548  }
1549 
1550  if (!origin.isNan())
1551  {
1552  albers->setOrigin(origin);
1553  }
1554 
1555  if (!standardParallelOneStr.empty())
1556  {
1557  albers->setStandardParallel1(standardParallelOneStr.toDouble());
1558  }
1559 
1560  if (!standardParallelTwoStr.empty())
1561  {
1562  albers->setStandardParallel2(standardParallelTwoStr.toDouble());
1563  }
1564 
1565  if (!falseEastingStr.empty())
1566  {
1567  albers->setFalseEasting(falseEastingStr.toDouble());
1568  }
1569 
1570  if (!falseNorthingStr.empty())
1571  {
1572  albers->setFalseNorthing(falseNorthingStr.toDouble());
1573  }
1574 
1575  return albers;
1576  }
1577  else if (projCode == "AL")
1578  {
1580 
1581  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1582 
1583  if (!datumCode.empty())
1584  {
1585  azimEqud->setDatum(ossimDatumFactory::instance()->create(datumCode));
1586  }
1587 
1588  if (!origin.isNan())
1589  {
1590  azimEqud->setOrigin(origin);
1591  }
1592 
1593  if (!falseEastingStr.empty())
1594  {
1595  azimEqud->setFalseEasting(falseEastingStr.toDouble());
1596  }
1597 
1598  if (!falseNorthingStr.empty())
1599  {
1600  azimEqud->setFalseNorthing(falseNorthingStr.toDouble());
1601  }
1602 
1603  return azimEqud;
1604  }
1605  else if (projCode == "BF")
1606  {
1608 
1609  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1610 
1611  if (!datumCode.empty())
1612  {
1613  bonne->setDatum(ossimDatumFactory::instance()->create(datumCode));
1614  }
1615 
1616  if (!origin.isNan())
1617  {
1618  bonne->setOrigin(origin);
1619  }
1620 
1621  if (!falseEastingStr.empty())
1622  {
1623  bonne->setFalseEasting(falseEastingStr.toDouble());
1624  }
1625 
1626  if (!falseNorthingStr.empty())
1627  {
1628  bonne->setFalseNorthing(falseNorthingStr.toDouble());
1629  }
1630 
1631  return bonne;
1632  }
1633  else if (projCode == "CS")
1634  {
1636 
1637  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1638 
1639  if (!datumCode.empty())
1640  {
1641  cassin->setDatum(ossimDatumFactory::instance()->create(datumCode));
1642  }
1643 
1644  if (!origin.isNan())
1645  {
1646  cassin->setOrigin(origin);
1647  }
1648 
1649  if (!falseEastingStr.empty())
1650  {
1651  cassin->setFalseEasting(falseEastingStr.toDouble());
1652  }
1653 
1654  if (!falseNorthingStr.empty())
1655  {
1656  cassin->setFalseNorthing(falseNorthingStr.toDouble());
1657  }
1658 
1659  return cassin;
1660  }
1661  else if (projCode == "LI")
1662  {
1664 
1665  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1666 
1667  if (!datumCode.empty())
1668  {
1669  cyeq->setDatum(ossimDatumFactory::instance()->create(datumCode));
1670  }
1671 
1672  if (!origin.isNan())
1673  {
1674  cyeq->setOrigin(origin);
1675  }
1676 
1677  if (!falseEastingStr.empty())
1678  {
1679  cyeq->setFalseEasting(falseEastingStr.toDouble());
1680  }
1681 
1682  if (!falseNorthingStr.empty())
1683  {
1684  cyeq->setFalseNorthing(falseNorthingStr.toDouble());
1685  }
1686 
1687  return cyeq;
1688  }
1689  else if (projCode == "EF")
1690  {
1692 
1693  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1694 
1695  if (!datumCode.empty())
1696  {
1697  ecker4->setDatum(ossimDatumFactory::instance()->create(datumCode));
1698  }
1699 
1700  if (!origin.isNan())
1701  {
1702  ecker4->setOrigin(origin);
1703  }
1704 
1705  if (!falseEastingStr.empty())
1706  {
1707  ecker4->setFalseEasting(falseEastingStr.toDouble());
1708  }
1709 
1710  if (!falseNorthingStr.empty())
1711  {
1712  ecker4->setFalseNorthing(falseNorthingStr.toDouble());
1713  }
1714 
1715  return ecker4;
1716  }
1717  else if (projCode == "ED")
1718  {
1720 
1721  if (!datumCode.empty())
1722  {
1723  ecker6->setDatum(ossimDatumFactory::instance()->create(datumCode));
1724  }
1725 
1726  if (!centralMeridianStr.empty())
1727  {
1728  ecker6->setCentralMeridian(centralMeridianStr.toDouble());
1729  }
1730 
1731  if (!falseEastingStr.empty())
1732  {
1733  ecker6->setFalseEasting(falseEastingStr.toDouble());
1734  }
1735 
1736  if (!falseNorthingStr.empty())
1737  {
1738  ecker6->setFalseNorthing(falseNorthingStr.toDouble());
1739  }
1740 
1741  return ecker6;
1742  }
1743  else if (projCode == "GN")
1744  {
1746 
1747  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1748 
1749  if (!datumCode.empty())
1750  {
1751  gnomon->setDatum(ossimDatumFactory::instance()->create(datumCode));
1752  }
1753 
1754  if (!origin.isNan())
1755  {
1756  gnomon->setOrigin(origin);
1757  }
1758 
1759  if (!falseEastingStr.empty())
1760  {
1761  gnomon->setFalseEasting(falseEastingStr.toDouble());
1762  }
1763 
1764  if (!falseNorthingStr.empty())
1765  {
1766  gnomon->setFalseNorthing(falseNorthingStr.toDouble());
1767  }
1768 
1769  return gnomon;
1770  }
1771  else if (projCode == "LE")
1772  {
1773  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1774 
1776 
1777  if (!datumCode.empty())
1778  {
1779  lamber->setDatum(ossimDatumFactory::instance()->create(datumCode));
1780  }
1781 
1782  if (!origin.isNan())
1783  {
1784  lamber->setOrigin(origin);
1785  }
1786 
1787  if (!standardParallelOneStr.empty())
1788  {
1789  lamber->setStandardParallel1(standardParallelOneStr.toDouble());
1790  }
1791 
1792  if (!standardParallelTwoStr.empty())
1793  {
1794  lamber->setStandardParallel2(standardParallelTwoStr.toDouble());
1795  }
1796 
1797  if (!falseEastingStr.empty())
1798  {
1799  lamber->setFalseEasting(falseEastingStr.toDouble());
1800  }
1801 
1802  if (!falseNorthingStr.empty())
1803  {
1804  lamber->setFalseNorthing(falseNorthingStr.toDouble());
1805  }
1806 
1807  return lamber;
1808  }
1809  else if (projCode == "MC")
1810  {
1812 
1813  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1814 
1815  if (!datumCode.empty())
1816  {
1817  mercator->setDatum(ossimDatumFactory::instance()->create(datumCode));
1818  }
1819 
1820  if (!origin.isNan())
1821  {
1822  mercator->setOrigin(origin);
1823  }
1824 
1825  if (!scaleFactorStr.empty())
1826  {
1827  mercator->setScaleFactor(scaleFactorStr.toDouble());
1828  }
1829 
1830  if (!falseEastingStr.empty())
1831  {
1832  mercator->setFalseEasting(falseEastingStr.toDouble());
1833  }
1834 
1835  if (!falseNorthingStr.empty())
1836  {
1837  mercator->setFalseNorthing(falseNorthingStr.toDouble());
1838  }
1839 
1840  return mercator;
1841  }
1842  else if (projCode == "MH")
1843  {
1845 
1846  if (!datumCode.empty())
1847  {
1848  miller->setDatum(ossimDatumFactory::instance()->create(datumCode));
1849  }
1850 
1851  if (!centralMeridianStr.empty())
1852  {
1853  miller->setCentralMeridian(centralMeridianStr.toDouble());
1854  }
1855 
1856  if (!falseEastingStr.empty())
1857  {
1858  miller->setFalseEasting(falseEastingStr.toDouble());
1859  }
1860 
1861  if (!falseNorthingStr.empty())
1862  {
1863  miller->setFalseNorthing(falseNorthingStr.toDouble());
1864  }
1865 
1866  return miller;
1867  }
1868  else if (projCode == "MP")
1869  {
1871 
1872  if (!datumCode.empty())
1873  {
1874  mollweid->setDatum(ossimDatumFactory::instance()->create(datumCode));
1875  }
1876 
1877  if (!centralMeridianStr.empty())
1878  {
1879  mollweid->setCentralMeridian(centralMeridianStr.toDouble());
1880  }
1881 
1882  if (!falseEastingStr.empty())
1883  {
1884  mollweid->setFalseEasting(falseEastingStr.toDouble());
1885  }
1886 
1887  if (!falseNorthingStr.empty())
1888  {
1889  mollweid->setFalseNorthing(falseNorthingStr.toDouble());
1890  }
1891 
1892  return mollweid;
1893  }
1894  else if (projCode == "NT")
1895  {
1897  if (!datumCode.empty())
1898  {
1899  newzealand->setDatum(ossimDatumFactory::instance()->create(datumCode));
1900  }
1901  return newzealand;
1902  }
1903  else if (projCode == "OC")
1904  {
1905  ossimString latOne = getValueFromMap(projectionMap, latitudeOneKey);
1906  ossimString lonOne = getValueFromMap(projectionMap, longitudeOneKey);
1907  ossimString latTwo = getValueFromMap(projectionMap, latitudeTwoKey);
1908  ossimString lonTwo = getValueFromMap(projectionMap, longitudeTwoKey);
1909 
1911 
1912  ossimGpt origin1(latOne.toDouble(), lonOne.toDouble());
1913  ossimGpt origin2(latTwo.toDouble(), lonTwo.toDouble());
1914 
1915  if (!datumCode.empty())
1916  {
1917  oblique->setDatum(ossimDatumFactory::instance()->create(datumCode));
1918  }
1919 
1920  if (!origin1.isNan())
1921  {
1922  oblique->setCentralPoint1(origin1);
1923  }
1924 
1925  if (!origin2.isNan())
1926  {
1927  oblique->setCentralPoint2(origin2);
1928  }
1929 
1930  if (!scaleFactorStr.empty())
1931  {
1932  oblique->setScaleFactor(scaleFactorStr.toDouble());
1933  }
1934 
1935  if (!falseEastingStr.empty())
1936  {
1937  oblique->setFalseEasting(falseEastingStr.toDouble());
1938  }
1939 
1940  if (!falseNorthingStr.empty())
1941  {
1942  oblique->setFalseNorthing(falseNorthingStr.toDouble());
1943  }
1944 
1945  return oblique;
1946  }
1947  else if (projCode == "PG")
1948  {
1949  ossimString originLat = getValueFromMap(projectionMap, "LatitudeTrueScale");
1950  ossimString originLon = getValueFromMap(projectionMap, "LongitudeDownFromPole");
1951  ossimGpt origin(originLat.toDouble(), originLon.toDouble());
1952 
1954 
1955  if (!datumCode.empty())
1956  {
1957  polar->setDatum(ossimDatumFactory::instance()->create(datumCode));
1958  }
1959 
1960  if (!origin.isNan())
1961  {
1962  polar->setOrigin(origin);
1963  }
1964 
1965  if (!falseEastingStr.empty())
1966  {
1967  polar->setFalseEasting(falseEastingStr.toDouble());
1968  }
1969 
1970  if (!falseNorthingStr.empty())
1971  {
1972  polar->setFalseNorthing(falseNorthingStr.toDouble());
1973  }
1974 
1975  return polar;
1976  }
1977  else if (projCode == "PH")
1978  {
1980 
1981  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
1982 
1983  if (!datumCode.empty())
1984  {
1985  polyconic->setDatum(ossimDatumFactory::instance()->create(datumCode));
1986  }
1987 
1988  if (!origin.isNan())
1989  {
1990  polyconic->setOrigin(origin);
1991  }
1992 
1993  if (!falseEastingStr.empty())
1994  {
1995  polyconic->setFalseEasting(falseEastingStr.toDouble());
1996  }
1997 
1998  if (!falseNorthingStr.empty())
1999  {
2000  polyconic->setFalseNorthing(falseNorthingStr.toDouble());
2001  }
2002 
2003  return polyconic;
2004  }
2005  else if (projCode == "SA")
2006  {
2008 
2009  if (!datumCode.empty())
2010  {
2011  sinusoidal->setDatum(ossimDatumFactory::instance()->create(datumCode));
2012  }
2013 
2014  if (!centralMeridianStr.empty())
2015  {
2016  sinusoidal->setCentralMeridian(centralMeridianStr.toDouble());
2017  }
2018 
2019  if (!falseEastingStr.empty())
2020  {
2021  sinusoidal->setFalseEasting(falseEastingStr.toDouble());
2022  }
2023 
2024  if (!falseNorthingStr.empty())
2025  {
2026  sinusoidal->setFalseNorthing(falseNorthingStr.toDouble());
2027  }
2028 
2029  return sinusoidal;
2030  }
2031  else if (projCode == "SD")
2032  {
2034 
2035  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
2036 
2037  if (!datumCode.empty())
2038  {
2039  stereo->setDatum(ossimDatumFactory::instance()->create(datumCode));
2040  }
2041 
2042  if (!origin.isNan())
2043  {
2044  stereo->setOrigin(origin);
2045  }
2046 
2047  if (!falseEastingStr.empty())
2048  {
2049  stereo->setFalseEasting(falseEastingStr.toDouble());
2050  }
2051 
2052  if (!falseNorthingStr.empty())
2053  {
2054  stereo->setFalseNorthing(falseNorthingStr.toDouble());
2055  }
2056 
2057  return stereo;
2058  }
2059  else if (projCode == "TC")
2060  {
2062 
2063  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
2064 
2065  if (!datumCode.empty())
2066  {
2067  trans->setDatum(ossimDatumFactory::instance()->create(datumCode));
2068  }
2069 
2070  if (!origin.isNan())
2071  {
2072  trans->setOrigin(origin);
2073  }
2074 
2075  if (!scaleFactorStr.empty())
2076  {
2077  trans->setScaleFactor(scaleFactorStr.toDouble());
2078  }
2079 
2080  if (!falseEastingStr.empty())
2081  {
2082  trans->setFalseEasting(falseEastingStr.toDouble());
2083  }
2084 
2085  if (!falseNorthingStr.empty())
2086  {
2087  trans->setFalseNorthing(falseNorthingStr.toDouble());
2088  }
2089 
2090  return trans;
2091  }
2092  else if (projCode == "TX")
2093  {
2095 
2096  ossimGpt origin(originLatitudeStr.toDouble(), centralMeridianStr.toDouble());
2097 
2098  if (!datumCode.empty())
2099  {
2100  transCyl->setDatum(ossimDatumFactory::instance()->create(datumCode));
2101  }
2102 
2103  if (!origin.isNan())
2104  {
2105  transCyl->setOrigin(origin);
2106  }
2107 
2108  if (!scaleFactorStr.empty())
2109  {
2110  transCyl->setScaleFactor(scaleFactorStr.toDouble());
2111  }
2112 
2113  if (!falseEastingStr.empty())
2114  {
2115  transCyl->setFalseEasting(falseEastingStr.toDouble());
2116  }
2117 
2118  if (!falseNorthingStr.empty())
2119  {
2120  transCyl->setFalseNorthing(falseNorthingStr.toDouble());
2121  }
2122 
2123  return transCyl;
2124  }
2125  else if (projCode == "VA")
2126  {
2128 
2129  if (!datumCode.empty())
2130  {
2131  vander->setDatum(ossimDatumFactory::instance()->create(datumCode));
2132  }
2133 
2134  if (!centralMeridianStr.empty())
2135  {
2136  vander->setCentralMeridian(centralMeridianStr.toDouble());
2137  }
2138 
2139  if (!falseEastingStr.empty())
2140  {
2141  vander->setFalseEasting(falseEastingStr.toDouble());
2142  }
2143 
2144  if (!falseNorthingStr.empty())
2145  {
2146  vander->setFalseNorthing(falseNorthingStr.toDouble());
2147  }
2148 
2149  return vander;
2150  }
2151  else
2152  {
2153  if (traceDebug())
2154  {
2156  << "ossimGeoPdfReader: No projection information. \n"
2157  << std::endl;
2158  }
2159  }
2160 
2161  return NULL;
2162 }
void setFalseEasting(double falseEasting)
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
void setFalseNorthing(double falseNorthing)
void setFalseEasting(double falseEasting)
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
void setFalseNorthing(double falseNorthing)
void setCentralMeridian(double centralMeridian)
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
bool contains(char aChar) const
Definition: ossimString.h:58
void setFalseEasting(double falseEasting)
void setFalseNorthing(double falseNorthing)
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
void setFalseEasting(double falseEasting)
void setFalseEasting(double falseEasting)
void setFalseEasting(double falseEasting)
void setCentralMeridian(double centralMeridian)
void setFalseEasting(double falseEasting)
void setFalseNorthing(double falseNorthing)
ossim_int32 toInt32() const
void setFalseNorthing(double falseNorthing)
Albers Equal Area Conic Projection.
void setFalseNorthing(double falseNorthing)
void setCentralMeridian(double centralMeridian)
void setScaleFactor(double scaleFactor)
void setFalseNorthing(double falseNorthing)
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
double toDouble() const
static ossimDatumFactory * instance()
ossimString getValueFromMap(std::map< ossimString, ossimString, ossimStringLtstr > info, ossimString key)
void setFalseNorthing(double falseNorthing)
void setFalseNorthing(double falseNorthing)
void setFalseEasting(double falseEasting)
void setFalseEasting(double falseEasting)
void setZone(const ossimGpt &ground)
void setFalseEasting(double falseEasting)
void setFalseNorthing(double falseNorthing)
void setFalseNorthing(double falseNorthing)
void setFalseNorthing(double falseNorthing)
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
bool empty() const
Definition: ossimString.h:411
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
void setHemisphere(char hemisphere)
void setFalseEasting(double falseEasting)
void setFalseNorthing(double falseNorthing)
virtual void setDatum(const ossimDatum *datum)
Sets theDatum to datum.
void setCentralMeridian(double centralMeridian)
void setFalseEasting(double falseEasting)
void setHemisphere(const ossimGpt &ground)
void setCentralMeridian(double centralMeridian)
void setFalseNorthing(double falseNorthing)
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setFalseNorthing(double falseNorthing)

◆ getShortName()

ossimString ossimGeoPdfReader::getShortName ( ) const
virtual

Returns short name.

Returns
"ossim_mrsid_reader"

Reimplemented from ossimObject.

Definition at line 229 of file ossimGeoPdfReader.cpp.

230 {
231  return ossimString("ossim_geopdf_reader");
232 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimGeoPdfReader::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual

Method to grab a tile(rectangle) from image.

Parameters
rectThe zero based rectangle to grab.
resLevelThe reduced resolution level to grab from.
Returns
The ref pointer with the image data pointer.

Reimplemented from ossimImageSource.

Definition at line 749 of file ossimGeoPdfReader.cpp.

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

751 {
752  if (m_tile.valid())
753  {
754  // Image rectangle must be set prior to calling getTile.
755  m_tile->setImageRectangle(rect);
756 
757  if ( getTile( m_tile.get(), resLevel ) == false )
758  {
760  {
761  m_tile->makeBlank();
762  }
763  }
764  }
765 
766  return m_tile;
767 }
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Method to grab a tile(rectangle) from image.
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageData > m_tile

◆ getTile() [2/2]

bool ossimGeoPdfReader::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 769 of file ossimGeoPdfReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), fillTile(), ossimImageData::getImageRectangle(), ossimImageHandler::getImageRectangle(), getIntersectingEntries(), ossimImageData::getNumberOfBands(), getNumberOfOutputBands(), ossimImageHandler::getOverviewTile(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), m_currentRow, ossimImageData::makeBlank(), ossimReferenced::ref(), resetCacheBuffer(), status, and ossimReferenced::unref().

771 {
772  bool status = false;
773 
774  //---
775  // Not open, this tile source bypassed, or invalid res level,
776  // return a blank tile.
777  //---
778  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
779  result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
780  {
781  result->ref(); // Increment ref count.
782 
783  //---
784  // Check for overview tile. Some overviews can contain r0 so always
785  // call even if resLevel is 0. Method returns true on success, false
786  // on error.
787  //---
788  status = getOverviewTile(resLevel, result);
789 
790  if (!status) // Did not get an overview tile.
791  {
792  status = true;
793 
794  ossimIrect tile_rect = result->getImageRectangle();
795 
796  if (getImageRectangle().intersects(tile_rect))
797  {
798  // Make a clip rect.
799  ossimIrect clip_rect = tile_rect.clipToRect(getImageRectangle());
800 
801  std::vector<ossimFrameEntryData> frames = getIntersectingEntries(clip_rect);
802 
803  if (!tile_rect.completely_within(getImageRectangle()) )
804  {
805  result->makeBlank();
806  }
807 
808  for(ossim_uint32 idx = 0; idx < frames.size(); ++idx)
809  {
810  resetCacheBuffer(frames[idx]);
811  m_currentRow = frames[idx].theRow;
812 
813  fillTile(ossim_uint8(0), clip_rect, result);
814  }
815  }
816  else // No intersection...
817  {
818  result->makeBlank();
819  }
820  }
821 
822  result->unref(); // Decrement ref count.
823  }
824 
825  return status;
826 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
void resetCacheBuffer(ossimFrameEntryData entry)
virtual ossim_uint32 getNumberOfBands() const
virtual bool isOpen() const
Method to test for open file stream.
ossim_int32 m_currentRow
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.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
std::vector< ossimFrameEntryData > getIntersectingEntries(const ossimIrect &rect)
It is important to note that each frame is organized into an easting northing type orientation...
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
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...
return status
virtual void makeBlank()
Initializes data to null pixel values.
unsigned char ossim_uint8
void fillTile(T, const ossimIrect &clip_rect, ossimImageData *tile)

◆ getVPGeoProjection()

ossimProjection * ossimGeoPdfReader::getVPGeoProjection ( )
private

Definition at line 1004 of file ossimGeoPdfReader.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimEpsgProjectionFactory::createProjection(), ossimString::empty(), getValueFromMap(), ossimEpsgProjectionFactory::instance(), m_podofoProjInfo, ossimKeywordNames::PCS_CODE_KW, and ossimString::toString().

Referenced by getGeoProjection().

1005 {
1006  ossimKeywordlist kwl;
1007  ossimString pfx = "image";
1008  pfx += ossimString::toString(0);
1009  pfx += ".";
1010 
1011  ossimProjection* proj = NULL;
1012 
1013  ossimString projCode = getValueFromMap(m_podofoProjInfo, "EPSG");
1014  if (!projCode.empty())
1015  {
1016  kwl.add(pfx.c_str(), ossimKeywordNames::PCS_CODE_KW, projCode, true);
1017  projCode = ossimString("EPSG:") + projCode;
1019  }
1020  return proj;
1021 }
Represents serializable keyword/value map.
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimString getValueFromMap(std::map< ossimString, ossimString, ossimStringLtstr > info, ossimString key)
static const char * PCS_CODE_KW
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
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
bool empty() const
Definition: ossimString.h:411
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.

◆ isOpen()

bool ossimGeoPdfReader::isOpen ( ) const
virtual

Method to test for open file stream.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 660 of file ossimGeoPdfReader.cpp.

References ossimString::downcase(), ossimFilename::ext(), and ossimImageHandler::theImageFile.

Referenced by getIntersectingEntries(), and getTile().

661 {
663 
664  if(ext == "pdf")
665  {
666  return true;
667  }
668  else
669  {
670  return false;
671  }
672 }
ossimFilename theImageFile
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ loadState()

bool ossimGeoPdfReader::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.

Reimplemented from ossimImageHandler.

Definition at line 977 of file ossimGeoPdfReader.cpp.

References ossimKeywordlist::find(), ossimImageHandler::loadState(), open(), and ossimKeywordNames::TYPE_KW.

978 {
979  bool result = false;
980  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
981  if( (type == "ossimGeoPdfReader") || (type == "ossimImageHandler") )
982  {
983  if ( ossimImageHandler::loadState(kwl, prefix) )
984  {
985  result = open();
986  }
987  }
988  return result;
989 }
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.
static const char * TYPE_KW
virtual bool open()
Open method.

◆ open()

bool ossimGeoPdfReader::open ( )
virtual

Open method.

Returns
true on success, false on error.

Implements ossimImageHandler.

Definition at line 274 of file ossimGeoPdfReader.cpp.

Referenced by loadState().

275 {
276  static const char MODULE[] = "ossimGeoPdfReader::open";
277 
278  if (traceDebug())
279  {
281  << MODULE << " entered...\n"
282  << "image: " << theImageFile << "\n";
283  }
284 
285  bool result = false;
286  closeEntry();
287 
288  if ( theImageFile.size() )
289  {
290  PoDoFo::PdfError::EnableDebug(false);//do not print out debug info
291 
292  try
293  {
294  m_pdfMemDocument = new PoDoFo::PdfMemDocument(theImageFile.c_str());
295  }
296  catch (...)
297  {
298  return false;
299  }
300 
301  if (m_pdfMemDocument != NULL)
302  {
303  int count = m_pdfMemDocument->GetPageCount();
304  for(int i = 0; i < count; ++i)
305  {
306  PoDoFo::PdfPage* pdfPage = m_pdfMemDocument->GetPage(i);
307  if( pdfPage )
308  {
309  PoDoFo::PdfObject* pdfObject = pdfPage->GetObject();
310  PoDoFo::PdfObject* geoPdfObject = NULL;
311  if( pdfObject->GetDictionary().HasKey(PoDoFo::PdfName("LGIDict") ) )
312  {
313  geoPdfObject = pdfObject->GetDictionary().GetKey(PoDoFo::PdfName("LGIDict"));
314  m_isLGIDict = true;
315  }
316  else if (pdfObject->GetDictionary().HasKey(PoDoFo::PdfName("VP") ))
317  {
318  geoPdfObject = pdfObject->GetDictionary().GetKey(PoDoFo::PdfName("VP"));
319  }
320 
321  if (geoPdfObject)
322  {
323  std::string imagInfo; //try to get tile structure information
324  geoPdfObject->ToString(imagInfo);
325  ossimString imagInfoStr = imagInfo;
326 
327  if (imagInfoStr.downcase().contains("tile") == false)//if not, try to get tile structure info from source object
328  {
329  PoDoFo::PdfObject* pSource = pdfPage->GetResources();
330  pSource->ToString(imagInfo);
331  imagInfoStr = imagInfo;
332  }
333  std::vector<ossimString> imageInfoVector;
334  imageInfoVector.push_back(imagInfoStr);
335  parseTileStructure(imageInfoVector);
338  setPodofoInfo(geoPdfObject);
339  }
340  else
341  {
342  continue;
343  }
344 
345  // Create the geometry.
347  geoImage->setProjection(getGeoProjection());
349 
350  // Create the node.
352  node->setGeoImage(geoImage);
353  node->setBoundingBox(computeBoundingRect(geoImage));
354 
355  // Add to array.
356  m_pageVector.push_back(node);
357 
358  m_pdfMemDocument->FreeObjectMemory(pdfObject);
359  }
360 
361  } // Matches: for(int i = 0; i < count; ++i)
362 
363  if ( m_pageVector.size() )
364  {
365  result = true;
366  }
367  }
368 
370  m_tile->initialize();
373 
376 
379 
380  completeOpen();
381 
382  if (result == false)
383  {
384  closeEntry();
385  }
386 
387  } // Matches: if ( theImageFile.size() )
388 
389  return result;
390 }
virtual void deleteCache(ossimAppFixedCacheId cacheId)
PoDoFo::PdfMemDocument * m_pdfMemDocument
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
ossimFilename theImageFile
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
bool contains(char aChar) const
Definition: ossimString.h:58
ossimDrect computeBoundingRect(ossimRefPtr< ossimImageGeometry > geoImage)
ossim_uint32 m_numberOfSamples
void setImageSize(const ossimIpt &size)
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
virtual void initialize()
Initialize the data buffer.
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
virtual ossimObject * dup() const
virtual void closeEntry()
Method to close current entry.
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
static ossimImageDataFactory * instance()
void setBoundingBox(const ossimDrect &bounds)
std::string::size_type size() const
Definition: ossimString.h:405
void parseTileStructure(std::vector< ossimString > tileInfo)
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossimRefPtr< ossimImageData > m_cacheTile
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
virtual void completeOpen()
Will complete the opening process.
ossim_int32 y
Definition: ossimIpt.h:142
void setPodofoInfo(PoDoFo::PdfObject *object)
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
void setGeoImage(ossimRefPtr< ossimImageGeometry > image)
ossim_int32 x
Definition: ossimIpt.h:141
ossim_uint32 m_numberOfLines
ossimAppFixedCacheId newTileCache(const ossimIrect &tileBoundaryRect, const ossimIpt &tileSize=ossimIpt(0, 0))
ossimRefPtr< ossimImageData > m_tile
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimProjection * getGeoProjection()

◆ parseTileStructure()

void ossimGeoPdfReader::parseTileStructure ( std::vector< ossimString tileInfo)
private

Definition at line 392 of file ossimGeoPdfReader.cpp.

References buildTileInfo(), ossimString::contains(), ossimString::downcase(), and m_podofoTileInfo.

Referenced by setPodofoImageInfo().

393 {
394  m_podofoTileInfo.clear();
395  std::vector<ossimString> tileInfoVector;
396  for (ossim_uint32 index = 0; index < tileInfo.size(); ++index)
397  {
398  std::vector<ossimString> tmpVector = tileInfo[index].split("\n");
399  for (ossim_uint32 i = 0; i < tmpVector.size(); i++)
400  {
401  ossimString tmpStr = tmpVector[i];
402  if (tmpStr.downcase().contains("layer_"))
403  {
404  buildTileInfo(tmpStr);
405  }
406  else if (tmpStr.downcase().contains("tile"))
407  {
408  tileInfoVector.push_back(tmpStr);
409  }
410  }
411  }
412 
413  if (m_podofoTileInfo.size() == 0)//does not layer information, try tile information
414  {
415  for (ossim_uint32 index = 0; index < tileInfoVector.size(); ++index)
416  {
417  buildTileInfo(tileInfoVector[index]);
418  }
419  }
420 
421  tileInfoVector.clear();
422 }
bool contains(char aChar) const
Definition: ossimString.h:58
unsigned int ossim_uint32
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
void buildTileInfo(ossimString tileInfo)

◆ resetCacheBuffer()

void ossimGeoPdfReader::resetCacheBuffer ( ossimFrameEntryData  entry)
private

Definition at line 166 of file ossimGeoPdfReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), ossimImageData::loadBand(), ossimImageData::loadTile(), m_cacheSize, m_cacheTile, m_frameHeightVector, m_frameWidthVector, m_numberOfBands, ossimImageData::makeBlank(), OSSIM_BIP, ossimImageData::setImageRectangle(), ossimGeoPdfReader::ossimFrameEntryData::theCol, ossimGeoPdfReader::ossimFrameEntryData::theFrameEntry, ossimGeoPdfReader::ossimFrameEntryData::thePixelCol, ossimGeoPdfReader::ossimFrameEntryData::thePixelRow, ossimGeoPdfReader::ossimFrameEntryData::theRow, ossimImageData::validate(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

167 {
168  ossim_int32 row = entry.theRow;
169  ossim_int32 col = entry.theCol;
170  ossim_int32 width = m_frameWidthVector[col];
171  ossim_int32 height = m_frameHeightVector[row];
172  ossim_int32 pixelRow = entry.thePixelRow;
173  ossim_int32 pixelCol = entry.thePixelCol;
174 
175  ossimIrect imageRect(pixelCol, pixelRow, pixelCol+width-1, pixelRow+height-1);
176 
177  ossimIrect cacheRect(pixelCol, pixelRow, pixelCol+m_cacheSize.x-1, pixelRow+m_cacheSize.y-1);
178 
179  ossimIrect clipRect = cacheRect.clipToRect(imageRect);
180 
181  m_cacheTile->setImageRectangle(clipRect);
182 
183  if (!cacheRect.completely_within(imageRect))
184  {
186  }
187 
189 
190  void* lineBuffer = 0;
191  std::vector<PoDoFo::PdfObject*> imageObjects = entry.theFrameEntry;
192  if (imageObjects.size() == 1)
193  {
194  PoDoFo::PdfMemStream* pStream = dynamic_cast<PoDoFo::PdfMemStream*>(imageObjects[0]->GetStream());
195  pStream->Uncompress();
196  PoDoFo::pdf_long length = pStream->GetLength();
197  pStream->GetCopy((char**)&lineBuffer, &length);
198  if (lineBuffer)
199  {
200  m_cacheTile->loadTile(lineBuffer, imageRect, clipRect, OSSIM_BIP);
201  delete [] (char*)lineBuffer;
202  lineBuffer = 0;
203  }
204  }
205  else
206  {
207  for (ossim_uint32 band = 0; band < m_numberOfBands; ++band)
208  {
209  PoDoFo::PdfMemStream* pStream = dynamic_cast<PoDoFo::PdfMemStream*>(imageObjects[band]->GetStream());
210  pStream->Uncompress();
211  PoDoFo::pdf_long length = pStream->GetLength();
212  pStream->GetCopy((char**)&lineBuffer, &length);
213 
214  if (lineBuffer)
215  {
216  m_cacheTile->loadBand(lineBuffer, imageRect,clipRect, band);
217  delete [] (char*)lineBuffer;
218  lineBuffer = 0;
219  }
220  }
221  }
222  if (lineBuffer != NULL)
223  {
224  delete [] (char*)lineBuffer;
225  lineBuffer = 0;
226  }
227 }
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
virtual void setImageRectangle(const ossimIrect &rect)
std::map< ossim_int32, ossim_int32 > m_frameWidthVector
ossim_uint32 m_numberOfBands
Has sub image offset.
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
std::map< ossim_int32, ossim_int32 > m_frameHeightVector
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
ossimRefPtr< ossimImageData > m_cacheTile
virtual void makeBlank()
Initializes data to null pixel values.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ saveState()

bool ossimGeoPdfReader::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 645 of file ossimGeoPdfReader.cpp.

References m_pageVector, ossimImageGeometry::saveState(), ossimImageHandler::saveState(), and ossimRefPtr< T >::valid().

647 {
648  for (ossim_uint32 i = 0; i < m_pageVector.size(); i++)
649  {
650  ossimRefPtr<ossimImageGeometry> imageGeometry = m_pageVector[i]->m_geoImage;
651  if(imageGeometry.valid())
652  {
653  imageGeometry->saveState(kwl, prefix);
654  }
655  }
656 
657  return ossimImageHandler::saveState(kwl, prefix);
658 }
bool valid() const
Definition: ossimRefPtr.h:75
unsigned int ossim_uint32
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setCurrentEntry()

bool ossimGeoPdfReader::setCurrentEntry ( ossim_uint32  entryIdx)
virtual
Parameters
entryIdxEntry number to select.
Note
The implementation does nothing. Derived classes that handle multiple images should override.
Returns
true if it was able to set the current entry and false otherwise.

Reimplemented from ossimImageHandler.

Definition at line 629 of file ossimGeoPdfReader.cpp.

References m_imageRect, m_pageVector, ossimIrect::makeNan(), ossimImageHandler::theGeometry, and ossimRefPtr< T >::valid().

630 {
631  if (m_pageVector.size() > entryIdx)
632  {
633  theGeometry = 0;
635  theGeometry = m_pageVector[entryIdx]->m_geoImage;
636  m_imageRect = m_pageVector[entryIdx]->m_boundingRect;
637  if (theGeometry.valid())
638  {
639  return true;
640  }
641  }
642  return false;
643 }
ossimRefPtr< ossimImageGeometry > theGeometry
bool valid() const
Definition: ossimRefPtr.h:75
std::vector< ossimGeoPdfVectorPageNode * > m_pageVector
void makeNan()
Definition: ossimIrect.h:329

◆ setPodofoArrayInfo()

void ossimGeoPdfReader::setPodofoArrayInfo ( PoDoFo::PdfObject *  object)
private

Definition at line 1051 of file ossimGeoPdfReader.cpp.

References setPodofoDictInfo(), and setPodofoRefInfo().

Referenced by setPodofoInfo().

1052 {
1053  PoDoFo::PdfArray arrayObj = object->GetArray();
1054  for (ossim_uint32 i = 0; i < arrayObj.size(); i++)
1055  {
1056  PoDoFo::PdfObject objTmp = arrayObj[i];
1057  if (objTmp.IsDictionary())
1058  {
1059  setPodofoDictInfo(&objTmp);
1060  }
1061  else if (objTmp.IsReference())
1062  {
1063  setPodofoRefInfo(&objTmp);
1064  }
1065  }
1066 }
void setPodofoDictInfo(PoDoFo::PdfObject *object)
unsigned int ossim_uint32
void setPodofoRefInfo(PoDoFo::PdfObject *object)

◆ setPodofoDictInfo()

void ossimGeoPdfReader::setPodofoDictInfo ( PoDoFo::PdfObject *  object)
private

Definition at line 1082 of file ossimGeoPdfReader.cpp.

References m_podofoProjInfo, and setPodofoRefInfo().

Referenced by setPodofoArrayInfo(), setPodofoInfo(), and setPodofoRefInfo().

1083 {
1084  std::string valueStr;
1085  PoDoFo::PdfDictionary pdfDictionary = object->GetDictionary();
1086  PoDoFo::TKeyMap keyMap = pdfDictionary.GetKeys();
1087  PoDoFo::TKeyMap::iterator it = keyMap.begin();
1088  while (it != keyMap.end())
1089  {
1090  ossimString refName = ossimString(it->first.GetName());
1091  PoDoFo::PdfObject* refObj = it->second;
1092  if (refObj->IsReference())
1093  {
1094  setPodofoRefInfo(refObj);
1095  }
1096  else
1097  {
1098  refObj->ToString(valueStr);
1099  if (valueStr != "")
1100  {
1101  m_podofoProjInfo[refName] = valueStr;
1102  }
1103  }
1104  it++;
1105  }
1106 }
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
void setPodofoRefInfo(PoDoFo::PdfObject *object)

◆ setPodofoImageInfo()

void ossimGeoPdfReader::setPodofoImageInfo ( )
private

Definition at line 1108 of file ossimGeoPdfReader.cpp.

References ossimString::contains(), ossimString::downcase(), m_isJpeg, m_pdfMemDocument, m_podofoImageObjs, m_podofoTileInfo, parseTileStructure(), and ossimString::push_back().

1109 {
1110  PoDoFo::PdfObject* pObj = NULL;
1111  m_podofoImageObjs.clear();
1112  std::vector<ossimString> tmpForm;
1113  int count = 1;
1114  int rowCount = 0;
1115  bool isDctDecode = false;
1116  PoDoFo::TCIVecObjects it = m_pdfMemDocument->GetObjects().begin();
1117  while( it != m_pdfMemDocument->GetObjects().end() )
1118  {
1119  if ((*it)->IsDictionary())
1120  {
1121  pObj = (*it)->GetDictionary().GetKey( PoDoFo::PdfName::KeyType );
1122  if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "XObject" ))
1123  {
1124  pObj = (*it)->GetDictionary().GetKey( PoDoFo::PdfName::KeySubtype );
1125  if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "Form" ))
1126  {
1127  std::string imageTileInfo;
1128  (*it)->ToString(imageTileInfo);
1129  ossimString imageTileInfoStr = imageTileInfo;
1130  if (imageTileInfoStr.downcase().contains("tile"))
1131  {
1132  tmpForm.push_back(imageTileInfoStr);
1133  }
1134  }
1135  else if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "Image" ))
1136  {
1137  pObj = (*it)->GetDictionary().GetKey( PoDoFo::PdfName::KeyFilter );
1138  if( pObj->IsName() && ( pObj->GetName().GetName() == "DCTDecode" ))
1139  {
1140  m_podofoImageObjs[count] = (*it);
1141  isDctDecode = true;
1142  }
1143  else if( pObj->IsArray() && pObj->GetArray().GetSize() == 1 &&
1144  pObj->GetArray()[0].IsName() && (pObj->GetArray()[0].GetName().GetName() == "DCTDecode"))
1145  {
1146  m_podofoImageObjs[count] = (*it);
1147  isDctDecode = true;
1148  }
1149  else if (pObj->IsName() && (pObj->GetName().GetName() == "FlateDecode") )
1150  {
1151  if (isDctDecode == false)
1152  {
1153  std::pair<ossim_int32, ossim_int32> tileRowCol;
1154  tileRowCol = make_pair(rowCount, 0);
1155  m_podofoTileInfo[count] = tileRowCol;
1156  m_podofoImageObjs[count] = (*it);
1157  m_isJpeg = false;
1158  }
1159  rowCount++;
1160  }
1161  }
1162  }
1163  }
1164  ++it;
1165  ++count;
1166  }
1167 
1168  if (m_isJpeg == false)
1169  {
1170  std::map<ossim_int32, ossim_int32> widthMap;
1171  std::map<ossim_int32, PoDoFo::PdfObject*>::iterator it = m_podofoImageObjs.begin();
1172  while (it != m_podofoImageObjs.end())
1173  {
1174  PoDoFo::PdfObject* tmpObj = it->second;
1175  PoDoFo::PdfImage image(tmpObj);
1176  int width = image.GetWidth();
1177  widthMap[it->first] = width;
1178  it++;
1179  }
1180 
1181  std::map<ossim_int32, ossim_int32>::iterator itWidth = widthMap.begin();
1182  ossim_int32 firstId = itWidth->first;
1183  ossim_int32 firstWidth = itWidth->second;
1184  widthMap.erase(itWidth);
1185 
1186  itWidth = widthMap.end();
1187  itWidth--;
1188  ossim_int32 lastId = itWidth->first;
1189  ossim_int32 lastWidth = itWidth->second;
1190 
1191  itWidth = widthMap.begin();
1192  ossim_int32 invalidId = 0;
1193  while (itWidth != widthMap.end())
1194  {
1195  ossim_int32 tmpWidth = itWidth->second;
1196  ossim_int32 tmpId = itWidth->first;
1197  if (firstWidth == tmpWidth)
1198  {
1199  invalidId = lastId;
1200  }
1201  else if ( lastWidth == tmpWidth )
1202  {
1203  invalidId = firstId;
1204  }
1205  else
1206  {
1207  invalidId = tmpId;
1208  }
1209  break;
1210  itWidth++;
1211  }
1212 
1213  it = m_podofoImageObjs.find(invalidId);
1214  if (it != m_podofoImageObjs.end())
1215  {
1216  m_podofoImageObjs.erase(it);
1217  }
1218 
1219  std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> >::iterator itTile = m_podofoTileInfo.find(invalidId);
1220  if (itTile != m_podofoTileInfo.end())
1221  {
1222  m_podofoTileInfo.erase(itTile);
1223  }
1224 
1225  if (invalidId == firstId)
1226  {
1227  itTile = m_podofoTileInfo.begin();
1228  while (itTile != m_podofoTileInfo.end())
1229  {
1230  ossim_int32 index = itTile->first;
1231  ossim_int32 tileRow = itTile->second.first;
1232  if (tileRow > 0)
1233  {
1234  std::pair<ossim_int32, ossim_int32> tileRowCol;
1235  tileRowCol = make_pair(tileRow-1, 0);
1236  m_podofoTileInfo[index] = tileRowCol;
1237  }
1238  else
1239  {
1240  break;
1241  }
1242  itTile++;
1243  }
1244  }
1245  widthMap.clear();
1246  }
1247 
1248  if (tmpForm.size() > 0 && m_podofoTileInfo.size() == 0)
1249  {
1250  parseTileStructure(tmpForm);
1251  }
1252  tmpForm.clear();
1253 }
PoDoFo::PdfMemDocument * m_pdfMemDocument
bool contains(char aChar) const
Definition: ossimString.h:58
std::map< ossim_int32, PoDoFo::PdfObject * > m_podofoImageObjs
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
void parseTileStructure(std::vector< ossimString > tileInfo)
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
std::map< ossim_int32, std::pair< ossim_int32, ossim_int32 > > m_podofoTileInfo
int ossim_int32

◆ setPodofoInfo()

void ossimGeoPdfReader::setPodofoInfo ( PoDoFo::PdfObject *  object)
private

Definition at line 1034 of file ossimGeoPdfReader.cpp.

References m_podofoProjInfo, setPodofoArrayInfo(), setPodofoDictInfo(), and setPodofoRefInfo().

1035 {
1036  m_podofoProjInfo.clear();
1037  if (object->IsReference())
1038  {
1039  setPodofoRefInfo(object);
1040  }
1041  else if (object->IsDictionary())
1042  {
1043  setPodofoDictInfo(object);
1044  }
1045  else if (object->IsArray())
1046  {
1047  setPodofoArrayInfo(object);
1048  }
1049 }
void setPodofoArrayInfo(PoDoFo::PdfObject *object)
void setPodofoDictInfo(PoDoFo::PdfObject *object)
std::map< ossimString, ossimString, ossimStringLtstr > m_podofoProjInfo
void setPodofoRefInfo(PoDoFo::PdfObject *object)

◆ setPodofoRefInfo()

void ossimGeoPdfReader::setPodofoRefInfo ( PoDoFo::PdfObject *  object)
private

Definition at line 1068 of file ossimGeoPdfReader.cpp.

References m_pdfMemDocument, and setPodofoDictInfo().

Referenced by setPodofoArrayInfo(), setPodofoDictInfo(), and setPodofoInfo().

1069 {
1070  PoDoFo::PdfReference pdfReference = object->GetReference();
1071  PoDoFo::PdfVecObjects objVector = m_pdfMemDocument->GetObjects();
1072  if (pdfReference.IsIndirect())
1073  {
1074  PoDoFo::PdfObject* refObj = objVector.GetObject(pdfReference);
1075  if (refObj->IsDictionary())
1076  {
1077  setPodofoDictInfo(refObj);
1078  }
1079  }
1080 }
PoDoFo::PdfMemDocument * m_pdfMemDocument
void setPodofoDictInfo(PoDoFo::PdfObject *object)

Member Data Documentation

◆ m_cacheId

ossimAppFixedTileCache::ossimAppFixedCacheId ossimGeoPdfReader::m_cacheId
private

Definition at line 323 of file ossimGeoPdfReader.h.

◆ m_cacheSize

ossimIpt ossimGeoPdfReader::m_cacheSize
private

Definition at line 322 of file ossimGeoPdfReader.h.

Referenced by resetCacheBuffer().

◆ m_cacheTile

ossimRefPtr<ossimImageData> ossimGeoPdfReader::m_cacheTile
private

Definition at line 321 of file ossimGeoPdfReader.h.

Referenced by closeEntry(), fillTile(), and resetCacheBuffer().

◆ m_currentCol

ossim_int32 ossimGeoPdfReader::m_currentCol
private

Definition at line 305 of file ossimGeoPdfReader.h.

◆ m_currentRow

ossim_int32 ossimGeoPdfReader::m_currentRow
private

Definition at line 304 of file ossimGeoPdfReader.h.

Referenced by getTile().

◆ m_frameEntryArray

std::vector<std::vector< std::vector<PoDoFo::PdfObject*> > > ossimGeoPdfReader::m_frameEntryArray
private

Definition at line 324 of file ossimGeoPdfReader.h.

Referenced by buildFrameEntryArray(), closeEntry(), and getIntersectingEntries().

◆ m_frameHeightVector

std::map<ossim_int32, ossim_int32> ossimGeoPdfReader::m_frameHeightVector
private

◆ m_frameWidthVector

std::map<ossim_int32, ossim_int32> ossimGeoPdfReader::m_frameWidthVector
private

◆ m_imageRect

ossimIrect ossimGeoPdfReader::m_imageRect
private

Definition at line 298 of file ossimGeoPdfReader.h.

Referenced by buildFrameEntryArray(), and setCurrentEntry().

◆ m_isJpeg

bool ossimGeoPdfReader::m_isJpeg
private

Definition at line 318 of file ossimGeoPdfReader.h.

Referenced by fillTile(), and setPodofoImageInfo().

◆ m_isLGIDict

bool ossimGeoPdfReader::m_isLGIDict
private

Definition at line 317 of file ossimGeoPdfReader.h.

Referenced by computeBoundingRect(), and getGeoProjection().

◆ m_numberOfBands

ossim_uint32 ossimGeoPdfReader::m_numberOfBands
private

Has sub image offset.

Definition at line 299 of file ossimGeoPdfReader.h.

Referenced by buildFrameEntryArray(), getNumberOfInputBands(), getNumberOfOutputBands(), and resetCacheBuffer().

◆ m_numberOfLines

ossim_uint32 ossimGeoPdfReader::m_numberOfLines
private

◆ m_numberOfSamples

ossim_uint32 ossimGeoPdfReader::m_numberOfSamples
private

◆ m_numOfFramesHorizontal

ossim_int32 ossimGeoPdfReader::m_numOfFramesHorizontal
private

Definition at line 303 of file ossimGeoPdfReader.h.

Referenced by buildFrameEntryArray().

◆ m_numOfFramesVertical

ossim_int32 ossimGeoPdfReader::m_numOfFramesVertical
private

Definition at line 302 of file ossimGeoPdfReader.h.

Referenced by buildFrameEntryArray().

◆ m_pageVector

std::vector<ossimGeoPdfVectorPageNode*> ossimGeoPdfReader::m_pageVector
private

◆ m_pdfMemDocument

PoDoFo::PdfMemDocument* ossimGeoPdfReader::m_pdfMemDocument
private

Definition at line 316 of file ossimGeoPdfReader.h.

Referenced by closeEntry(), setPodofoImageInfo(), and setPodofoRefInfo().

◆ m_podofoImageObjs

std::map<ossim_int32, PoDoFo::PdfObject*> ossimGeoPdfReader::m_podofoImageObjs
private

Definition at line 315 of file ossimGeoPdfReader.h.

Referenced by buildFrameEntryArray(), closeEntry(), and setPodofoImageInfo().

◆ m_podofoProjInfo

std::map<ossimString, ossimString, ossimStringLtstr> ossimGeoPdfReader::m_podofoProjInfo
private

◆ m_podofoTileInfo

std::map<ossim_int32, std::pair<ossim_int32, ossim_int32> > ossimGeoPdfReader::m_podofoTileInfo
private

◆ m_scalarType

ossimScalarType ossimGeoPdfReader::m_scalarType
private

Definition at line 308 of file ossimGeoPdfReader.h.

Referenced by getOutputScalarType().

◆ m_tile

ossimRefPtr<ossimImageData> ossimGeoPdfReader::m_tile
private

Definition at line 309 of file ossimGeoPdfReader.h.

Referenced by closeEntry(), and getTile().


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