ToolMap
Loading...
Searching...
No Matches
tmGISData Class Reference

Main class for dealing with GIS data. More...

#include <tmgisdata.h>

Inheritance diagram for tmGISData:
tmGISDataRaster tmGISDataVector tmGISDataRasterEGRID tmGISDataRasterJPEG tmGISDataRasterTIFF tmGISDataRasterWeb tmGISDataVectorMYSQL tmGISDataVectorSHP tmGISDataVectorSHPMemory

Public Member Functions

 tmGISData ()
 Constructor.
 
 ~tmGISData ()
 Destructor.
 
int GetDataType ()
 
void SetCoordConvert (tmCoordConvert *coordconvert)
 
tmCoordConvertGetCoordConvert ()
 
virtual bool Open (const wxString &filename, bool bReadWrite=TRUE)
 Generic open code.
 
virtual bool Close ()
 
virtual tmRealRect GetMinimalBoundingRectangle ()
 
virtual TM_GIS_SPATIAL_TYPES GetSpatialType ()
 
wxString GetShortFileName ()
 
wxString GetFullFileName ()
 
virtual wxString GetMetaDataAsHtml ()
 
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)
 
virtual bool CreateSpatialIndex (GDALProgressFunc progress, void *pfProgressData)
 
virtual int IsRaster ()
 

Static Public Member Functions

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 tmGISDataCreateGISBasedOnType (const int &gis_format_index)
 Create an object of the specified format.
 
static tmGISDataCreateGISBasedOnExt (const wxString &extension)
 
static tmGISDataLoadLayer (tmLayerProperties *layerprop)
 Call this function for loading a layer.
 
static void EnableLogging (bool enable=true)
 
static bool IsLoggingEnabled ()
 

Protected Member Functions

wxString GetMinimalBoundingRectangleAsHtml (int iprecision=2)
 Get Minimal bounding rectangle as html.
 

Protected Attributes

int m_ClassType
 

Detailed Description

Main class for dealing with GIS data.

This class may be used for accessing GIS data using GDAL / OGR driver see also : http://www.gdal.org/

Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

Constructor & Destructor Documentation

◆ tmGISData()

tmGISData::tmGISData ( )

Constructor.

Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

◆ ~tmGISData()

tmGISData::~tmGISData ( )

Destructor.

Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

Member Function Documentation

◆ CreateGISBasedOnType()

tmGISData * tmGISData::CreateGISBasedOnType ( const int &  gis_format_index)
static

Create an object of the specified format.

Allowed values for gis_format_index are those from the tmGISDATA_RASTER_TYPES and from the tmGISDATA_VECTOR_TYPES

Parameters
gis_format_indexzero based index of the item type to create
Returns
pointer to an object of the correct type or nullptr if something's going wrong
Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

◆ GetAllData()

virtual wxArrayLong * tmGISData::GetAllData ( )
inlinevirtual

Reimplemented in tmGISDataVectorMYSQL, and tmGISDataVectorSHP.

◆ GetAllSupportedGISFormatsExtensions()

wxArrayString tmGISData::GetAllSupportedGISFormatsExtensions ( )
static

Returning all extensions in an array string.

All supported extensions in an array string but not the mysql one (because no extension is valid for that format).

Note
Raster format are returned first
Returns
all supported extension, raster ones first
Author
Lucien Schreiber (c) CREALP 2008
Date
06 August 2008

◆ GetAllSupportedGISFormatsWildcards()

wxString tmGISData::GetAllSupportedGISFormatsWildcards ( )
static

Return all supported formats.

Return the wildcards of all supported formats for loading.

Returns
A String containing all supported formats as wildcards that one may use in a dialog box for file selection
Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

◆ GetDataSizeAsHtml()

virtual wxString tmGISData::GetDataSizeAsHtml ( int  iPrecision = 2)
inlinevirtual

◆ GetMetaDataAsHtml()

virtual wxString tmGISData::GetMetaDataAsHtml ( )
inlinevirtual

◆ GetMinimalBoundingRectangleAsHtml()

wxString tmGISData::GetMinimalBoundingRectangleAsHtml ( int  iprecision = 2)
protected

Get Minimal bounding rectangle as html.

This function is intented for getting minimal bounding rectangle for metadata

Returns
An html compliant string
Author
Lucien Schreiber (c) CREALP 2008
Date
23 October 2008

◆ GetSnapCoord()

virtual bool tmGISData::GetSnapCoord ( const wxRealPoint &  clickpt,
double  buffersize,
wxArrayRealPoints &  snapppts,
int  snaptype 
)
inlinevirtual

Reimplemented in tmGISDataVectorMYSQL, and tmGISDataVectorSHP.

◆ GetSpatialType()

virtual TM_GIS_SPATIAL_TYPES tmGISData::GetSpatialType ( )
inlinevirtual

Reimplemented in tmGISDataVectorMYSQL.

◆ InitGISDrivers()

void tmGISData::InitGISDrivers ( bool  bRaster = TRUE,
bool  bVector = TRUE 
)
static

Init the GDAL / OGR driver.

Call this function during program startup to allow all GDAL / OGR drivers to be loaded.

Parameters
bRasterShould we load all GDAL rasters drivers
bVectorShould we load all OGR vector drivers
Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

◆ LoadLayer()

tmGISData * tmGISData::LoadLayer ( tmLayerProperties layerProp)
static

Call this function for loading a layer.

This function create an object of type tmGISData based on layer properties

Parameters
layerPropthe layer properties
Returns
a valid tmGISData object or nullptr if an error occur
Author
Lucien Schreiber (c) CREALP 2009
Date
30 January 2009

◆ Open()

bool tmGISData::Open ( const wxString &  filename,
bool  bReadWrite = TRUE 
)
virtual

Generic open code.

Mainly init member values used by all GIS class

Parameters
filenamepath and name of the GIS data to open
bReadWriteShould we open the dataset for r/w operations ?
Returns
Allways TRUE
Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

Reimplemented in tmGISDataVectorMYSQL, tmGISDataVectorSHP, and tmGISDataRaster.

◆ SearchData()

virtual wxArrayLong * tmGISData::SearchData ( const tmRealRect rect,
int  type 
)
inlinevirtual

Reimplemented in tmGISDataVectorMYSQL, and tmGISDataVectorSHP.


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