Commit 54c29c0e authored by Julien Malik's avatar Julien Malik
Browse files

ENH: add support for DIMAPv1 format in ossimPleiadesSensorModel

parent 6104cce3
......@@ -57,6 +57,12 @@ namespace ossimplugins
public ossimErrorStatusInterface
{
public:
enum ossimPleiadesDIMAPVersion
{
OSSIM_PLEIADES_UNKNOWN,
OSSIM_PLEIADES_DIMAPv1,
OSSIM_PLEIADES_DIMAPv2
};
/** metadata subprofile type */
enum ossimPleiadesMetadataSubProfile
......@@ -129,7 +135,7 @@ namespace ossimplugins
/** Zero based image rectangle, sub image if there is one. */
void getImageRect(ossimDrect& rect)const;
bool allMetadataRead(){return (theProductIsOk && TheRpcIsOk);};
bool allMetadataRead(){return (theProductIsOk && theRpcIsOk);};
std::vector<double> getLineNumCoeff() const {return theLineNumCoeff;};
std::vector<double> getLineDenCoeff() const {return theLineDenCoeff;};
......@@ -150,17 +156,16 @@ namespace ossimplugins
private:
ossimPleiadesMetadataSubProfile theMetadataSubProfile;
ossimPleiadesDIMAPVersion theDIMAPVersion;
ossimPleiadesMetadataSubProfile theMetadataSubProfile; // only for DIMAPv2
bool theProductIsOk;
bool TheRpcIsOk;
bool theRpcIsOk;
ossimString theXmlDocumentRoot;
ossimString theSensorID;
ossimString theImageID;
ossimString theProductionDate;
ossimString theAcquisitionDate;
ossimString theFirstLineImagingTime;
ossimString theFirstLineImagingDate;
ossimString theInstrument;
ossimString theInstrumentIndex;
ossimString theProcessingLevelString;
......@@ -233,7 +238,8 @@ namespace ossimplugins
bool parseRPCMetadata(ossimRefPtr<ossimXmlDocument> xmlDocument);
bool parseMetadataIdentification(ossimRefPtr<ossimXmlDocument> xmlDocument);
bool parseMetadataIdentificationDIMAPv1(ossimRefPtr<ossimXmlDocument> xmlDocument);
bool parseMetadataIdentificationDIMAPv2(ossimRefPtr<ossimXmlDocument> xmlDocument);
/**
* Dataset Identification:
......
......@@ -216,21 +216,31 @@ namespace ossimplugins
{
if (file.isFile())
{
DIMxmlFile = file.path();
RPCxmlFile = file.path();
ossimFilename DIMxmlFileTmp = file.file();
ossimFilename RPCxmlFileTmp;
DIMxmlFileTmp = DIMxmlFileTmp.file().replaceStrThatMatch("^IMG_", "DIM_");
DIMxmlFileTmp = DIMxmlFileTmp.replaceStrThatMatch("_R[0-9]+C[0-9]+\\.(JP2|TIF)$", ".XML");
RPCxmlFileTmp = DIMxmlFileTmp.file().replaceStrThatMatch("^DIM_", "RPC_");
DIMxmlFile = DIMxmlFile.dirCat(DIMxmlFileTmp);
RPCxmlFile = RPCxmlFile.dirCat(RPCxmlFileTmp);
// DIMAPv1
ossimFilename DIMv1xmlFileTmp = file;
DIMv1xmlFileTmp.setFile("PHRDIMAP");
DIMv1xmlFileTmp.setExtension("XML");
if (DIMv1xmlFileTmp.isFile())
{
DIMxmlFile = DIMv1xmlFileTmp;
RPCxmlFile = DIMv1xmlFileTmp;
}
else
{
// DIMAPv2
DIMxmlFile = file.path();
RPCxmlFile = file.path();
ossimFilename DIMxmlFileTmp = file.file();
ossimFilename RPCxmlFileTmp;
DIMxmlFileTmp = DIMxmlFileTmp.file().replaceStrThatMatch("^IMG_", "DIM_");
DIMxmlFileTmp = DIMxmlFileTmp.replaceStrThatMatch("_R[0-9]+C[0-9]+\\.(JP2|TIF)$", ".XML");
RPCxmlFileTmp = DIMxmlFileTmp.file().replaceStrThatMatch("^DIM_", "RPC_");
DIMxmlFile = DIMxmlFile.dirCat(DIMxmlFileTmp);
RPCxmlFile = RPCxmlFile.dirCat(RPCxmlFileTmp);
}
}
}
......@@ -300,7 +310,6 @@ namespace ossimplugins
theLatOffset = theSupportData->getLatOffset();
theLonOffset = theSupportData->getLonOffset();
theHgtOffset = theSupportData->getHeightOffset();
}
// TODO MSD Check if this part is necessary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment