![]() |
MapLink Pro 11.2
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class represents a read-only network of nodes and links, where the nodes are TSLOptNode objects and the links are TSLOptLink objects. The network is optimized in both its usage of memory and vastly improved loading performance. When an optimized network is loaded into from disk, only its nodes and links are actually loaded into memory; all attribute and geometry information stays on disk. If a user requires this information, he must request it through the network.
Classes | |
class | const_link_iterator |
class | const_node_iterator |
class | const_turn_iterator |
class | Query |
Public Types | |
enum | query_type { tsl_nwk_find_nodes = 0 , tsl_nwk_find_links = 1 , tsl_nwk_find_both = 2 } |
TSLVariant TSLOptimizedNetwork::attribute | ( | const TSLOptLink * | link, |
int | N ) const |
Queries the supplied link for the attribute at the specified index.
link | A pointer to the TSLOptLink object. |
N | The index position. |
TSLVariant TSLOptimizedNetwork::attribute | ( | const TSLOptNode * | node, |
int | N ) const |
Queries the supplied node for the attribute at the specified index.
node | A pointer to the TSLOptNode object. |
N | The index position. |
const_link_iterator TSLOptimizedNetwork::beginLinks | ( | ) | const |
Access method (const) for links in the network.
Returns a const_link_iterator to the first link.
const_link_iterator TSLOptimizedNetwork::beginLinks | ( | const const_node_iterator & | it | ) | const |
Access method (const) for the links outgoing from a given node in the network.
it | Reference to the node iterator. |
const_link_iterator TSLOptimizedNetwork::beginLinks | ( | int | src | ) | const |
Access method (const) for the links outgoing from a given node in the network.
src | The index of the node. |
const_node_iterator TSLOptimizedNetwork::beginNodes | ( | ) | const |
Access method (const) for nodes in the network.
Returns a const_node_iterator to the first node.
const_turn_iterator TSLOptimizedNetwork::beginTurns | ( | ) | const |
Access method (const) for turns in the network.
Returns a const_turn_iterator to the first turn.
const_turn_iterator TSLOptimizedNetwork::beginTurns | ( | const const_node_iterator & | it | ) | const |
Access method (const) for the turns outgoing from a given node in the network.
it | A reference to the const node iterator. |
const_turn_iterator TSLOptimizedNetwork::beginTurns | ( | int | src | ) | const |
Access method (const) for the turns outgoing from a given node in the network.
src | The index of the node. |
double TSLOptimizedNetwork::coordinateScaleFactor | ( | ) | const |
Returns the scale factor for geometries and positions.
The optimized network stores all node positions and link geometries as scaled values. Therefore, to obtain true positions and geometries, users must divide positions and geometries returned by the optimized network by this scaling factor.
e.g. double node_latitude = node.position().y() / m_optimizedNwk->coordinateScaleFactor();
void TSLOptimizedNetwork::destroy | ( | ) |
Deletes the TSLOptimizedNetwork object.
const_link_iterator TSLOptimizedNetwork::endLinks | ( | ) | const |
Access method (const) for links in the network.
Returns a const_link_iterator to one past the last link.
const_link_iterator TSLOptimizedNetwork::endLinks | ( | const const_node_iterator & | it | ) | const |
Access method (const) for the links outgoing from a given node in the network.
it | A reference to the const node iterator. |
const_link_iterator TSLOptimizedNetwork::endLinks | ( | int | src | ) | const |
Access method (const) for the links outgoing from a given node in the network.
src | The index of the node. |
const_node_iterator TSLOptimizedNetwork::endNodes | ( | ) | const |
Access method (const) for nodes in the network.
Returns a const_node_iterator to one past the last node.
const_turn_iterator TSLOptimizedNetwork::endTurns | ( | ) | const |
Access method (const) for turns in the network.
Returns a const_turn_iterator to one past the last turn.
const_turn_iterator TSLOptimizedNetwork::endTurns | ( | const const_node_iterator & | it | ) | const |
Access method (const) for the turns outgoing from a given node in the network.
it | A reference to the const node iterator. |
const_turn_iterator TSLOptimizedNetwork::endTurns | ( | int | src | ) | const |
Access method (const) for the turns outgoing from a given node in the network.
src | The index of the node. |
Query * TSLOptimizedNetwork::find | ( | const TSLEnvelope & | extent, |
const TSLOptNwkFinder & | filter, | ||
query_type | filter_mode = tsl_nwk_find_both ) const |
Returns a query object which contains the elements satisfying the filter criteria and search mode supplied by the client. Checks the status of the Spatial Index. If the Spatial Index is valid, then if links are being searched for the Spatial Index is used.
extent | The region to query. |
filter | A reference to a finder object. |
filter_mode | Any of TSLOptimizedNetwork::tsl_nwk_find_nodes / tsl_nwk_find_links / tsl_nwk_find_both. |
const_link_iterator TSLOptimizedNetwork::findLink | ( | const TSLCoord & | location, |
int | aperture ) const |
Finds the nearest link based on location and (square) aperture. Checks the status of the Spatial Index. If the Spatial Index is valid, then if links are being searched for the Spatial Index is used.
location | The centre point of area to search. |
aperture | The distance from the centre point to search. |
Query * TSLOptimizedNetwork::findLinks | ( | const TSLCoord & | location, |
int | aperture, | ||
const TSLOptNwkFinder * | filter = NULL, | ||
int | limit = -1, | ||
bool | useSpatialIndex = true ) |
Function that returns a set (Query) of Links within the boundary of the search area, dependent on additional optional filter logic. If the Spatial Index is valid, then it is used for the search and the links within the query object are ordered by distance and the distance is also stored in the query. All links should be within the aperture distance set. Initially, the set should contain all the Links that are within the boundary of the aperture from the location. This can be reduced by the optional filter and limit. If the Limit is supplied then the query object is restricted to return only this number of links or less. The limit is only used if the Spatial Index is valid.
location | The centre point of area to search. |
aperture | The distance from the centre point to search. |
filter | Optional Filter object. |
limit | Optional limit on the number of links to return. |
useSpatialIndex | If true the spatial index for the loaded network will be used if it is valid. If no spatial index is available then the standard search method will be used. Defaults to true. |
const_node_iterator TSLOptimizedNetwork::findNode | ( | const TSLCoord & | location, |
int | aperture ) const |
Finds the nearest node based on location and (square) aperture.
location | The centre point of area to search. |
aperture | The distance from the centre point to search. |
TSLCoord TSLOptimizedNetwork::firstPoint | ( | const TSLOptLink * | link | ) | const |
Queries the supplied link for its first point.
link | A pointer to the TSLOptLink object. |
const TSLVariant * TSLOptimizedNetwork::getAttributes | ( | const TSLOptLink * | link | ) | const |
Queries the supplied link for its attributes.
link | A pointer to the TSLOptLink object. |
const TSLVariant * TSLOptimizedNetwork::getAttributes | ( | const TSLOptNode * | node | ) | const |
Queries the supplied node for its attributes.
node | A pointer to the TSLOptNode object. |
const TSLOptLink & TSLOptimizedNetwork::getLink | ( | int | index | ) | const |
Access method (const) for links.
index | The index position. |
const TSLOptNode & TSLOptimizedNetwork::getNode | ( | int | index | ) | const |
Access method (const) for nodes.
index | The index position. |
TSLCoordSet * TSLOptimizedNetwork::getPoints | ( | const TSLOptLink * | link | ) | const |
Queries the supplied link for its points.
link | A pointer to the TSLOptLink object. |
void TSLOptimizedNetwork::invalidateSpatialIndex | ( | ) |
Function that invalidates the Spatial Index. An example of when to use this function would be when a Link has had its geometry changed.
bool TSLOptimizedNetwork::isEdgeNode | ( | int | index | ) | const |
Returns true if the node is an edge node, false otherwise.
index | The index of the node. |
bool TSLOptimizedNetwork::isLatLong | ( | ) | const |
Query method for the type of units of node position / link geometry.
Returns true if co-ordinates/geometry are in lat/long; false if in TMC.
bool TSLOptimizedNetwork::isStitchNode | ( | int | index | ) | const |
Returns true if the node is a stitch node, false otherwise.
index | The index of the node. |
TSLCoord TSLOptimizedNetwork::lastPoint | ( | const TSLOptLink * | link | ) | const |
Queries the supplied link for its last point.
link | A pointer to the TSLOptLink object. |
@returnReturns the link's last point (as a TSLCoord). If isLatLong() true, the point is a scaled longitude and latitude pair, where scaled longitude = point().x() and scaled latitude = point().y(). In order to get true latitude / longitude, divide the relevant values by coordinateScaleFactor().
const TSLOptNode & TSLOptimizedNetwork::linkDestinNode | ( | const const_link_iterator & | it | ) | const |
Query method for links.
it | A reference to the const_link_iterator pointing to the link. |
int TSLOptimizedNetwork::linkDestinNodePos | ( | const const_link_iterator & | it | ) | const |
Query method for links.
it | A reference to the const_link_iterator pointing to the link. |
bool TSLOptimizedNetwork::linkNodes | ( | const const_link_iterator & | it, |
TSLOptNode & | src, | ||
TSLOptNode & | dst ) const |
Query method for links. Returns the link's source & destination Node objects, via the supplied arguments.
it | A reference to the const_link_iterator pointing to the link. |
src | A reference to the link's source Node object. |
dst | A reference to the link's destination Node object. |
bool TSLOptimizedNetwork::linkNodes | ( | const TSLOptLink & | link, |
TSLOptNode & | src, | ||
TSLOptNode & | dst ) const |
Query method for links. Returns the link's source & destination Node objects, via the supplied arguments.
link | A reference to the const Link object. |
src | A reference to the link's source Node object. |
dst | A reference to the link's destination Node object. |
const TSLOptNode & TSLOptimizedNetwork::linkSourceNode | ( | const const_link_iterator & | it | ) | const |
Query method for links.
it | A reference to the const_link_iterator pointing to the link. |
int TSLOptimizedNetwork::linkSourceNodePos | ( | const const_link_iterator & | it | ) | const |
Query method for links.
it | A reference to the const_link_iterator pointing to the link. |
bool TSLOptimizedNetwork::load | ( | const char * | fileName | ) |
Loads and initialises the optimized network. Only the topology information is loaded into memory - the node / link attributes and the link geometry needed to be loaded separately.
fileName | The name of the network file. |
bool TSLOptimizedNetwork::loadAttributes | ( | ) |
Loads the node & link attributes.
Returns true of the attributes are loaded successfully.
bool TSLOptimizedNetwork::loadGeometry | ( | ) |
Loads the link geometry.
Returns true of the geometry is loaded successfully.
bool TSLOptimizedNetwork::loadSpatialIndex | ( | TSLifstream & | inputStream | ) |
Function that reads and creates the Spatial Index from a file stream. If the Spatial Index already exists, it is deleted. Returns true on success or false on error.
inputStream | Reference to stream. |
int TSLOptimizedNetwork::numAttributes | ( | const TSLOptLink * | link | ) | const |
Returns the number of attributes assigned to the supplied link.
link | A pointer to the TSLOptLink object. |
int TSLOptimizedNetwork::numAttributes | ( | const TSLOptNode * | node | ) | const |
Returns the number of attributes assigned to the supplied node.
node | A pointer to the TSLOptNode object. |
int TSLOptimizedNetwork::numPoints | ( | const TSLOptLink * | link | ) | const |
Returns the number of points describing the geometry of the supplied link.
link | A pointer to the TSLOptLink object. |
void * TSLOptimizedNetwork::operator new | ( | size_t | size | ) |
These are here to avoid being documented Allocation override for API redirection.
void * TSLOptimizedNetwork::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.
TSLCoord TSLOptimizedNetwork::point | ( | const TSLOptLink * | link, |
int | N ) const |
Queries the supplied link for the point at the specified index.
link | A pointer to the TSLOptLink object. |
N | The index position. |
bool TSLOptimizedNetwork::saveSpatialIndex | ( | TSLofstream & | outputStream | ) |
Function that saves the Spatial Index to a file stream. Will only save the Spatial Index if it has previously been built. Returns true on success, or false if an error occurred, for example, the Spatial Index was not valid.
outputStream | Reference to stream. |
int TSLOptimizedNetwork::sizeLinks | ( | ) | const |
Query method for links in the network.
Returns the number of links in the network.
int TSLOptimizedNetwork::sizeNodes | ( | ) | const |
Query method for nodes in the network.
Returns the number of nodes in the network.
int TSLOptimizedNetwork::sizeTurns | ( | ) | const |
Query method for turns in the network.
Returns the number of turns in the network.
bool TSLOptimizedNetwork::spatialIndexUpToDate | ( | ) | const |
Returns the status of the Spatial Index.
Returns true if the spatial index is valid and can be used, false otherwise.
const_link_iterator TSLOptimizedNetwork::turnDestinLink | ( | const const_turn_iterator & | it | ) | const |
Query method for turns.
it | A reference to the const_turn_iterator pointing to the turn. |
const_link_iterator TSLOptimizedNetwork::turnSourceLink | ( | const const_turn_iterator & | it | ) | const |
Query method for turns.
it | A reference to the const_turn_iterator pointing to the turn. |
bool TSLOptimizedNetwork::updateSpatialIndex | ( | ) |
Function that updates the Networks Spatial Index. If the Spatial Index exists, it is deleted and rebuilt. If the Spatial Index doesn't exist it is constructed.
Returns true if the Spatial Index was created successfully. Returns false if an error was encountered. The TSLErrorStack should be interrogated for further information.