- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# gdal_mdreader.h

    00001 /******************************************************************************
    00002  * $Id: gdal_mdreader.h 29190 2015-05-13 21:40:30Z bishop $
    00003  *
    00004  * Project:  GDAL Core
    00005  * Purpose:  Read metadata (mainly the remote sensing imagery) from files of
    00006  *           different providers like DigitalGlobe, GeoEye etc.
    00007  * Author:   Dmitry Baryshnikov, polimax@mail.ru
    00008  *
    00009  ******************************************************************************
    00010  * Copyright (c) 2014-2015, NextGIS info@nextgis.ru
    00011  *
    00012  * Permission is hereby granted, free of charge, to any person obtaining a
    00013  * copy of this software and associated documentation files (the "Software"),
    00014  * to deal in the Software without restriction, including without limitation
    00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00016  * and/or sell copies of the Software, and to permit persons to whom the
    00017  * Software is furnished to do so, subject to the following conditions:
    00018  *
    00019  * The above copyright notice and this permission notice shall be included
    00020  * in all copies or substantial portions of the Software.
    00021  *
    00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00028  * DEALINGS IN THE SOFTWARE.
    00029  ****************************************************************************/
    00030
    00031 #ifndef GDAL_MDREADER_H_INCLUDED
    00032 #define GDAL_MDREADER_H_INCLUDED
    00033
    00034
    00035 #include "cpl_port.h"
    00036 #include "gdal_priv.h"
    00037
    00038 #define MD_DOMAIN_IMD "IMD"
    00039 #define MD_DOMAIN_RPC "RPC"
    00040 #define MD_DOMAIN_IMAGERY "IMAGERY"
    00041 #define MD_DOMAIN_DEFAULT ""
    00043 #define MD_NAME_ACQDATETIME "ACQUISITIONDATETIME"
    00044 #define MD_NAME_SATELLITE   "SATELLITEID"
    00045 #define MD_NAME_CLOUDCOVER  "CLOUDCOVER"
    00046 #define MD_NAME_MDTYPE      "METADATATYPE"
    00048 #define MD_DATETIMEFORMAT "%Y-%m-%d %H:%M:%S"
    00049 #define MD_CLOUDCOVER_NA "999"
    00055 #define RPC_LINE_OFF        "LINE_OFF"
    00056 #define RPC_SAMP_OFF        "SAMP_OFF"
    00057 #define RPC_LAT_OFF         "LAT_OFF"
    00058 #define RPC_LONG_OFF        "LONG_OFF"
    00059 #define RPC_HEIGHT_OFF      "HEIGHT_OFF"
    00060 #define RPC_LINE_SCALE      "LINE_SCALE"
    00061 #define RPC_SAMP_SCALE      "SAMP_SCALE"
    00062 #define RPC_LAT_SCALE       "LAT_SCALE"
    00063 #define RPC_LONG_SCALE      "LONG_SCALE"
    00064 #define RPC_HEIGHT_SCALE    "HEIGHT_SCALE"
    00065 #define RPC_LINE_NUM_COEFF  "LINE_NUM_COEFF"
    00066 #define RPC_LINE_DEN_COEFF  "LINE_DEN_COEFF"
    00067 #define RPC_SAMP_NUM_COEFF  "SAMP_NUM_COEFF"
    00068 #define RPC_SAMP_DEN_COEFF  "SAMP_DEN_COEFF"
    00069
    00074 typedef enum {
    00075     MDR_None     = 0x00000000,
    00076     MDR_DG       = 0x00000001,
    00077     MDR_GE       = 0x00000002,
    00078     MDR_OV       = 0x00000004,
    00079     MDR_PLEIADES = 0x00000008,
    00080     MDR_SPOT     = 0x00000010,
    00081     MDR_RDK1     = 0x00000020,
    00082     MDR_LS       = 0x00000040,
    00083     MDR_RE       = 0x00000080,
    00084     MDR_KOMPSAT  = 0x00000100,
    00085     MDR_EROS     = 0x00000200,
    00086     MDR_ALOS     = 0x00000400,
    00087     MDR_ANY  = MDR_DG | MDR_GE | MDR_OV | MDR_PLEIADES | MDR_SPOT | MDR_RDK1 |
    00088                MDR_LS | MDR_RE | MDR_KOMPSAT | MDR_EROS | MDR_ALOS
    00089 } MDReaders;
    00090
    00091
    00095 class GDALMDReaderBase{
    00096 public:
    00097     GDALMDReaderBase(const char *pszPath, char **papszSiblingFiles);
    00098     virtual ~GDALMDReaderBase();
    00099
    00105     virtual char ** GetMetadataDomain(const char *pszDomain);
    00111     virtual bool FillMetadata(GDALMultiDomainMetadata* poMDMD);
    00117     virtual const bool HasRequiredFiles() const = 0;
    00123     virtual char** GetMetadataFiles() const = 0;
    00124 protected:
    00129     virtual void LoadMetadata();
    00135     virtual const time_t GetAcquisitionTimeFromString(const char* pszDateTime);
    00145     virtual char** ReadXMLToList(CPLXMLNode* psNode, char** papszList,
    00146                          const char* pszName = "");
    00156     virtual char** AddXMLNameValueToList(char** papszList, const char *pszName,
    00157                                          const char *pszValue);
    00158 protected:
    00159     char **m_papszIMDMD;
    00160     char **m_papszRPCMD;
    00161     char **m_papszIMAGERYMD;
    00162     char **m_papszDEFAULTMD;
    00163     bool m_bIsMetadataLoad;
    00164 };
    00165
    00171 class CPL_DLL GDALMDReaderManager{
    00172 public:
    00173     GDALMDReaderManager();
    00174     virtual ~GDALMDReaderManager();
    00175
    00186     virtual GDALMDReaderBase* GetReader(const char *pszPath,
    00187                                         char **papszSiblingFiles,
    00188                                         GUInt32 nType = MDR_ANY);
    00189 protected:
    00190     GDALMDReaderBase *m_pReader;
    00191 };
    00192
    00193 // misc
    00194 CPLString CPLStrip(const CPLString& osString, const char cChar);
    00195 CPLString CPLStripQuotes(const CPLString& osString);
    00196 char** GDALLoadRPBFile( const CPLString& osFilePath );
    00197 char** GDALLoadRPCFile( const CPLString& osFilePath );
    00198 char** GDALLoadIMDFile( const CPLString& osFilePath );
    00199 const bool GDALCheckFileHeader(const CPLString& soFilePath,
    00200                                const char * pszTestString,
    00201                                int nBufferSize = 256);
    00202
    00203 CPLErr GDALWriteRPBFile( const char *pszFilename, char **papszMD );
    00204 CPLErr GDALWriteRPCTXTFile( const char *pszFilename, char **papszMD );
    00205 CPLErr GDALWriteIMDFile( const char *pszFilename, char **papszMD );
    00206
    00207 #endif //GDAL_MDREADER_H_INCLUDED

Generated for GDAL by 1.7.1.