SDTS_AL
Public Member Functions | List of all members
SDTSRasterReader Class Reference

#include <sdts_al.h>

Public Member Functions

int GetRasterType ()
 
int GetTransform (double *)
 
int GetMinMax (double *pdfMin, double *pdfMax, double dfNoData)
 
int GetXSize ()
 
int GetYSize ()
 
int GetBlockXSize ()
 
int GetBlockYSize ()
 
int GetBlock (int nXOffset, int nYOffset, void *pData)
 

Detailed Description

Class for reading raster data from a raster layer.

This class is somewhat unique among the reader classes in that it isn't derived from SDTSIndexedFeature, and it doesn't return "features". Instead it is used to read raster blocks, in the natural block size of the dataset.

Member Function Documentation

◆ GetBlock()

int SDTSRasterReader::GetBlock ( int  nXOffset,
int  nYOffset,
void *  pData 
)

Read a block of raster data from the file.

Parameters
nXOffsetX block offset into the file. Normally zero for scanline organized raster files.
nYOffsetY block offset into the file. Normally the scanline offset from top of raster for scanline organized raster files.
pDatapointer to GInt16 (signed short) buffer of data into which to read the raster.
Returns
TRUE on success and FALSE on error.

◆ GetBlockXSize()

int SDTSRasterReader::GetBlockXSize ( )
inline

Fetch the width of a source block (usually same as raster width).

◆ GetBlockYSize()

int SDTSRasterReader::GetBlockYSize ( )
inline

Fetch the height of a source block (usually one).

◆ GetMinMax()

int SDTSRasterReader::GetMinMax ( double *  pdfMin,
double *  pdfMax,
double  dfNoData 
)

Fetch the minimum and maximum raster values that occur in the file.

Note this operation current results in a scan of the entire file.

Parameters
pdfMinvariable in which the minimum value encountered is returned.
pdfMaxvariable in which the maximum value encountered is returned.
dfNoDataa value to ignore when computing min/max, defaults to -32766.
Returns
TRUE on success, or FALSE if an error occurs.

◆ GetRasterType()

int SDTSRasterReader::GetRasterType ( )

Fetch the pixel data type.

Returns one of SDTS_RT_INT16 (1) or SDTS_RT_FLOAT32 (6) indicating the type of buffer that should be passed to GetBlock().

◆ GetTransform()

int SDTSRasterReader::GetTransform ( double *  padfTransformOut)

Fetch the transformation between pixel/line coordinates and georeferenced coordinates.

Parameters
padfTransformOutpointer to an array of six doubles which will be filled with the georeferencing transform.
Returns
TRUE is returned, indicating success.

The padfTransformOut array consists of six values. The pixel/line coordinate (Xp,Yp) can be related to a georeferenced coordinate (Xg,Yg) or (Easting, Northing).

Xg = padfTransformOut[0] + Xp * padfTransform[1] + Yp * padfTransform[2]
Yg = padfTransformOut[3] + Xp * padfTransform[4] + Yp * padfTransform[5]

In other words, for a north up image the top left corner of the top left pixel is at georeferenced coordinate (padfTransform[0],padfTransform[3]) the pixel width is padfTransform[1], the pixel height is padfTransform[5] and padfTransform[2] and padfTransform[4] will be zero.

◆ GetXSize()

int SDTSRasterReader::GetXSize ( )
inline

Fetch the raster width.

Returns
the width in pixels.

◆ GetYSize()

int SDTSRasterReader::GetYSize ( )
inline

Fetch the raster height.

Returns
the height in pixels.

The documentation for this class was generated from the following files: