MapLink Pro 11.2
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTiledNetwork Class Reference

Classes

class  link_iterator
 
class  node_iterator
 
class  turn_iterator
 

Public Types

enum  find_type { tsl_nwk_find_both = 0 , tsl_nwk_find_links = 1 , tsl_nwk_find_nodes = 2 }
 

Public Member Functions

bool addPath (const char *dir_name)
 
link_iterator begin_links (const node_iterator &it)
 
link_iterator begin_links (long node_id)
 
turn_iterator begin_turns (long node_id)
 
turn_iterator begin_turns (const node_iterator &it)
 
void cacheSize (long new_size)
 
void cacheFlushLimit (long flush_limit)
 
bool clearCache ()
 
link_iterator end_links (long node_id)
 
link_iterator end_links (const node_iterator &it)
 
turn_iterator end_turns (long node_id)
 
turn_iterator end_turns (const node_iterator &it)
 
TSLNetworkQueryfind (const TSLEnvelope *extent, const TSLNwkSelector &filter, TSLTiledNetwork::find_type filter_mode=TSLTiledNetwork::tsl_nwk_find_both)
 
link_iterator find_link (const TSLCoord &location, Long aperture)
 
node_iterator find_node (const TSLCoord &location, Long aperture)
 
link_iterator get_link (long link_id)
 
node_iterator get_node (long node_id)
 
turn_iterator get_turn (long turn_id)
 
node_iterator linkDestinNode (const link_iterator &it)
 
node_iterator linkSourceNode (const link_iterator &it)
 
bool loadData (const char *filename)
 
bool lockQuery (const TSLNetworkQuery &query, bool *all_loaded=0)
 
bool lockQuery (const TSLRouteQuery &query, bool *all_loaded=0)
 
bool lockRegion (const TSLEnvelope &extent, bool *all_loaded=0)
 
bool lockRegion (const TSLPolyline &polyline, bool *all_loaded=0)
 
bool removeData ()
 
TSLRouteQueryroute (long from_node, long to_node, long *via_nodes, long via_count, TSLPathCost &cost, double max_cost)
 
link_iterator turnDestinLink (const turn_iterator &it)
 
link_iterator turnSourceLink (const turn_iterator &it)
 
bool unlockAll ()
 
bool unlockQuery (const TSLNetworkQuery &query)
 
bool unlockQuery (const TSLRouteQuery &query)
 
bool unlockRegion (const TSLEnvelope &extent)
 
bool unlockRegion (const TSLPolyline &polyline)
 
void destroy ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, char *filename, int line)
 

Member Enumeration Documentation

◆ find_type

Enumerator
tsl_nwk_find_both 
tsl_nwk_find_links 
tsl_nwk_find_nodes 

Member Function Documentation

◆ addPath()

bool TSLTiledNetwork::addPath ( const char * dir_name)

Adds a directory path to the pathlist to search for individual tiles. By default the TSLTiledNetwork will search for tiles in the same directory as the TiledNetwork file. If Network tiles are located in other directories it will be necessary to inform the TSLTiledNetwork of where the tiles can be located.

Parameters
dir_namename of the directory to add to the search path.
Returns
True if the dir_name was successfully added , false if the dir_name already exists in the search path.

◆ begin_links() [1/2]

link_iterator TSLTiledNetwork::begin_links ( const node_iterator & it)

Returns a link_iterator into the global links list associated with the given node iterator.

Parameters
itnode_iterator to obtain the links for
Returns
link_iterator referring to the first outgoing link from the specified node.

◆ begin_links() [2/2]

link_iterator TSLTiledNetwork::begin_links ( long node_id)

Returns a link_iterator into the global links list associated with the given node id.

Parameters
node_idglobal id of the node to obtain the links for
Returns
link_iterator referring to the first outgoing link from the specified node.

◆ begin_turns() [1/2]

turn_iterator TSLTiledNetwork::begin_turns ( const node_iterator & it)

Return turn_iterator into the global turns list associated with the given node id.

Parameters
itnode_iterator to obtain the turns for
Returns
turn_iterator referring to the first turn from the specified node.

◆ begin_turns() [2/2]

turn_iterator TSLTiledNetwork::begin_turns ( long node_id)

Return turn_iterator into the global turns list associated with the given node id.

Parameters
node_idglobal id for the node to obtain the turns for
Returns
turn_iterator referring to the first turn from the specified node.

◆ cacheFlushLimit()

void TSLTiledNetwork::cacheFlushLimit ( long flush_limit)

This method allows the user to set the cache flush limit for the TSLTiled Network. When the cache is full the system will remove the LEAST recently used files to make room for the new data to load. The cache flush limit indicates the number of MOST recently used data files that the system will try keep in memory while flushing the cache. If the system cannot free enough memory and keep the flush limit number of files it will temporarily halve the flush limit until the cache memory usage is below 90% of the allowable cache size.

Parameters
flush_limitthe number of files to (attempt to ) keep when flushing
Returns
None.

◆ cacheSize()

void TSLTiledNetwork::cacheSize ( long new_size)

This method allows the user to set the total filesize that the tile cache can use. The default tile cache is 20Mb

Parameters
new_sizeThe size in kilobytes for the cache to hold.
Returns
None

◆ clearCache()

bool TSLTiledNetwork::clearCache ( )

This method requests the TSLTiledNetwork to clear all cached data from memory. After a call to clearCache any operations involving the TSLTiled Network will re-load all required data from disk. This will not clear any locked tiles from memory.

Returns
True if the cache was flushed or is already empty, false otherwise.

◆ destroy()

void TSLTiledNetwork::destroy ( )

Destructor for the object

◆ end_links() [1/2]

link_iterator TSLTiledNetwork::end_links ( const node_iterator & it)

Returns a link_iterator to the last link of the global links list associated with the given node id.

Parameters
itnode_iterator to the node to obtain the links for
Returns
link_iterator to one past the last outgoing link of the specified node

◆ end_links() [2/2]

link_iterator TSLTiledNetwork::end_links ( long node_id)

Returns a link_iterator to the last link of the global links list associated with the given node id.

Parameters
node_idglobal id of the node to obtain the links for
Returns
link_iterator to one past the last outgoing link of the specified node

◆ end_turns() [1/2]

turn_iterator TSLTiledNetwork::end_turns ( const node_iterator & it)

Return turn_iterator to the last turn of the global turns list associated with the given node iterator.

Parameters
itnode_iterator to the node to obtain the turns for
Returns
turn_iterator to one past the last turn of the specified node

◆ end_turns() [2/2]

turn_iterator TSLTiledNetwork::end_turns ( long node_id)

Return turn_iterator to the last turn of the global turns list associated with the given node id.

Parameters
node_idglobal id of the node to obtain the turns for
Returns
turn_iterator to one past the last turn of the specified node

◆ find()

TSLNetworkQuery * TSLTiledNetwork::find ( const TSLEnvelope * extent,
const TSLNwkSelector & filter,
TSLTiledNetwork::find_type filter_mode = TSLTiledNetwork::tsl_nwk_find_both )

Will generate a TSLNetworkQueryObject which will contain read-only copies of all links and nodes which satisfy the criteria specified by the filter object. Note: the simplest filter object will return everything that is sent to it.

Parameters
extentregion to query. specifying a very large region may take some time.
filterreference to a TSLNetworkSelector object whose methods will be called by the TSLTiledNetwork for any link and/or node which is within the specified extent.
filter_modeany of TSLTiledNetwork::find_both TSLTileNetwork::find_links TSLTileNetwork::find_nodes
Returns
TSLNetworkQueryObject which contains copies of all link and/or nodes which satisfy the criteria defined by the filter.

◆ find_link()

link_iterator TSLTiledNetwork::find_link ( const TSLCoord & location,
Long aperture )

Find the nearest link based on location and aperture

Note complex searches ( e.g. based on attributes) can be achieved by the find routine.

Parameters
locationcentre point of area to search
aperturedistance from the centre point to search
Returns
link_iterator that refers to the link that was found. If no link was found the link_iterator will refer to a dummy link.

◆ find_node()

node_iterator TSLTiledNetwork::find_node ( const TSLCoord & location,
Long aperture )

Find the nearest node based on a location and aperture.

Note complex searches ( e.g. based on attributes) can be achieved by the find routine.

Parameters
locationcentre point of area to search
aperturedistance from the centre point to search
Returns
node_iterator that refers to the node that was found. If no node was found the node iterator will refer to a dummy node.

◆ get_link()

link_iterator TSLTiledNetwork::get_link ( long link_id)

Returns a link iterator based on the global ID

Parameters
link_idglobal id for the link.
Returns
link_iterator that refers to the link that was found. If no link was found the link_iterator will refer to a dummy link.

◆ get_node()

node_iterator TSLTiledNetwork::get_node ( long node_id)

Returns a node_iterator based on the global ID

Parameters
node_idglobal id for the node.
Returns
node_iterator that refers to the node that was found. If no node was found the node_iterator will refer to a dummy node.

◆ get_turn()

turn_iterator TSLTiledNetwork::get_turn ( long turn_id)

Returns a turn_iterator based on the global ID

Parameters
turn_idglobal id for the turn.
Returns
turn_iterator that refers to the turn that was found. If no turn was found the turn_iterator will refer to a dummy turn.

◆ linkDestinNode()

node_iterator TSLTiledNetwork::linkDestinNode ( const link_iterator & it)

Returns the link's destination node_iterator.

Parameters
itlink_iterator to the link
Returns
node_iterator to the destination node for the link

◆ linkSourceNode()

node_iterator TSLTiledNetwork::linkSourceNode ( const link_iterator & it)

Returns the link's source node iterator

Parameters
itlink_iterator to the link
Returns
node_iterator to the source node for the link

◆ loadData()

bool TSLTiledNetwork::loadData ( const char * filename)

Load data from a file for the TSLTiledNetwork. If data is already loaded into this TSLTiledNetwork then it will be removed from memory and all references to it deleted. The specified filename must refer to a tiled network.

Parameters
filenamefully specified path to the tiled network file
Returns
True if successfully loaded, false otherwise.

◆ lockQuery() [1/2]

bool TSLTiledNetwork::lockQuery ( const TSLNetworkQuery & query,
bool * all_loaded = 0 )

Loads the tiles associated with the links and nodes contained within the TSLNetworkQuery object. Only as many tiles as can be held by the cache will be loaded. All_loaded indicates if all the tiles in the region were loaded.

Parameters
queryreference to an existing query
all_loadedboolean value to indicate if all the required tiles were loaded.
Returns
True if all or some of the tiles were loaded , false otherwise.

◆ lockQuery() [2/2]

bool TSLTiledNetwork::lockQuery ( const TSLRouteQuery & query,
bool * all_loaded = 0 )

Loads the tiles associated with the links and nodes contained within the TSLRouteQuery object. Only as many tiles as can be held by the cache will be loaded. All_loaded indicates if all the tiles in the region were loaded.

Parameters
queryreference to an existing query
all_loadedboolean value to indicate if all the required tiles were loaded.
Returns
True if all or some of the tiles were loaded , false otherwise.

◆ lockRegion() [1/2]

bool TSLTiledNetwork::lockRegion ( const TSLEnvelope & extent,
bool * all_loaded = 0 )

Loads all the tiles that overlap with the extent and locks them in memory so that they will not be cleared when the memory cache is automatically cleared. If the region includes tiles which have already been locked then their locked count will be incremented. It is important when locking a region that the all_loaded value is checked to make sure that the lock was successful.

Parameters
extentrectangular extent to lock
all_loadedboolean value to indicate if all the required tiles were loaded.
Returns
True if all or some of the tiles were loaded , false otherwise.

◆ lockRegion() [2/2]

bool TSLTiledNetwork::lockRegion ( const TSLPolyline & polyline,
bool * all_loaded = 0 )

Loads all the tiles that overlap with the polyline and locks them in memory so that they will not be cleared when the memory cache is automatically cleared. If the region includes tiles which have already been locked then their locked count will be incremented. It is important when locking a region that the all_loaded value is checked to make sure that the lock was successful.

Parameters
polylineTSLPolyline object that identifies a path
all_loadedboolean value to indicate if all the required tiles were loaded.
Returns
True if all or some of the tiles were loaded , false otherwise.

◆ operator new() [1/2]

void * TSLTiledNetwork::operator new ( size_t size)

These are here to avoid being documented Allocation override for API redirection.

◆ operator new() [2/2]

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

◆ removeData()

bool TSLTiledNetwork::removeData ( )

Clears all data attached to this TSLTiledNetworkLayer.

Returns
True if data was successfully removed or the tiled network was already empty, false otherwise.

◆ route()

TSLRouteQuery * TSLTiledNetwork::route ( long from_node,
long to_node,
long * via_nodes,
long via_count,
TSLPathCost & cost,
double max_cost )

Will generate a NetworkRouteQuery object which contains copies of all the links and nodes involved in the best route returned. The links and nodes objects returned in the NetworkRouteQuery object will be read-only copies of the originals. This will allow the route to be analysed without the need for the original tiles

Parameters
from_nodeglobal id of the start node for the route.
to_nodeglobal id of the destination node for the route.
via_nodeslist of global ids for nodes to visit along the route.
via_countnumber of via nodes contained in via_nodes.
costcost object for the path ( as in standard network )
max_costAn upper bound for the cost of a path. Links from nodes whose cost exceeds max_cost will not be traversed.

◆ turnDestinLink()

link_iterator TSLTiledNetwork::turnDestinLink ( const turn_iterator & it)

Returns the turns destination link iterator.

Parameters
itturn_iterator to the turn
Returns
link_iterator to the destination node for the turn

◆ turnSourceLink()

link_iterator TSLTiledNetwork::turnSourceLink ( const turn_iterator & it)

Returns the turns source link iterator.

Parameters
itturn_iterator to the turn
Returns
link_iterator to the source link for the turn

◆ unlockAll()

bool TSLTiledNetwork::unlockAll ( )

Unlocks the all currently locked tiles and sets their lock count to zero. UnlockAll does not mean the tiles will immediately be freed from memory. This will be done when the memory cache is automatically cleared if the unlocked tiles are the "least recently used".

Returns
True if all tiles were unlocked , false if there were no tile to unlock.

◆ unlockQuery() [1/2]

bool TSLTiledNetwork::unlockQuery ( const TSLNetworkQuery & query)

Unlocks the tiles that relate to the specified query if they are currently loaded into memory. If a tile has been locked more than once then this will decrement its lock count. Unlocking a region so does not mean the tiles will immediately be freed from memory. This will be done when the memory cache is automatically cleared if the unlocked tiles are the "least recently used".

Parameters
queryTSLNetworkQuery object
Returns
True if any tiles in the region were unlocked , false otherwise.

◆ unlockQuery() [2/2]

bool TSLTiledNetwork::unlockQuery ( const TSLRouteQuery & query)

Unlocks the tiles that relate to the specified query if they are currently loaded into memory. If a tile has been locked more than once then this will decrement its lock count. Unlocking a region so does not mean the tiles will immediately be freed from memory. This will be done when the memory cache is automatically cleared if the unlocked tiles are the "least recently used".

Parameters
queryTSLRouteQuery object
Returns
True if any tiles in the region were unlocked , false otherwise.

◆ unlockRegion() [1/2]

bool TSLTiledNetwork::unlockRegion ( const TSLEnvelope & extent)

Unlocks the tiles that overlap with the specified extent if they are currently loaded into memory. If a tile has been locked more than once then this will decrement its lock count. Unlocking a region so does not mean the tiles will immediately be freed from memory. This will be done when the memory cache is automatically cleared if the unlocked tiles are the "least recently used".

Parameters
extentrectangular extent to unlock
Returns
True if any tiles in the region were unlocked , false otherwise.

◆ unlockRegion() [2/2]

bool TSLTiledNetwork::unlockRegion ( const TSLPolyline & polyline)

Unlocks the tiles that overlap with the specified polyline if they are currently loaded into memory. If a tile has been locked more than once then this will decrement its lock count. Unlocking a region so does not mean the tiles will immediately be freed from memory. This will be done when the memory cache is automatically cleared if the unlocked tiles are the "least recently used".

Parameters
polylineTSLPolyline object specifying a path
Returns
True if any tiles in the region were unlocked , false otherwise.