ToolMap
|
Public Member Functions | |
virtual bool | Open (const wxString &filename, bool bReadWrite=TRUE) |
Generic open code. | |
void | UseExisting (const wxString &filename, GDALDatasetH hdst) |
virtual tmRealRect | GetMinimalBoundingRectangle () |
virtual TM_GIS_SPATIAL_TYPES | GetSpatialType () |
virtual bool | SetSpatialFilter (tmRealRect filter, int type) |
Define the area of interest. | |
virtual bool | IsImageInsideVisibleArea () |
Should we load image data. | |
virtual CPLErr | GetImageData (unsigned char **imgbuf, unsigned int *imglen, unsigned char **maskbuf, unsigned int *masklen, wxSize imgSize) |
Extract image data. | |
bool | GetImageTranslucency (wxSize imgSize, int translucencypercent, unsigned char **alphachn) |
Return the buffer corresponding to an alpha channel with specified translucency. | |
virtual tmRealRect | GetImageClipedCoordinates () |
virtual int | GetBandCount () |
Getting number of band. | |
virtual int | GetPyramidsInfo (wxArrayString *pyramids=nullptr) |
Get info about pyramids. | |
virtual wxString | GetMetaDataAsHtml () |
Get Metadata information well formated. | |
wxString | GetBandMetaData () |
Getting number of band formatted as html. | |
wxString | GetUnitMetaData () |
Get Informations about Unit formatted for html. | |
wxString | GetPyramidsMetadata () |
Getting pyramids info as html string. | |
wxString | GetImagePxSizeMetadata () |
Get Pixels width and height. | |
virtual bool | CreateSpatialIndex (GDALProgressFunc progress, void *pfProgressData) |
virtual int | IsRaster () |
Public Member Functions inherited from tmGISData | |
tmGISData () | |
Constructor. | |
~tmGISData () | |
Destructor. | |
int | GetDataType () |
void | SetCoordConvert (tmCoordConvert *coordconvert) |
tmCoordConvert * | GetCoordConvert () |
virtual bool | Close () |
wxString | GetShortFileName () |
wxString | GetFullFileName () |
virtual wxString | GetDataSizeAsHtml (int iPrecision=2) |
virtual wxArrayLong * | SearchData (const tmRealRect &rect, int type) |
virtual wxArrayLong * | GetAllData () |
virtual bool | GetSnapCoord (const wxRealPoint &clickpt, double buffersize, wxArrayRealPoints &snapppts, int snaptype) |
virtual bool | IsPointSnapped (const wxRealPoint &point, int snaptype, long excludeoid=wxNOT_FOUND) |
Static Public Member Functions | |
static void | InitGISDriversRaster () |
static wxString | GetAllRasterGISFormatsWildcards () |
static tmGISDataRaster * | CreateGISRasterBasedOnType (const int &gis_format_index) |
static tmGISDataRaster * | CreateGISRasterBasedOnExt (const wxString &extension) |
Static Public Member Functions inherited from tmGISData | |
static void | InitGISDrivers (bool bRaster=TRUE, bool bVector=TRUE) |
Init the GDAL / OGR driver. | |
static wxString | GetAllSupportedGISFormatsWildcards () |
Return all supported formats. | |
static wxArrayString | GetAllSupportedGISFormatsExtensions () |
Returning all extensions in an array string. | |
static tmGISData * | CreateGISBasedOnType (const int &gis_format_index) |
Create an object of the specified format. | |
static tmGISData * | CreateGISBasedOnExt (const wxString &extension) |
static tmGISData * | LoadLayer (tmLayerProperties *layerprop) |
Call this function for loading a layer. | |
static void | EnableLogging (bool enable=true) |
static bool | IsLoggingEnabled () |
Protected Member Functions | |
wxSize | GetImagePxDim () |
Get Image dimensions in Pixels. | |
bool | GetImagePxSize (double &pxsizeX, double &pxsizeY, const tmRealRect &imgrealcoord=tmRealRect(0, 0, 0, 0)) |
Return width and height of pixels in real units. | |
wxRect | ConvertClipedImage (const tmRealRect &origin, const tmRealRect &clipped) |
Convert clipped Real size to image pixels size. | |
void * | ReadImageData (GDALRasterBand *gdalBand, const wxRect &imgfilter, const wxSize &imgSize, int &buffsize) |
Reading image data based on GDAL type. | |
double | ReadGDALValueToDouble (void *data, GDALDataType type, int index) |
Getting double value from data returned by GDAL. | |
bool | GetStatMinMaxNoDataValue (double &dmin, double &dmax, double &dnodata) |
Returning min - max - nodata stat. | |
Protected Member Functions inherited from tmGISData | |
wxString | GetMinimalBoundingRectangleAsHtml (int iprecision=2) |
Get Minimal bounding rectangle as html. | |
Protected Attributes | |
GDALDataset * | m_DataSet |
GDALRasterBand * | m_RasterBand |
wxString | m_FileType |
wxRect | m_PxImgFilter |
tmRealRect | m_RasterExtent |
tmRealRect | m_ClippedCoord |
wxArrayString | m_RotationName |
wxArrayShort | m_RotationStatus |
Protected Attributes inherited from tmGISData | |
int | m_ClassType |
|
protected |
Convert clipped Real size to image pixels size.
origin | Non clipped coordinates (Real) |
clipped | Clipped coordinates (Real) |
|
virtual |
Reimplemented from tmGISData.
|
virtual |
Getting number of band.
wxString tmGISDataRaster::GetBandMetaData | ( | ) |
Getting number of band formatted as html.
|
virtual |
Extract image data.
Extract the image data from the GDALDataset and pack it into a single array of RGB triples. Use the ColorTable to determine the RGB values. We extract the data from the GDALDataset rather than create our own driver because the data needs to be translated from 4 byte pixel information into 3 byte RGB information. This could be done as the data is written to the data set or afterwards, as it is done here. Any minor savings from our own driver are outweighed by the high development/maintenance costs.
imgbuf | ??? |
imglen | ??? |
maskbuf | ??? |
masklen | ??? |
imgSize | ??? |
|
protected |
Get Image dimensions in Pixels.
|
protected |
Return width and height of pixels in real units.
Divide the width and height of image by the width and height of image in pixels
pxsizeX | value of one pixels width in real units |
pxsizeY | value of one pixels height in real units |
imgrealcoord | If specified, image coordinates aren't calculated again. But if empty, function will calculate image coordinate. |
wxString tmGISDataRaster::GetImagePxSizeMetadata | ( | ) |
Get Pixels width and height.
bool tmGISDataRaster::GetImageTranslucency | ( | wxSize | imgSize, |
int | translucencypercent, | ||
unsigned char ** | alphachn | ||
) |
Return the buffer corresponding to an alpha channel with specified translucency.
This function is made for use with wxImage::SetAlpha()
imgSize | the size of the raster |
translucencypercent | percent of translucency desired |
alphachn | a buffer containing the raster's alpha chanel |
|
virtual |
Get Metadata information well formated.
Reimplemented from tmGISData.
|
virtual |
Reimplemented from tmGISData.
|
virtual |
Get info about pyramids.
Pyramids are small image subsets usefull for displaying raster faster
pyramids | String containing all pyramids informations if pyramids isn't nullptr. |
wxString tmGISDataRaster::GetPyramidsMetadata | ( | ) |
Getting pyramids info as html string.
Pyramids are small image subsets usefull for displaying raster faster
|
inlinevirtual |
Reimplemented from tmGISData.
|
protected |
Returning min - max - nodata stat.
This function return the following statistics :
dmin | will contain the minimum value |
dmax | will contain the maximum value |
dnodata | will contain the value used for nodata |
wxString tmGISDataRaster::GetUnitMetaData | ( | ) |
Get Informations about Unit formatted for html.
|
virtual |
Should we load image data.
This function works only if tmGISDataRaster::SetSpatialFilter was called before. This function return true if m_PxImgFilter contain valid coordinates
|
inlinevirtual |
Reimplemented from tmGISData.
|
virtual |
Generic open code.
Mainly init member values used by all GIS class
filename | path and name of the GIS data to open |
bReadWrite | Should we open the dataset for r/w operations ? |
Reimplemented from tmGISData.
|
protected |
Getting double value from data returned by GDAL.
This function allows to deals with image with different data type such as those described in GDALDataType (see gdal doc)
data | Pointer to data returned by tmGISDataRaster::ReadImageData |
type | type of data as returned by gdalBand->GetRasterDataType() |
index | index of the pixel |
|
protected |
Reading image data based on GDAL type.
This function is used actually for DTM but may be extended for all raster.
gdalBand | Pointer to a valid GDAL band |
imgfilter | Position and width of the image in real px. For reading all image pass 0,0, width, height |
imgSize | Size of the bitmap we will use for displaying data |
buffsize |
|
virtual |
Define the area of interest.
This function define the area we are interessed in. Reading may be done after with GetRasterData function.
filter | Filter real coordinates |
type | one of value defined in TOC_GENERIC_NAME such as :
|
Reimplemented in tmGISDataRasterWeb.