MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLGARSGridDataLayer Class Reference
Inheritance diagram for TSLGARSGridDataLayer:

Detailed Description

This draws a GARS (Global Area Reference System) grid over a map data layer.

GARS divides the surface of the earth into 30-minute by 30-minute cells. Each cell is identified by a five-character designation. (ex. 006AG) The first three characters designate a 30-minute wide longitudinal band. Beginning with the 180-degree meridian and proceeding eastward, the bands are numbered from 001 to 720, so that 180 E to 179 30'W is band 001; 179 30'W to 179 00'W is band 002; and so on. The fourth and fifth characters designate a 30-minute wide latitudinal band. Beginning at the south pole and proceeding northward, the bands are lettered from AA to QZ (omitting I and O) so that 90 00'S to 89 30'S is band AA; 89 30'S to 89 00'S is band AB; and so on. Each 30-minute cell is divided into four 15-minute by 15-minute quadrants. The quadrants are numbered sequentially, from west to east, starting with the northernmost band. Specifically, the northwest quadrant is "1"; the northeast quadrant is "2"; the southwest quadrant is "3"; the southeast quadrant is "4". Each quadrant is identified by a six-character designation. (ex. 006AG3) The first five characters comprise the 30-minute cell designation. The sixth character is the quadrant number. Each 15-minute quadrant is divided into nine 5-minute by 5-minute areas. The areas are numbered sequentially, from west to east, starting with the northernmost band. The graphical representation of a 15-minute quadrant with numbered 5-minute by 5-minute areas resembles a telephone keypad. Each 5-minute by 5-minute area, or keypad "key" is identified by a seven-character designation. The first six characters comprise the 15-minute quadrant designation. The seventh character is the keypad "key" number, (eg.006AG39)

This adds special features to allow configuration of the rendering. At present, these are:

Line rendition styles

  • "GARSLonBand" : longitude lines (at top level)
  • "GARSLonQuad" : longitude lines (at Quad level)
  • "GARSLonArea" : longitude lines (at Area level)
  • "GARSLatBand" : latitude lines (at top level)
  • "GARSLatQuad" : latitude lines (at Quad level)
  • "GARSLatArea" : latitude lines (at Area level)

Use the setFeatureRendering method to configure the rendering options for these.

Text rendering styles

  • "GARSLabel" : text style of the label applied to a GARS Grid square.

The line rendering can be disabled by setting the edge style to 0.

Coordinate Systems

The layer requires a Coordinate Systems to allow it to work out the grid points. The layer by default will use the Drawing Surface Coordinate System. This may be changed by the user by a call to addDataLayer with a coordinate system providing layer.

In both cases the Coordinate System must be correctly setup before the first draw of the grid layer or before calling addDataLayer as the layer takes a copy of the Coordinate System.

This layer should not be shared between Drawing Surfaces as it caches data based on the current view.

If the coordinate system is changed on the Drawing Surface or a map with a new coordinate system is loaded into the map data-layer then notifiedChanged should be called with true. This will cause the cache to be flushed and the Coordinate System to be queried again.

If you delete the map data-layer associated with the layer then you should call setDataLayer with NULL.

Public Member Functions

 TSLGARSGridDataLayer ()
 
TSLGridDetailLevelChangeEnum getGridLevelChangeMode () const
 
void setDataLayer (TSLDataLayer *dataLayer)
 
void setGridLevelChangeMode (TSLGridDetailLevelChangeEnum mode)
 
bool snap (TSLCoord *snap_pt, double &latitude, double &longitude, bool force_snap=false, bool snapToMiddle=false)
 
void snapable (bool value)
 
bool snapable ()
 
void * operator new (size_t size) TSL_NO_THROW
 
void * operator new (size_t size, char *filename, int line)
 
- 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
 

Protected Member Functions

 ~TSLGARSGridDataLayer ()
 

Constructor & Destructor Documentation

◆ TSLGARSGridDataLayer()

TSLGARSGridDataLayer::TSLGARSGridDataLayer ( )

◆ ~TSLGARSGridDataLayer()

TSLGARSGridDataLayer::~TSLGARSGridDataLayer ( )
protected

Protected destructor to stop being instantiated on the stack Forces user to use new operator and destroy method.

Member Function Documentation

◆ getGridLevelChangeMode()

TSLGridDetailLevelChangeEnum TSLGARSGridDataLayer::getGridLevelChangeMode ( ) const

This method allows users to retrieve the current Grid Level Change Mode.

◆ operator new() [1/2]

void * TSLGARSGridDataLayer::operator new ( size_t size)

Allocation override for API redirection

◆ operator new() [2/2]

void * TSLGARSGridDataLayer::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.

◆ setDataLayer()

void TSLGARSGridDataLayer::setDataLayer ( TSLDataLayer * dataLayer)

This sets the map layer that the grid is to overlay.

You should call this method with the layer whenever the coordinate-system is changed. This will cause the grid cache to be flushed and re-calculated.

Parameters
dataLayerThe Coordinate Providing Data Layer for the grid to use for its latitude longitude conversions.

◆ setGridLevelChangeMode()

void TSLGARSGridDataLayer::setGridLevelChangeMode ( TSLGridDetailLevelChangeEnum mode)

This method allows users to change the Grid Level Change Mode. The modes available are:

TSLGridLevelChangeAutomatic - level changes are determined automatically by the TSGARSGridDataLayer

TSLGridLevelChangeManual - level changes are determined by the user setting the rendering edge styles of the GARS Grid Lines, e.g. setting the value of the Band Longitude and Latitude edge styles to a value greater than 0 will enable the calculation of the GARS Band grids.

NOTE: If the Manual mode is used then the User needs to be aware that setting of Sub Grids at too high a zoom level will seriously impinge on performance and memory usage.

Parameters
modeThe Change mode to be used.

◆ snap()

bool TSLGARSGridDataLayer::snap ( TSLCoord * snap_pt,
double & latitude,
double & longitude,
bool force_snap = false,
bool snapToMiddle = false )

This method returns the point snapped to given the initial position.

Parameters
snap_pton entry the point to snap, on exit this may be changed to the centre or lower left of the grid square.
latitude[output] latitude of the snapped point
longitude[output] longitude of the snapped point
force_snapsnap to the grid square even if snapable() would return false.
snapToMiddleif true then snap the point to the middle of the square
Returns
true on success, false otherwise.

◆ snapable() [1/2]

bool TSLGARSGridDataLayer::snapable ( )

Returns true if snap() snaps points to the nearest grid square, false otherwise.

◆ snapable() [2/2]

void TSLGARSGridDataLayer::snapable ( bool value)

This controls whether snap() snaps points to the nearest grid square.

Parameters
valuePass true if snap is to snap to the nearest grid square.