NitfImageSubheader.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef NITFIMAGESUBHEADER_H
00011 #define NITFIMAGESUBHEADER_H
00012 
00013 #include "LocationType.h"
00014 #include "NitfHeader.h"
00015 #include <memory>
00016 
00017 class GcpPoint;
00018 class ossimNitfImageHeaderV2_X;
00019 class RasterDataDescriptor;
00020 class ossimContainerProperty;
00021 
00022 namespace Nitf
00023 {
00024    /**
00025     * Represents the NITF image subheader.
00026     */
00027    class ImageSubheader : public Header
00028    {
00029    public:
00030       /**
00031        * Constructs the ImageSubheader.
00032        *
00033        * @param fileVersion
00034        *        Either Nitf::VERSION_02_00 or Nitf::VERSION_02_10.
00035        */
00036       ImageSubheader(const std::string& fileVersion);
00037 
00038       /**
00039        * Adds NITF ImageSubheader metadata to the DynamicObject.
00040        *
00041        * @param pHeader
00042        *        The source of the metadata.
00043        * @param pDescriptor
00044        *        The destination for the metadata.
00045        *
00046        * @return \c True on success, \c false otherwise.
00047        */
00048       bool importMetadata(const ossimPropertyInterface* pHeader, RasterDataDescriptor* pDescriptor);
00049 
00050       std::string getMetadataPath() const;
00051 
00052       FactoryResource<DynamicObject> createDefaultsDynamicObject(const RasterDataDescriptor* pDescriptor);
00053 
00054    protected: // special import/export code
00055       /**
00056        * @copydoc Nitf::Header::importMetadataValue()
00057        *
00058        * <b>This function is specialized for importing the band information.</b>
00059        */
00060       static bool importBandInformation(const ossimPropertyInterface* pPropertyInterface,
00061          RasterDataDescriptor* pDescriptor,
00062          DynamicObject* pDynObj, const std::string& appName,
00063          const std::string& ossimName);
00064 
00065       /**
00066        * @copydoc Nitf::Header::importMetadataValue()
00067        *
00068        * <b>This function is specialized for importing the IGEOLO from NITF 2.0 files.</b>
00069        */
00070       static bool importGeoInformation_2_0(const ossimPropertyInterface* pPropertyInterface,
00071          RasterDataDescriptor* pDescriptor,
00072          DynamicObject* pDynObj, const std::string& appName,
00073          const std::string& ossimName);
00074 
00075       /**
00076        * @copydoc Nitf::Header::importMetadataValue()
00077        *
00078        * <b>This function is specialized for importing the IGEOLO from NITF 2.1 files.</b>
00079        */
00080       static bool importGeoInformation(const ossimPropertyInterface* pPropertyInterface,
00081          RasterDataDescriptor* pDescriptor,
00082          DynamicObject* pDynObj, const std::string& appName,
00083          const std::string& ossimName);
00084 
00085       /**
00086        * @copydoc Nitf::Header::exportMetadataValue()
00087        *
00088        * <b>This function is specialized for exporting the IGEOLO to NITF 2.1 files.</b>
00089        */
00090       static bool exportGeoInformation(const RasterDataDescriptor* pDescriptor,
00091          const DataVariant& prop,
00092          ossimContainerProperty* pProperties, const std::string& appName,
00093          const std::string& ossimName);
00094 
00095       /**
00096        * @copydoc Nitf::Header::importMetadataValue()
00097        *
00098        * <b>This function is specialized for importing the IDATIM from NITF 2.0 files.</b>
00099        */
00100       static bool importIDATIM_2_0(const ossimPropertyInterface* pPropertyInterface,
00101          RasterDataDescriptor* pDescriptor,
00102          DynamicObject* pDynObj, const std::string& appName,
00103          const std::string& ossimName);
00104 
00105       /**
00106        * @copydoc Nitf::Header::importMetadataValue()
00107        *
00108        * <b>This function is specialized for importing the IDATIM from NITF 2.1 files.</b>
00109        */
00110       static bool importIDATIM(const ossimPropertyInterface* pPropertyInterface,
00111          RasterDataDescriptor* pDescriptor,
00112          DynamicObject* pDynObj, const std::string& appName,
00113          const std::string& ossimName);
00114 
00115       /**
00116        * @copydoc Nitf::Header::exportMetadataValue()
00117        *
00118        * <b>This function is specialized for exporting the IDATIM to NITF 2.1 files.</b>
00119        */
00120       static bool exportIDATIM(const RasterDataDescriptor* pDescriptor,
00121          const DataVariant& prop,
00122          ossimContainerProperty* pProperties, const std::string& appName,
00123          const std::string& ossimName);
00124 
00125       /**
00126        * @copydoc Nitf::Header::importMetadataValue()
00127        *
00128        * <b>This function is specialized for importing the ILOC.</b>
00129        */
00130       static bool importILOC(const ossimPropertyInterface* pPropertyInterface,
00131          RasterDataDescriptor* pDescriptor,
00132          DynamicObject* pDynObj, const std::string& appName,
00133          const std::string& ossimName);
00134 
00135       /**
00136        * @copydoc Nitf::Header::exportMetadataValue()
00137        *
00138        * <b>This function is specialized for exporting the ILOC.</b>
00139        */
00140       static bool exportILOC(const RasterDataDescriptor* pDescriptor,
00141          const DataVariant& prop,
00142          ossimContainerProperty* pProperties, const std::string& appName,
00143          const std::string& ossimName);
00144 
00145       /**
00146        * @copydoc Nitf::Header::exportMetadataValue()
00147        *
00148        * <b>This function is specialized for exporting classification strings.</b>
00149        */
00150       static bool exportClassificationString(const RasterDataDescriptor* pDescriptor,
00151          const DataVariant& prop,
00152          ossimContainerProperty* pProperties, const std::string& appName,
00153          const std::string& ossimName);
00154 
00155       /**
00156        * @copydoc Nitf::Header::exportMetadataValue()
00157        *
00158        * <b>This function is specialized for exporting classification dates and times.</b>
00159        */
00160       static bool exportClassificationDate(const RasterDataDescriptor* pDescriptor,
00161          const DataVariant& prop,
00162          ossimContainerProperty* pProperties, const std::string& appName,
00163          const std::string& ossimName);
00164 
00165    private:
00166       ImageSubheader& operator=(const ImageSubheader& rhs);
00167 
00168       static bool getGCPsFromUtmMgrs(const string& iGeolo, const LocationType gcpPixels[],
00169          unsigned int numGcpPixels, list<GcpPoint>& gcps);
00170 
00171       static bool getGCPsFromUtm(const string& iCords, const string& iGeolo,
00172          const LocationType gcpPixels[], unsigned int numGcpPixels, list<GcpPoint>& gcps);
00173 
00174       static bool getGCPsFromGeographic(const string& iGeolo, const LocationType gcpPixels[],
00175          unsigned int numGcpPixels, list<GcpPoint>& gcps);
00176 
00177       static bool getGCPsFromDecimalDegrees(const string& iGeolo, const LocationType gcpPixels[],
00178          unsigned int numGcpPixels, list<GcpPoint>& gcps);
00179    };
00180 }
00181 
00182 #endif

Software Development Kit - Opticks 4.9.0 Build 16218