Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OmgGdal Class Reference
[Library]

#include <omggdal.h>

Inheritance diagram for OmgGdal:

Inheritance graph
[legend]
Collaboration diagram for OmgGdal:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class will write a png image given an input gdal compatible datasource, and provide other GDAL related functions in Qt friendly way.

Definition at line 52 of file omggdal.h.

Public Types

enum  FileType { GeoTiff, ArcInfoAscii }

Signals

void error (QString theError)
void updateProgress (int theProgress, int theMaximum)

Public Member Functions

 OmgGdal ()
 ~OmgGdal ()
const QString getWorldFile (const QString theFileName)
const QString getAsciiHeader (const QString theFileName)
const bool convert (const QString theInputFile, const QString theOutputFileName, const FileType theOutputFileType)
void buildSupportedRasterFileFilter (QString &theFileFiltersString)
const QString contour (const QString theInputFile)
void showProgress (int theProgress, int theMaximum)
void writeImage (QString theInputFileString, QString theOutputFileString, int theWidth, int theHeight)
const bool makeLegend (const QString theOutputFileName, const int theWidth)
const bool gdal2gdal (const QString theFileName, const QString theOutputFileName, const QString theFormat)
const bool gdal2Tiff (const QString theFileName, const QString theOutputFileName)
const bool gdal2Ascii (const QString theFileName, const QString theOutputFileName)

Static Public Member Functions

static bool isValidGdalFile (const QString theFilename)
static bool isValidGdalProj (const QString theFilename)

Private Member Functions

void calculateStats (BandStats *theBandStats, GDALDataset *gdalDataset)


Member Enumeration Documentation

enum OmgGdal::FileType
 

Enumeration values:
GeoTiff 
ArcInfoAscii 

Definition at line 58 of file omggdal.h.


Constructor & Destructor Documentation

OmgGdal::OmgGdal  ) 
 

Definition at line 110 of file omggdal.cpp.

OmgGdal::~OmgGdal  ) 
 

Definition at line 117 of file omggdal.cpp.


Member Function Documentation

void OmgGdal::buildSupportedRasterFileFilter QString &  theFileFiltersString  ) 
 

Get a list of supported GDAL datatype file filters. THis method was copied over from QGIS QgsRasterLayer

Parameters:
A reference to a string. This will be populated with the results.
Returns:
void

Definition at line 211 of file omggdal.cpp.

Referenced by OmgGdalConverter::OmgGdalConverter(), and OmgGdalWarp::OmgGdalWarp().

void OmgGdal::calculateStats BandStats theBandStats,
GDALDataset *  gdalDataset
[private]
 

Calculate image statistics

Definition at line 664 of file omggdal.cpp.

References error().

const QString OmgGdal::contour const QString  theInputFile  ) 
 

Create contour lines from probability surface Only the first raster band will be contoured.Contours are fixed at 10 unit increments. This method is based on the GDAL apps/gdal_contour.cpp sources

Parameters:
const QString theInputFile Gdal dataset to be contoured
const QString the name of the generated shapefile

Definition at line 386 of file omggdal.cpp.

References error().

Referenced by OmgGdalRasterContour::on_pbnProcess_clicked().

const bool OmgGdal::convert const QString  theInputFile,
const QString  theOutputFileName,
const FileType  theOutputFileType
 

A Qt style wrapper for gdal to convert from one file format to another.

See also:
FileType enum for the currently supported output file types
Parameters:
const QString theInputFile the name of the input file
const QString theOutputFileName the name of the output file
const FileType theFileType the type of the output file
Returns:
const bool true on success

Definition at line 490 of file omggdal.cpp.

References ArcInfoAscii, error(), gdal2Ascii(), gdal2Tiff(), and GeoTiff.

Referenced by OmgGdalConverter::on_pbnProcess_clicked().

Here is the call graph for this function:

void OmgGdal::error QString  theError  )  [signal]
 

Referenced by calculateStats(), contour(), convert(), and gdal2gdal().

const bool OmgGdal::gdal2Ascii const QString  theFileName,
const QString  theOutputFileName
 

Definition at line 583 of file omggdal.cpp.

References gdal2gdal().

Referenced by convert().

Here is the call graph for this function:

const bool OmgGdal::gdal2gdal const QString  theFileName,
const QString  theOutputFileName,
const QString  theFormat
 

Convert a gdal raster to another gdal raster format.

Parameters:
theFileName - raster to be converted
theOutputFileName - name of new raster to be created
theFormat - GDAL format as per http://www.gdal.org/formats_list.html

Definition at line 527 of file omggdal.cpp.

References error(), and progressCallback().

Referenced by gdal2Ascii(), and gdal2Tiff().

Here is the call graph for this function:

const bool OmgGdal::gdal2Tiff const QString  theFileName,
const QString  theOutputFileName
 

Definition at line 576 of file omggdal.cpp.

References gdal2gdal().

Referenced by convert().

Here is the call graph for this function:

const QString OmgGdal::getAsciiHeader const QString  theFileName  ) 
 

Definition at line 150 of file omggdal.cpp.

Referenced by OmgRasterThreshold::accept().

const QString OmgGdal::getWorldFile const QString  theFileName  ) 
 

Definition at line 121 of file omggdal.cpp.

bool OmgGdal::isValidGdalFile const QString  theFilename  )  [static]
 

A simple test to see if a file is a valid gdal raster.

Parameters:
QString the name of the file to test
Returns:
bool True if file is valid

Definition at line 602 of file omggdal.cpp.

Referenced by Omgui::traverseDirectories().

bool OmgGdal::isValidGdalProj const QString  theFilename  )  [static]
 

A simple test to see if a gdal raster has a valid projection

Parameters:
QString the name of the file to test
Returns:
bool True if file is valid

Definition at line 641 of file omggdal.cpp.

Referenced by Omgui::traverseDirectories().

const bool OmgGdal::makeLegend const QString  theOutputFileName,
const int  theWidth
 

This method will return a pixmap legend representation for the pseudocolor ramp used.

Returns:
true on success, false on failure

Definition at line 806 of file omggdal.cpp.

Referenced by OmgModel::postProcess().

void OmgGdal::showProgress int  theProgress,
int  theMaximum
 

Call the emitter a progress signal. We need this level of indirection to support gdal style call backs.

See also:
updateProgress

Definition at line 595 of file omggdal.cpp.

References updateProgress().

Referenced by progressCallback().

void OmgGdal::updateProgress int  theProgress,
int  theMaximum
[signal]
 

Emit a progress signal. should only ever be called using the showProgress method so we can properly support gdal style callbacks

See also:
showProgress

Referenced by showProgress().

void OmgGdal::writeImage QString  theInputFileString,
QString  theOutputFileString,
int  theWidth,
int  theHeight
 

Write a pseudocolour PNG out with user specified size.

Parameters:
theInputFileString A valid gdal raster layer
theOutFileString The name of the desired output image which will contain a pseudocolor image of the input layer.
theHeight - height in pixels for the output image
theWidth - width in pixels for the output image

Definition at line 765 of file omggdal.cpp.

Referenced by OmgRasterThreshold::accept(), main(), and OmgModel::postProcess().


The documentation for this class was generated from the following files:
Generated on Mon Apr 28 15:13:07 2008 for openModellerDesktop by  doxygen 1.4.1-20050210