Commit b700c542 authored by Aurélien Bricier's avatar Aurélien Bricier
Browse files

ENH: added ReadGeometryFromGEOMFile method

parent 41ef0ee3
......@@ -210,10 +210,8 @@ ReadGeometryFromImage(const std::string& filename)
// Try to find a ".geom" file next to 'filename'
ossimFilename ossimGeomFile = ossimFilename(filename).setExtension(".geom");
ReadGeometryFromGEOMFile(ossimGeomFile);
/*
if (ossimGeomFile.exists() && ossimGeomFile.isFile())
if (ossimGeomFile.exists() && ossimGeomFile.isFile())
{
// Interpret the geom file as a KWL
ossimKeywordlist kwl(ossimGeomFile);
......@@ -234,7 +232,6 @@ ReadGeometryFromImage(const std::string& filename)
}
}
}
*/
}
else
{
......@@ -279,8 +276,7 @@ ImageKeywordlist
ReadGeometryFromGEOMFile(const std::string& filename)
{
ossimKeywordlist geom_kwl;
ossimFilename ossimGeomFile = ossimFilename(filename);
ImageKeywordlist otb_kwl;
if (ossimGeomFile.exists() && ossimGeomFile.isFile())
{
......@@ -304,7 +300,6 @@ ReadGeometryFromGEOMFile(const std::string& filename)
}
}
ImageKeywordlist otb_kwl;
otb_kwl.SetKeywordlist(geom_kwl);
return otb_kwl;
......
......@@ -100,6 +100,7 @@ protected:
virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
private:
ossimKeywordlist InternalReadGeometry(const std::string& filename);
/** Geo informations are in this map */
KeywordlistMap m_Keywordlist;
......@@ -113,8 +114,9 @@ private:
std::ostream & operator <<(std::ostream& os, const ImageKeywordlist& kwl);
// Free function to handle the keywordlist <-> files
itkLegacyMacro(ImageKeywordlist ReadGeometry(const std::string& filename));
itkLegacyMacro(ImageKeywordlist ReadGeometry(const std::string& filename)); //OTB 3.15
ImageKeywordlist ReadGeometryFromImage(const std::string& filename);
ImageKeywordlist ReadGeometryFromGEOMFile(const std::string& filename);
void WriteGeometry(const ImageKeywordlist& otb_kwl, const std::string& filename);
} //namespace otb
......
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