19#ifndef _TM_GISDATARASTER_H_
20#define _TM_GISDATARASTER_H_
34DECLARE_EVENT_TYPE(tmEVT_LM_ROTATION_WARNING, -1)
35DECLARE_EVENT_TYPE(tmEVT_LM_INCOMPATIBLE_WARNING, -1)
39enum tmGISDATA_RASTER_TYPES {
40 tmGIS_RASTER_TIFF = 0,
46static wxString tmGISDATA_RASTER_TYPE_WILDCARDS[] = {wxTRANSLATE(
"Tiff raster file (*.tif,*.tiff)|*.tif;*.tiff"),
47 wxTRANSLATE(
"Esri's binary GRID (hdr.adf)|hdr.adf"),
48 wxTRANSLATE(
"Jpeg raster file (*.jpg, *.jpeg)|*.jpg;*.jpeg")};
50static wxString tmGISDATA_RASTER_TYPE_EXTENSION[] = {_T(
"*.tif;*.tiff"), _T(
"*.adf"), _T(
"*.jpg;*.jpeg"), _T(
"*.xml")};
52const wxString tmRASTER_DATATYPES[] = {wxTRANSLATE(
"Unknown data type"),
53 wxTRANSLATE(
"Eight bit unsigned integer"),
54 wxTRANSLATE(
"Sixteen bit unsigned integer"),
55 wxTRANSLATE(
"Sixteen bit signed integer"),
56 wxTRANSLATE(
"Thirty two bit unsigned integer"),
57 wxTRANSLATE(
"Thirty two bit signed integer"),
58 wxTRANSLATE(
"Thirty two bit floating point"),
59 wxTRANSLATE(
"Sixty four bit floating point"),
60 wxTRANSLATE(
"Complex Int16"),
61 wxTRANSLATE(
"Complex Int32"),
62 wxTRANSLATE(
"Complex Float32"),
63 wxTRANSLATE(
"Complex Float64"),
64 wxTRANSLATE(
"Data type out of limits")};
69 GDALDataset* m_DataSet;
70 GDALRasterBand* m_RasterBand;
76 wxArrayString m_RotationName;
77 wxArrayShort m_RotationStatus;
86 void*
ReadImageData(GDALRasterBand* gdalBand,
const wxRect& imgfilter,
const wxSize& imgSize,
int& buffsize);
99 virtual bool Open(
const wxString& filename,
bool bReadWrite = TRUE);
101 void UseExisting(
const wxString& filename, GDALDatasetH hdst);
103 virtual tmRealRect GetMinimalBoundingRectangle();
106 static void InitGISDriversRaster();
108 static wxString GetAllRasterGISFormatsWildcards();
110 static tmGISDataRaster* CreateGISRasterBasedOnType(
const int& gis_format_index);
112 static tmGISDataRaster* CreateGISRasterBasedOnExt(
const wxString& extension);
115 virtual TM_GIS_SPATIAL_TYPES GetSpatialType() {
116 return LAYER_SPATIAL_RASTER;
124 virtual CPLErr
GetImageData(
unsigned char** imgbuf,
unsigned int* imglen,
unsigned char** maskbuf,
125 unsigned int* masklen, wxSize imgSize);
129 virtual tmRealRect GetImageClipedCoordinates() {
130 return m_ClippedCoord;
148 virtual bool CreateSpatialIndex(GDALProgressFunc progress,
void* pfProgressData);
150 virtual int IsRaster() {
162 wxString m_TxtTemplate;
164 wxStaticText* m_TextLayerCtrl;
165 wxStaticText* m_TextRotationCtrl;
166 wxCheckBox* m_HideCtrl;
167 wxStdDialogButtonSizer* m_BtnSizerCtrl;
168 wxButton* m_BtnSizerCtrlOK;
169 wxButton* m_BtnSizerCtrlHelp;
171 void _CreateControls();
173 void OnHelp(wxCommandEvent& event);
180 virtual bool TransferDataFromWindow();
182 virtual bool TransferDataToWindow();
184 inline const bool GetHide()
const;
186 void SetHide(
bool value);
188 inline const double GetRotation1()
const;
190 void SetRotation1(
double value);
192 inline const double GetRotation2()
const;
194 void SetRotation2(
double value);
196 inline const wxString GetLayerName()
const;
198 void SetLayerName(wxString value);
201inline const bool tmRotationWarning_DLG::GetHide()
const {
205inline const double tmRotationWarning_DLG::GetRotation1()
const {
209inline const double tmRotationWarning_DLG::GetRotation2()
const {
213inline const wxString tmRotationWarning_DLG::GetLayerName()
const {
Definition tmgisdataraster.h:66
virtual int GetPyramidsInfo(wxArrayString *pyramids=nullptr)
Get info about pyramids.
Definition tmgisdataraster.cpp:928
bool GetImagePxSize(double &pxsizeX, double &pxsizeY, const tmRealRect &imgrealcoord=tmRealRect(0, 0, 0, 0))
Return width and height of pixels in real units.
Definition tmgisdataraster.cpp:191
wxString GetUnitMetaData()
Get Informations about Unit formatted for html.
Definition tmgisdataraster.cpp:912
wxString GetBandMetaData()
Getting number of band formatted as html.
Definition tmgisdataraster.cpp:897
virtual CPLErr GetImageData(unsigned char **imgbuf, unsigned int *imglen, unsigned char **maskbuf, unsigned int *masklen, wxSize imgSize)
Extract image data.
Definition tmgisdataraster.cpp:325
bool GetStatMinMaxNoDataValue(double &dmin, double &dmax, double &dnodata)
Returning min - max - nodata stat.
Definition tmgisdataraster.cpp:818
wxString GetImagePxSizeMetadata()
Get Pixels width and height.
Definition tmgisdataraster.cpp:1008
bool GetImageTranslucency(wxSize imgSize, int translucencypercent, unsigned char **alphachn)
Return the buffer corresponding to an alpha channel with specified translucency.
Definition tmgisdataraster.cpp:707
virtual bool SetSpatialFilter(tmRealRect filter, int type)
Define the area of interest.
Definition tmgisdataraster.cpp:272
double ReadGDALValueToDouble(void *data, GDALDataType type, int index)
Getting double value from data returned by GDAL.
Definition tmgisdataraster.cpp:770
wxSize GetImagePxDim()
Get Image dimensions in Pixels.
Definition tmgisdataraster.cpp:170
virtual int GetBandCount()
Getting number of band.
Definition tmgisdataraster.cpp:883
void * ReadImageData(GDALRasterBand *gdalBand, const wxRect &imgfilter, const wxSize &imgSize, int &buffsize)
Reading image data based on GDAL type.
Definition tmgisdataraster.cpp:742
virtual bool IsImageInsideVisibleArea()
Should we load image data.
Definition tmgisdataraster.cpp:297
virtual wxString GetMetaDataAsHtml()
Get Metadata information well formated.
Definition tmgisdataraster.cpp:858
virtual bool Open(const wxString &filename, bool bReadWrite=TRUE)
Generic open code.
Definition tmgisdataraster.cpp:47
wxRect ConvertClipedImage(const tmRealRect &origin, const tmRealRect &clipped)
Convert clipped Real size to image pixels size.
Definition tmgisdataraster.cpp:213
wxString GetPyramidsMetadata()
Getting pyramids info as html string.
Definition tmgisdataraster.cpp:979
Main class for dealing with GIS data.
Definition tmgisdata.h:48
Class representing real rectangle.
Definition tmgisscale.h:44
Definition tmgisdataraster.h:155