Commit d1f2ddb3 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Added GDALOverviewsBuilder::CanGenerateOverviews().

parent b6243821
......@@ -91,6 +91,11 @@ public:
/** Method for creation through the object factory. */
itkNewMacro( Self );
/**
*/
static
bool CanGenerateOverviews( const std::string & filename );
/**
* \brief Count the number of resolution levels larger than
* factor^n.
......
......@@ -24,6 +24,7 @@
#include "otb_boost_string_header.h"
#include "otbGDALDriverManagerWrapper.h"
#include "otbGDALImageIO.h"
#include "otbSystem.h"
......@@ -79,6 +80,26 @@ GetConfigOption( const char * key )
: std::string( value );
}
/***************************************************************************/
bool
GDALOverviewsBuilder
::CanGenerateOverviews( const std::string & filename )
{
GDALImageIO::Pointer io( GDALImageIO::New() );
typedef std::vector< std::string > StringVector;
StringVector names;
StringVector descs;
if( !io->CanReadFile( filename.c_str() ) )
return false;
io->SetFileName( filename );
return !io->GetSubDatasetInfo( names, descs );
}
/***************************************************************************/
GDALOverviewsBuilder
::GDALOverviewsBuilder() :
......
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