Public Member Functions | |
VRTDataset (int nXSize, int nYSize) | |
void | SetNeedsFlush () |
virtual void | FlushCache () |
void | SetWritable (int bWritable) |
virtual const char * | GetProjectionRef (void) |
virtual CPLErr | SetProjection (const char *) |
virtual CPLErr | GetGeoTransform (double *) |
virtual CPLErr | SetGeoTransform (double *) |
virtual CPLErr | SetMetadata (char **papszMD, const char *pszDomain="") |
virtual CPLErr | SetMetadataItem (const char *pszName, const char *pszValue, const char *pszDomain="") |
virtual int | GetGCPCount () |
virtual const char * | GetGCPProjection () |
virtual const GDAL_GCP * | GetGCPs () |
virtual CPLErr | SetGCPs (int nGCPCount, const GDAL_GCP *pasGCPList, const char *pszGCPProjection) |
virtual CPLErr | AddBand (GDALDataType eType, char **papszOptions=NULL) |
virtual CPLXMLNode * | SerializeToXML (const char *pszVRTPath) |
virtual CPLErr | XMLInit (CPLXMLNode *, const char *) |
Static Public Member Functions | |
static int | Identify (GDALOpenInfo *) |
static GDALDataset * | Open (GDALOpenInfo *) |
static GDALDataset * | OpenXML (const char *, const char *=NULL) |
static GDALDataset * | Create (const char *pszName, int nXSize, int nYSize, int nBands, GDALDataType eType, char **papszOptions) |
CPLErr VRTDataset::AddBand | ( | GDALDataType | eType, | |
char ** | papszOptions = NULL | |||
) | [virtual] |
Add a band to a dataset.
This method will add a new band to the dataset if the underlying format supports this action. Most formats do not.
Note that the new GDALRasterBand is not returned. It may be fetched after successful completion of the method by calling GDALDataset::GetRasterBand(GDALDataset::GetRasterCount()-1) as the newest band will always be the last band.
eType | the data type of the pixels in the new band. | |
papszOptions | a list of NAME=VALUE option strings. The supported options are format specific. NULL may be passed by default. |
Reimplemented from GDALDataset.
Reimplemented in VRTWarpedDataset.
References GDALGetDataTypeSize(), GDALDataset::GetRasterCount(), GDALDataset::GetRasterXSize(), and GDALDataset::GetRasterYSize().
void VRTDataset::FlushCache | ( | void | ) | [virtual] |
Flush all write cached data to disk.
Any raster (or other GDAL) data written via GDAL calls, but buffered internally will be written to disk.
This method is the same as the C function GDALFlushCache().
Reimplemented from GDALDataset.
References CPLGetPath(), GDALMajorObject::GetDescription(), VSIFCloseL(), VSIFOpenL(), and VSIFWriteL().
int VRTDataset::GetGCPCount | ( | ) | [virtual] |
Get number of GCPs.
This method is the same as the C function GDALGetGCPCount().
Reimplemented from GDALDataset.
const char * VRTDataset::GetGCPProjection | ( | ) | [virtual] |
Get output projection for GCPs.
This method is the same as the C function GDALGetGCPProjection().
The projection string follows the normal rules from GetProjectionRef().
Reimplemented from GDALDataset.
const GDAL_GCP * VRTDataset::GetGCPs | ( | ) | [virtual] |
Fetch GCPs.
This method is the same as the C function GDALGetGCPs().
Reimplemented from GDALDataset.
CPLErr VRTDataset::GetGeoTransform | ( | double * | padfTransform | ) | [virtual] |
Fetch the affine transformation coefficients.
Fetches the coefficients for transforming between pixel/line (P,L) raster space, and projection coordinates (Xp,Yp) space.
Xp = padfTransform[0] + P*padfTransform[1] + L*padfTransform[2]; Yp = padfTransform[3] + P*padfTransform[4] + L*padfTransform[5];
In a north up image, padfTransform[1] is the pixel width, and padfTransform[5] is the pixel height. The upper left corner of the upper left pixel is at position (padfTransform[0],padfTransform[3]).
The default transform is (0,1,0,0,0,1) and should be returned even when a CE_Failure error is returned, such as for formats that don't support transformation to projection coordinates.
NOTE: GetGeoTransform() isn't expressive enough to handle the variety of OGC Grid Coverages pixel/line to projection transformation schemes. Eventually this method will be depreciated in favour of a more general scheme.
This method does the same thing as the C GDALGetGeoTransform() function.
padfTransform | an existing six double buffer into which the transformation will be placed. |
Reimplemented from GDALDataset.
const char * VRTDataset::GetProjectionRef | ( | void | ) | [virtual] |
Fetch the projection definition string for this dataset.
Same as the C function GDALGetProjectionRef().
The returned string defines the projection coordinate system of the image in OpenGIS WKT format. It should be suitable for use with the OGRSpatialReference class.
When a projection definition is not available an empty (but not NULL) string is returned.
Reimplemented from GDALDataset.
CPLErr VRTDataset::SetGCPs | ( | int | nGCPCount, | |
const GDAL_GCP * | pasGCPList, | |||
const char * | pszGCPProjection | |||
) | [virtual] |
Assign GCPs.
This method is the same as the C function GDALSetGCPs().
This method assigns the passed set of GCPs to this dataset, as well as setting their coordinate system. Internally copies are made of the coordinate system and list of points, so the caller remains resposible for deallocating these arguments if appropriate.
Most formats do not support setting of GCPs, even foramts that can handle GCPs. These formats will return CE_Failure.
nGCPCount | number of GCPs being assigned. | |
pasGCPList | array of GCP structures being assign (nGCPCount in array). | |
pszGCPProjection | the new OGC WKT coordinate system to assign for the GCP output coordinates. This parameter should be "" if no output coordinate system is known. |
Reimplemented from GDALDataset.
CPLErr VRTDataset::SetGeoTransform | ( | double * | ) | [virtual] |
Set the affine transformation coefficients.
See GetGeoTransform() for details on the meaning of the padfTransform coefficients.
This method does the same thing as the C GDALSetGeoTransform() function.
padfTransform | a six double buffer containing the transformation coefficients to be written with the dataset. |
Reimplemented from GDALDataset.
Referenced by GDALCreateWarpedVRT().
CPLErr VRTDataset::SetMetadata | ( | char ** | papszMetadataIn, | |
const char * | pszDomain = "" | |||
) | [virtual] |
Set metadata.
The C function GDALSetMetadata() does the same thing as this method.
papszMetadata | the metadata in name=value string list format to apply. | |
pszDomain | the domain of interest. Use "" or NULL for the default domain. |
Reimplemented from GDALMajorObject.
CPLErr VRTDataset::SetMetadataItem | ( | const char * | pszName, | |
const char * | pszValue, | |||
const char * | pszDomain = "" | |||
) | [virtual] |
Set single metadata item.
The C function GDALSetMetadataItem() does the same thing as this method.
pszName | the key for the metadata item to fetch. | |
pszValue | the value to assign to the key. | |
pszDomain | the domain to set within, use NULL for the default domain. |
Reimplemented from GDALMajorObject.
CPLErr VRTDataset::SetProjection | ( | const char * | ) | [virtual] |
Set the projection reference string for this dataset.
The string should be in OGC WKT or PROJ.4 format. An error may occur because of incorrectly specified projection strings, because the dataset is not writable, or because the dataset does not support the indicated projection. Many formats do not support writing projections.
This method is the same as the C GDALSetProjection() function.
pszProjection | projection reference string. |
Reimplemented from GDALDataset.