MapLink Pro 11.1.2.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches
TSLDirectImportDataLayer Class Reference
Inheritance diagram for TSLDirectImportDataLayer:

Detailed Description

This data layer allows direct loading of geospatial data.

Supported Data Formats

The TSLDirectImportDataLayer does not impose any restrictions on file formats. Instead these are determined by the available implementations of TSLDirectImportDriver.

A list of formats supported by Envitia please see the MapLink Pro Developer's Guide.

Each TSLDirectImportDriver may support a range of configuration options. These options may be set globally via the configuration files under the MapLink config directory/directimport.

Data Layout and scale bands

The TSLDirectImportDataLayer may load a mixture of raster and vector data, which may be displayed in any order.

One data path (a file path, web service URL or other data identifier) may correspond to multiple instances of TSLDirectImportDataSet, with each data set corresponding to a sub-layer within the data. Simple formats such as shapefiles will only contain a single dataset, which will correspond to the vector feature within the data. These data sets are handled independently of each other, and as such may be loaded on a selective basis. Data sets may also be loaded with different per-dataset settings such as feature rendering, and raster adjustments.

In order to load a data set, the application must call addScaleBand at least once. Each scale band within the data layer functions in a similar way to detail layers in a map, or layers within a MapLink Studio project.

  • Only one scale band will be displayed by the data layer at a time.
  • The selection of scale bands is based upon a calculated display scale, such as 1:100,000. In order for this to be accurate the application should set the parameters of the display via TSLDrawingSurfaceBase::setDeviceCapabilities. On some platforms these capabilities may be set automatically by the drawing surface.
  • A data set may be loaded into multiple scale bands. This may be used to display data as a background for all display scales. For raster data, overview datasets may be loaded if present in the original data. These are reduced resolution versions of the data set suitable for loading into overview layers.
  • Data loaded into a scale band will be split into tiles for processing/display. These tiling levels may either be set by the application, or calculated automatically. The automatic tiling calculation is based upon the minimum display scale of the band, and will create more tiles for more detailed scales. Applications must ensure that data is loaded at an appropriate scale in order to maintain performance.

Data Processing and Display

When a data set is loaded into the layer it will be split into a number of tiles (based on the scale band configuration), and processed asynchronously by default. Once a tile has been processed it will be stored in the on disk cache, and displayed. If the data needs to be reloaded after this point it will be loaded from the on disk cache.

Data will be scheduled for loading based on the current view extent, and the extentExpansion setting of the layer. The application may also request that a specific extent be processed, by calling preprocessData.

Complex vector data, or large amounts of raster data may take a long time to process. It is advisable to call preprocessData for these datasets prior to the point they need to be displayed in order to pre-process the data into the on disk cache.

If enabled via TSLDrawingSurfaceBase::setDataLayerProps, progressive display will be enabled for the following dataset types:

If enabled via TSLDirectImportDataLayer::synchronousDisplay, data will not be processed asynchronously, and will instead load all data within the view extent before drawing it.

Callbacks

The TSLDirectImportDataLayer is fully asynchronous by default, and will rarely block the calling thread for any significant amount of time.

In order to achieve this the following callback classes are provided:

  • TSLDirectImportDataLayerCallbacks - The application should always provide an implementation of this class. It provides the application with feedback on data processing, and is used to request that the application redraws the drawing surface.
  • TSLDirectImportDataLayerAnalysisCallbacks - The application should provide an implementation of this class when performing data analysis operations. An implementation of this class is not required when loading data for display.

Vector specific settings and styling

Other than styling/feature rendering information, vector specific settings are provided via TSLDirectImportVectorSettings.

Styling information for vector data is provided as a TSLFeatureClassConfig. This information may be set on a per data set basis, and may include rendering specific to each scale band. A feature configuration may be created through the MapLink API, or by exporting a MapLink Studio feature book.

The TSLFeatureClassConfig and associated classes provide many of the concepts used by MapLink Studio, including:

  • A hierarchical list of features
  • Different configuration for features based on product specification/detail level. When used in the Direct Import SDK, product specifications must be set on the dataset prior to loading via TSLDirectImportDataSet::product.
  • Feature masking
  • Automatic feature classification, for example with either a single feature per attribute value or classification based on a range of values
  • Multiple levels of feature classification
  • Text label generation based on attribute values

Data Analysis

The direct import layer provides functionality to analyse a dataset and produce an initial TSLFeatureClassConfig. This will populate the feature configuration with a list of features found in the data.

If present in the data, and supported by the direct import driver, the feature configuration may include feature classification, masking and rendering information.

This analysis can often take a long time as it requires iterating over all of the source data. This should be performed as an offline process, in order to produce a feature configuration for the data or product. Alternatively the feature configuration may be exported from the MapLink Studio feature book.

Data Attributes

In a similar fashion to MapLink Studio, the Direct Import layer will preserve attributes present in the source data. These may be accessed through the TSLDataSet class in a similar manner to other MapLink layers.

However:

  • Where other layer types have a single data handler, the Direct Import layer will have many (At least one per dataset).
  • As such, calling TSLDataLayer::dataHandler on this layer will always return null.
  • The data handler for each dataset may be accessed via TSLDataSet::dataHandler. Information about attribute fields should be read through the TSLDataSet class.#

Raster specific settings

Any raster specific settings for a data set are provided via TSLDirectImportRasterSettings.

Caching

In Memory Cache

The in memory cache will store processed and displayed data in memory. Data will be prioritised based on the most recently drawn area of the world, and will automatically be swapped to the on disk cache when required. The cache size will directly affect the display of vector data, and processing of both vector and raster data. If the in memory cache size is too small it may trigger a high amount of disk IO when panning the map display.

On Disk Cache

The on disk cache will store processed data on disk, along with the parameters used to create the data. Like the in memory cache data will be prioritised based on the most recently drawn area of the world. This cache may be left on disk once the data layer is destroyed, and re-used in a future run of the application. Any data which is loaded with the same settings as before will be loaded from disk, instead of being processed from the source data. The cache size will affect the amount of disk space used by the layer. If the on disk cache size is too small it will cause the data to be processed from source, which may delay the appearance of data on the display.

Raster Draw Cache

The raster draw cache is used to cache raster data when drawing. The cache size will affect the amount of raster data which can be displayed at a time. If the raster draw cache size is too small raster data may not be drawn, and will greatly reduce performance of the map display.

Classes

struct  DestroyDataSets
 

Public Member Functions

 TSLDirectImportDataLayer (unsigned int maxProcessingThreads=1, unsigned int maxCacheSizeMemory=256 *1024, const char *onDiskCachePath=NULL, unsigned int maxCacheSizeDisk=0, bool flushDiskOnExit=true)
 
TSLvector< TSLDirectImportDataSet * > * createDataSets (const char *data, TSLDirectImportDriver::OverviewType overviewTypes=TSLDirectImportDriver::OverviewTypeAny)
 
void extentExpansion (double expansion)
 
void enableDrawPerformanceTweaks (bool enable)
 
bool analyseData (TSLDirectImportDataSet *dataSet)
 
bool analyseData (const TSLvector< TSLDirectImportDataSet * > *dataSets)
 
bool loadData (TSLDirectImportDataSet *dataSet, const TSLFeatureClassConfig *config=NULL)
 
bool preprocessData (const TSLEnvelope &extent, TSLDirectImportDataSet *dataSet=NULL, TSLDirectImportScaleBand *scaleBand=NULL, double minScale=0.0, double maxScale=(std::numeric_limits< double >::max)())
 
unsigned int numScaleBands () const
 
TSLDirectImportScaleBandaddScaleBand (double minScale, const char *bandName, unsigned int tilesX=0, unsigned int tilesY=0)
 
TSLDirectImportScaleBandgetScaleBand (unsigned int index) const
 
unsigned int numProcessingThreads () const
 
void numProcessingThreads (unsigned int numThreads)
 
unsigned int maxMemoryCacheSize () const
 
void maxMemoryCacheSize (unsigned int maxSize)
 
unsigned int maxRasterDrawCacheSize () const
 
void maxRasterDrawCacheSize (unsigned int maxSize)
 
unsigned int maxDiskCacheSize () const
 
void maxDiskCacheSize (unsigned int maxSize)
 
const char * diskCachePath () const
 
void flushDiskCacheOnExit (bool flush)
 
void setCallbacks (TSLDirectImportDataLayerCallbacks *callbacks)
 
void setAnalysisCallbacks (TSLDirectImportDataLayerAnalysisCallbacks *callbacks)
 
void * operator new (size_t size) TSL_NO_THROW
 Allocation override for API redirection.
 
void * operator new (size_t size, char *filename, int line)
 
void synchronousDisplay (bool synchronous)
 
bool synchronousDisplay () const
 
- Public Member Functions inherited from TSLDataLayer
void addDrawingCallback (TSLDataLayerDrawingCallback *drawingCallback)
 
bool addFeatureRendering (const char *featureName, TSLFeatureID featureID)
 
bool addLoader (TSLFileLoader *loader, TSLLoaderAppCallback callback, void *arg, TSLAllLoadedCallback allLoadedCallback=0, void *arg2=0)
 
bool addPathList (const TSLPathList *path_list)
 
void cancelFlashback ()
 
bool clearFeatureRendering (const char *featureName, TSLFeatureID featureID)
 
TSLDataHandlercreateDataHandler (const char *config_file=0)
 
TSLHistoryVersion currentVersion () const
 
TSLDataHandlerdataHandler ()
 
const TSLDataHandlerdataHandler () const
 
void destroy ()
 
bool entityIsVisible (const TSLEntity *entity, const TSLDrawingSurface *drawingSurface) const
 
const TSLFeatureClassListfeatureList () const
 
const TSLFeatureClassListfeatureList (const char *detailLayerName) const
 
bool fileModificationTime (const char *filename, TSLTimeType &lastModificationTime)
 
TSLEntityfindEntity (TSLTMC x, TSLTMC y, TSLTMC aperture, int depth, const char *featureName=0, int drawingSurfaceID=-1)
 
bool findFile (const char *filename, TSLSimpleString &foundPath) const
 
void flashbackToTimestamp (TSLHistoryTimestamp timestamp, TSLLayerArchiveCallback archiveCallback, void *arg=0)
 
void flashbackToTimestamp (TSLHistoryTimestamp timestamp, TSLLayerArchiveTileCallback archiveTileCallback, void *arg=0)
 
void flashbackToVersion (TSLHistoryVersion version, TSLLayerArchiveCallback archiveCallback, void *arg=0)
 
void flashbackToVersion (TSLHistoryVersion version, TSLLayerArchiveTileCallback archiveTileCallback, void *arg=0)
 
bool getActiveLayerName (const TSLEnvelope &extent, double screenResolution, TSLSimpleString &activeLayerName) const
 
TSLEntityIteratorgetEntityIterator (const char *detailLayer, TSLSelector *selector=NULL, TSLEnvelope *extent=NULL, bool splitOptimisedPrimitives=true)
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *result) const
 
TSLFileLoadergetLoader ()
 
bool getMUExtent (double *x1, double *y1, double *x2, double *y2, int drawingSurfaceID=-1) const
 
bool getTMCExtent (TSLTMC *x1, TSLTMC *y1, TSLTMC *x2, TSLTMC *y2, int drawingSurfaceID=-1) const
 
bool getUUExtent (double *x1, double *y1, double *x2, double *y2, const TSLDrawingSurface *drawingSurface) const
 
bool importHistory (TSLHistoryVersion mapVersion, TSLHistoryTimestamp timestamp, TSLHistoryImportSet *historySet)
 
bool latLongToTMC (double latitude, double longitude, TSLTMC *x, TSLTMC *y, bool local=false) const
 
bool latLongToTMC (int num, double *latitudes, double *longitudes, TSLTMC *xs, TSLTMC *ys, bool local=false) const
 
TSLDataLayerTypeEnum layerType () const
 
bool loadData (const char *filename)
 
bool loadRendering (const char *filename)
 
void notifyChanged (bool changed=true)
 
TSLMapQueryquery (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, int depth=-1, const char *featureName=NULL, int drawingSurfaceID=-1) const
 
TSLMapQueryquery (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, TSLSelector *selector, int drawingSurfaceID=-1) const
 
const TSLCoordinateSystemgetCoordinateSystem () const
 
bool queryVersionHistory (const TSLEnvelope &extent, TSLVersionHistorySet &history)
 
void refreshFlashback ()
 
bool removeData ()
 
void releaseResources (int surfaceID)
 
bool saveRendering (const char *filename, TSLMapLinkVersion ver=TSL_CURRENT_MAPLINK_VERSION)
 
bool setCoordinateSystem (const TSLCoordinateSystem *coordinateSystem)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *value)
 
bool TMCToLatLong (TSLTMC x, TSLTMC y, double *latitude, double *longitude, bool local=false, bool boundCheck=true) const
 
bool TMCToLatLong (int num, TSLTMC *xs, TSLTMC *ys, double *latitudes, double *longitudes, bool local=false) const
 
const TSLVersionHistorySetversionHistory () const
 

Static Public Member Functions

static void destroyDataSets (TSLvector< TSLDirectImportDataSet * > *dataSets)
 
static unsigned int numDrivers ()
 
static TSLDirectImportDrivergetDriver (unsigned int index)
 

Constructor & Destructor Documentation

◆ TSLDirectImportDataLayer()

TSLDirectImportDataLayer::TSLDirectImportDataLayer ( unsigned int maxProcessingThreads = 1,
unsigned int maxCacheSizeMemory = 256 *1024,
const char * onDiskCachePath = NULL,
unsigned int maxCacheSizeDisk = 0,
bool flushDiskOnExit = true )

Constructor

If flushDiskOnExit is set to false the application must ensure the datalayer is properly destroyed. If the datalayer is not destroyed before the program exits the on-disk cache indexes will not be saved. This will cause any persistent data to be discarded the next time the cache is used.

Parameters
maxProcessingThreadsThe maximum number of threads to use when processing data. If 0 the datalayer will use 1 thread for each CPU core. By default the datalayer will use 1 processing thread in order to reduce memory usage.
maxCacheSizeMemoryThe maximum in-memory cache size in KB.
onDiskCachePathIf set the datalayer will cache processed data on disk, under this folder. If NULL the on-disk cache will be placed under the system's temporary directory. The on-disk cache may not be shared between multiple datalayers.
maxCacheSizeDiskThe maximum on-disk cache size in KB. A value of 0 means unlimited.
flushDiskOnExitIf true the on-disk cache will be deleted when the datalayer is destroyed. If false the data will persist and may be used when the application is restarted.

Member Function Documentation

◆ addScaleBand()

TSLDirectImportScaleBand * TSLDirectImportDataLayer::addScaleBand ( double minScale,
const char * bandName,
unsigned int tilesX = 0,
unsigned int tilesY = 0 )

Add a scale band to the layer

A scale band specifies a sub layer within the TSLDirectImportDataLayer.

The provided scale values will be used to enable/disable display of each scale band based on the current view scale. Example scale values:

  • 1:25K : 0.00004
  • 1:50K : 0.00002
  • 1:100K : 0.00001

To ensure that scale band selection is accurate the application must ensure that TSLDrawingSurfaceBase::setDeviceCapabilities has been called. On some platforms these capabilities may be set automatically by the drawing surface.

Data may be automatically placed in an appropriate based on scale by calling loadData. Data may also be loaded into a specific scale band by calling TSLDirectImportScaleBand::loadData.

If tiling values are specified by the application the tilesX parameter should usually be tilesY * 2. This is due to the fact that a global extent is 360 x 180 degrees.

Parameters
minScaleThe minimum (least detailed) scale for this band
bandNameThe name of this band.
tilesXThe desired number of horizontal tiles across a global extent. If 0 tiling will be automatically calculated based on the device capabilities and minScale.
tilesYThe desired number of vertical tiles across a global extent. If 0 tiling will be automatically calculated based on the device capabilities and minScale.
Returns
The created scale band, or NULL on error. The band may be modified but remains owned by the TSLDirectImportDataLayer.

◆ analyseData() [1/2]

bool TSLDirectImportDataLayer::analyseData ( const TSLvector< TSLDirectImportDataSet * > * dataSets)

Open some data, and analyse the features within it

This is an expensive operation and will be performed asynchronously. The result of the analysis process will be provided to the application via TSLDirectImportDataLayerAnalysisCallbacks::onAnalysisComplete.

The TSLFeatureClassConfig may then be modified by the application in order to setup feature masking/classification. This feature configuration should be saved by the application to avoid re-analysis and will be required when calling loadData.

If no callback class has been provided to the layer, this method will return NULL. If an analysis process is already scheduled for the data, this method will return NULL.

Parameters
dataSetsThe data to analyse. The application will receive a separate set of callbacks for each data set.
Returns
true if any analysis was scheduled, false otherwise.

◆ analyseData() [2/2]

bool TSLDirectImportDataLayer::analyseData ( TSLDirectImportDataSet * dataSet)

Open a data set, and analyse the features within it

This is an expensive operation and will be performed asynchronously. The result of the analysis process will be provided to the application via TSLDirectImportDataLayerAnalysisCallbacks::onAnalysisComplete.

The TSLFeatureClassConfig may then be modified by the application in order to setup feature masking/classification. This feature configuration should be saved by the application to avoid re-analysis and will be required when calling loadData.

If no callback class has been provided to the layer, this method will return NULL. If an analysis process is already scheduled for the data, this method will return NULL.

Parameters
dataSetThe data to analyse. This object may be created by calling createDataSets. The application retains ownership of this object.
Returns
true if the analysis was scheduled, false otherwise.

◆ createDataSets()

TSLvector< TSLDirectImportDataSet * > * TSLDirectImportDataLayer::createDataSets ( const char * data,
TSLDirectImportDriver::OverviewType overviewTypes = TSLDirectImportDriver::OverviewTypeAny )

Create data sets from a given data path

This method will check whether the data can be opened by the direct import layer and perform a basic analysis. Calling this method will not load any data into the layer for display, or perform any in-depth processing.

One data path may contain multiple data sets. Often these map to 'sub-layers' in the data.

For a detailed analysis of features within the data see TSLDirectImportDataLayer::analyseData.

To load the data for display see TSLDirectImportDataLayer::loadData and TSLDirectImportScaleBand::loadData.

If the direct import driver is unable extract coordinate system and extent information from the data these will be requested through TSLDirectImportDataLayerCallbacks. The application must provide this information in order to load the data.

Parameters
dataThe data path to analyse. This may be a file, URL, or other path supported by the available drivers.
overviewTypesA bitmask specifying which overview types to return. Usually TSLDirectImportDriver::OverviewTypeNone or TSLDirectImportDriver::OverviewTypeAny.
Returns
Basic information about the data, or NULL if the basic analysis couldn't be performed. The application is responsible for deleting the returned vector and its contents.
See also
destroyDataSets.

◆ destroyDataSets()

static void TSLDirectImportDataLayer::destroyDataSets ( TSLvector< TSLDirectImportDataSet * > * dataSets)
static

Delete one or more datasets

This utility function will delete the provided vector and all data sets within it.

This function will not affect the TSLDirectImportDataLayer's state in any way.

Parameters
dataSetsA vector of datasets, returned from createDataSets.

◆ diskCachePath()

const char * TSLDirectImportDataLayer::diskCachePath ( ) const

Query the on-disk cache path

Returns
The location of the on-disk cache.

◆ enableDrawPerformanceTweaks()

void TSLDirectImportDataLayer::enableDrawPerformanceTweaks ( bool enable)

Enable performance tweaks for data processing and display

By default this flag is false.

This flag should be enabled if an application constantly redraws the map display. The TSLDirectImportDataLayer will limit the number of operations performed during a draw in order to maintain higher framerates and reduce visual stutter.

The following may happen if this flag is enabled

Parameters
enabletrue to enable performance tweaks, false otherwise

◆ extentExpansion()

void TSLDirectImportDataLayer::extentExpansion ( double expansion)

Set the layer's extent expansion

A value > 0.0 will cause the layer to load/process tiles over a larger area than is specified. This may be useful when performing fast pan operations on the drawing surface, while loading complex data.

This expansion will not affect the rendering of the tiles themselves, only when they are loaded/processed into the tile cache.

Parameters
expansionThe expansion amount as a percentage i.e 10.0 == 10%. If <= 0.0 extent expansion will be disabled.

◆ flushDiskCacheOnExit()

void TSLDirectImportDataLayer::flushDiskCacheOnExit ( bool flush)

Set whether the datalayer should flush the on-disk cache when it is destroyed

If the on-disk cache is not flushed, it may be re-used on subsequent runs of an application. Data will only be loaded from the on-disk cache if all scale band and dataset settings are the same.

Parameters
flushtrue if the layer should delete the on-disk cache when it is destroyed

◆ getDriver()

static TSLDirectImportDriver * TSLDirectImportDataLayer::getDriver ( unsigned int index)
static

Query an instance of a direct import driver

Note
The returned driver instance is owned by the application
The datalayer will create additional driver instances when importing data. Setting a parameter on the returned driver instance will not affect the import process

◆ getScaleBand()

TSLDirectImportScaleBand * TSLDirectImportDataLayer::getScaleBand ( unsigned int index) const

Query a scale band from the layer

Parameters
indexThe index of the scale band
Returns
The requested scale band, or NULL on error. The band may be modified but remains owned by the TSLDirectImportDataLayer.

◆ loadData()

bool TSLDirectImportDataLayer::loadData ( TSLDirectImportDataSet * dataSet,
const TSLFeatureClassConfig * config = NULL )

Load and display a data set.

The provided TSLFeatureClassConfig will be used to determine feature masking, classification, and rendering of the data.

The provided data will be scheduled to load asynchronously. The application must provide an implementation of TSLDirectImportDataLayerCallbacks in order to be notified when the load/processing has completed.

The data will be loaded into an appropriate scale band, based on the scale of the data. This scale calculation will not normally be performed for vector data sets, so applications must ensure TSLDirectImportDataSet::scale is correct when using this method.

Data may be loaded into a specific scale band by calling TSLDirectImportScaleBand::loadData.

TSLDirectImportDataSet::minDisplayScale and TSLDirectImportDataSet::maxDisplayScale may be used to further limit the display of the dataset within the band.

If a TSLDirectImportDataSetMultiLevelRaster is loaded then any child data sets will be used in order to provide efficient processing/display within the scale band. The min/max display scale of the base data set and each child will be set accordingly in order to achieve this.

Features will be rendered based on the provided TSLFeatureClassConfig. If the features within the configuration belong to a product specification this will need to be set on the dataset via TSLDirectImportDataSet::product prior to loading.

Rendering may be specified on a per-dataset basis using product specifications, and multiple feature configurations. Rendering may be specified on a per-scale band basis using multiple feature configurations.

Parameters
dataSetThe data to load. This object may be created by calling createDataSets. The application retains ownership of this object.
configThe feature configuration object to use. This must be provided for vector datasets.
Returns
A pointer to the loaded dataset, or NULL on error.

◆ maxDiskCacheSize() [1/2]

unsigned int TSLDirectImportDataLayer::maxDiskCacheSize ( ) const

Query the maximum cache size for on-disk data

Returns
The maximum cache size in KB

◆ maxDiskCacheSize() [2/2]

void TSLDirectImportDataLayer::maxDiskCacheSize ( unsigned int maxSize)

Set the maximum cache size for on-disk data

This setting will directly affect load/processing performance. If it is too low, the datalayer will need to reprocess from source data in order to display a tile.

By default there is no limit for the on-disk cache.

Parameters
maxSizeThe maximum cache size in KB. A setting of 0 means unlimited.

◆ maxMemoryCacheSize() [1/2]

unsigned int TSLDirectImportDataLayer::maxMemoryCacheSize ( ) const

Query the maximum cache size for in-memory data

Returns
The maximum cache size in KB

◆ maxMemoryCacheSize() [2/2]

void TSLDirectImportDataLayer::maxMemoryCacheSize ( unsigned int maxSize)

Set the maximum cache size for in-memory data

This setting will directly affect the number of tiles which can be displayed at a time. If this setting is too low the datalayer may not draw all of the tiles within the drawing surface's view. This setting will also affect load/processing performance, especially if the on-disk cache is small. By default this settings is 256MB

Parameters
maxSizeThe maximum cache size in KB

◆ maxRasterDrawCacheSize() [1/2]

unsigned int TSLDirectImportDataLayer::maxRasterDrawCacheSize ( ) const

Query the maximum size of the raster draw cache

Returns
The maximum cache size in KB

◆ maxRasterDrawCacheSize() [2/2]

void TSLDirectImportDataLayer::maxRasterDrawCacheSize ( unsigned int maxSize)

Set the maximum cache size for the raster draw cache

This setting will limit the maximum amount of processed raster data loaded into memory at a time If this limit is exceeded, raster data may not be displayed, and may stall the map display while data is loaded from disk.

This setting will only affect the drawing of raster data, and will have no impact on data processing. By default this setting is 256MB

Parameters
maxSizeThe maximum cache size in KB

◆ numDrivers()

static unsigned int TSLDirectImportDataLayer::numDrivers ( )
static

Query the number of available direct import drivers

◆ numProcessingThreads() [1/2]

unsigned int TSLDirectImportDataLayer::numProcessingThreads ( ) const

Query the number processing threads

Returns
The number of threads used by the layer to load/process data.

◆ numProcessingThreads() [2/2]

void TSLDirectImportDataLayer::numProcessingThreads ( unsigned int numThreads)

Set the number of processing threads

By default the layer will use 1 processing thread.

Increasing the number of processing threads will allow the data layer to process data faster, however may cause a large increase in the amount of memory used. This depends on the direct import driver being used, and the source data type. For most applications 1 or 2 processing threads should be enough.

A value of zero will set the number of threads to 1 per CPU core.

Parameters
numThreadsThe number of threads to use for processing.

◆ numScaleBands()

unsigned int TSLDirectImportDataLayer::numScaleBands ( ) const

Query the number of scale bands within the layer

Returns
The number of scale bands configured on this layer

◆ operator new() [1/2]

void * TSLDirectImportDataLayer::operator new ( size_t size)

Allocation override for API redirection.

◆ operator new() [2/2]

void * TSLDirectImportDataLayer::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ preprocessData()

bool TSLDirectImportDataLayer::preprocessData ( const TSLEnvelope & extent,
TSLDirectImportDataSet * dataSet = NULL,
TSLDirectImportScaleBand * scaleBand = NULL,
double minScale = 0.0,
double maxScale = (std::numeric_limits< double >::max)() )

Manually pre-process/schedule tiles

By default the layer will create and schedule tiles as needed when the layer is drawn. This can result in a noticeable delay before data appears, while the data is being processed.

This method is provided to allow an application to pre-process data into the cache in order to minimise this delay.

This method should only be used for pre-processing and should not be called while the application is interacting with the map display.

Parameters
extentThe extent to schedule tiles within.
dataSetThe dataset to schedule tiles for. If NULL tiles will be scheduled for all datasets.
scaleBandThe scale band to schedule tiles for. If NULL tiles will be scheduled for all scale bands.
minScaleThe minimum display scale to schedule tiles for.
maxScaleThe maximum display scale to schedule tiles for.
Returns
true if any tiles were scheduled, false otherwise.

◆ setAnalysisCallbacks()

void TSLDirectImportDataLayer::setAnalysisCallbacks ( TSLDirectImportDataLayerAnalysisCallbacks * callbacks)

Set the callback object for data analysis operations

This object will be used to return data to the application from TSLDirectImportDataLayer::analyseData.

If no analysis callback is set, TSLDirectImportDataLayer::analyseData will always return false.

Note
If the application-provided callback object is destroyed the application must call setCallbacks(NULL).
Any application-provided callback must not be destroyed before the datalayer.
Parameters
callbacksThe callback object to use. Passing NULL will reset the callback to the default behaviour.

◆ setCallbacks()

void TSLDirectImportDataLayer::setCallbacks ( TSLDirectImportDataLayerCallbacks * callbacks)

Set the callback object

This object will be used to notify the application of progress, and when additional information is required to complete an operation.

If no callbacks are set, the datalayer will use a default implementation.

Note
If the application-provided callback object is destroyed the application must call setCallbacks(NULL).
Any application-provided callback must not be destroyed before the datalayer.
Parameters
callbacksThe callback object to use. Passing NULL will reset the callbacks to the default behaviour.

◆ synchronousDisplay() [1/2]

bool TSLDirectImportDataLayer::synchronousDisplay ( ) const

Get whether the layer will use synchronous display.

This is disabled by default.

Returns
true if the layer uses synchronous display, false otherwise.

◆ synchronousDisplay() [2/2]

void TSLDirectImportDataLayer::synchronousDisplay ( bool synchronous)

Enables/disables synchronous display.

This is disabled by default.

If enabled, the application will not return from the draw function until all data has been processed and displayed. This ensures that no blank areas will appear on the screen while panning/zooming.

Note
When enabled, the layer will switch to using a TSLFileLoaderBlocking. When disabled, it will use a TSLFileLoaderMT.
Enabling this when loading large amounts of data may cause your application to stutter.
Parameters
synchronoustrue enables synchronous display, false disables it.