![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
An island is a contiguous set of features.
Islands are created by calling the static method createIslands() and passing it a data layer. This method looks for contiguous features; for each such set it will create an island and add it to the set of islands.
NOTE : When creating islands, an assumption is made that the features are touching, rather than overlapping. This is the case for data such as OS MasterMap - as TSLTMC as features such as cliffs, slopes and landform polygons are ignored. This latter is important when capturing island boundaries with holes.
Islands can be merged by calling the static method mergeIslands(), passing it two island sets. This method first works out groups of overlapping islands. For each group, it performs a merging process (which respects version information). The merged result passes through a final island extraction process in case departed features have resulted in the merged island splitting. Once this has been done for all groups, the result is a set of non-overlapping islands.
Users can construct islands in one of two ways: (1) by passing a (tmf) file and extent or (2) by passing a data layer. In the first case, it is assumed that the (tmf) file represents an existing island i.e. it has been produced as a result of an earlier call to createIslands(). The extent is expected to be the extent of the island. In the second case, the data layer is assumed to represent an existing island. The island will assume ownership of the data layer.
Public Member Functions | |
TSLIsland (const char *dataFile, const TSLEnvelope &extent, const char *id=0) | |
TSLIsland (TSLStandardDataLayer *data, const char *id=0) | |
TSLIsland (const TSLIsland &other) | |
TSLIsland & | operator= (const TSLIsland &rhs) |
const TSLPolygon * | boundary (bool includingInners=false) const |
bool | contains (const TSLCoord &position) const |
void | destroy () |
const TSLEnvelope & | extent () const |
const TSLStandardDataLayer * | features () const |
const char * | id () const |
void | id (const char *islandID) |
void * | operator new (size_t) |
void | operator delete (void *) |
void * | operator new (size_t, char *, int) |
Static Public Member Functions | |
static void | configure (TSLTMC pointCoincidence=0, TSLTMC tmcPerVertexStrip=6500) |
static bool | createIslands (const TSLStandardDataLayer *data, TSLIslandSet &islands) |
static bool | createIslands (TSLStandardDataLayer *data, TSLMapDataLayer *mapLayer, TSLSLMEntityRefHandler &mapRefHandler, TSLIslandSet &islands) |
static bool | mergeIslands (const TSLIslandSet &islands, TSLIslandMergeSet &mergedIslands) |
static bool | mergeIslands (const TSLIslandSet &islands, TSLStandardDataLayer *layer, const char *mapName, TSLSLMEntityRefHandler &mapRefHandler, TSLIslandMergeSet &mergedIslands, bool replaceDepartedFeatures=true) |
static bool | mergeIslands (const TSLIslandSet &islands, const char *mapName, TSLSLMEntityRefHandler &mapRefHandler, TSLIslandMergeSet &mergedIslands, bool replaceDepartedFeatures=true) |
static bool | sortDepartedFeatures (TSLMapDataLayer *mapLayer, TSLSLMEntityRefHandler &mapRefHandler, TSLIslandSet &islands) |
static bool | createIslands (TSLStandardDataLayer *data, const char *mapName, TSLSLMEntityRefHandler &mapRefHandler, TSLIslandSet &islands) |
TSLIsland::TSLIsland | ( | const char * | dataFile, |
const TSLEnvelope & | extent, | ||
const char * | id = 0 ) |
Constructs an island based on its (tmf) file and extent. The (tmf) file is assumed to contain the island features only. It is not automatically loaded into the data layer. This will only happen if the data layer is required.
dataFile | The (tmf) file containing the island features. |
extent | The extent of the features. |
id | The id of the island. If this is NULL, then a default id will be generated. |
TSLIsland::TSLIsland | ( | TSLStandardDataLayer * | data, |
const char * | id = 0 ) |
Constructs an island given a data layer. The data layer is assumed to contain the island features only.
data | The data layer containing the island features. |
id | The id of the island. If this is NULL, then a default id will be generated. |
The island takes ownership of the data layer.
TSLIsland::TSLIsland | ( | const TSLIsland & | other | ) |
Copy constructor.
const TSLPolygon * TSLIsland::boundary | ( | bool | includingInners = false | ) | const |
Returns the polygon that represents the boundary of the island. If the polygon has not yet been constructed, then, if necessary, the data is loaded into the data layer and the boundary is constructed based on the layer contents.
When the boundary includes inners, it is important that the island polygons do not overlap. Typical problem cases are OSMM cliffs, slopes and landform polygons. This is not an issue if inners are not required.
includingInners | True if the created boundary should check for inner boundaries as well. Default false. |
|
static |
Internally, the island creation uses some highly optimised spatial algorithms. This method allows an application to tune some parameters of these algorithms.
The default values that are used if this method is not called are suitable for OS MasterMap with 1000 TMC per metre scaling.
pointCoincidence | This is the distance in TMC whereby points are considered the same. Default 0. |
tmcPerVertexStrip | Vertices are organised in horizontal strips for fast searching. This is the number of TMC for each vertex strip. The maximum number of vertex strips is 10000. Default value is 6500. |
bool TSLIsland::contains | ( | const TSLCoord & | position | ) | const |
Returns True if the boundary contains the given position.
position | The position to query against. |
|
static |
Static method that creates a set of islands from the supplied data layer.
data | The data layer from which we wish to extract islands. |
islands | An island set which will be populated with the islands that are created from the layer. |
|
static |
Deprecated Functions
|
static |
Static method that creates a set of islands from the supplied data layer for the given (seamless layer) map. The difference between this method and the other createIslands() method is that this method will attempt to preserve 'departed' features and also reconstruct their geometries (from the existing map).
data | The data layer from which we wish to extract islands. |
mapLayer | The MapDataLayer which is associated with the islands. |
mapRefHandler | The entity-reference handler for the map. |
islands | An island set which will be populated with the islands that are created from the layer. |
Returns false under the following conditions:
Otherwise returns true.
void TSLIsland::destroy | ( | ) |
Deletes the object.
const TSLEnvelope & TSLIsland::extent | ( | ) | const |
Returns the extent of the island. If the extent has not yet been calculated, then, if necessary, the data is loaded into the data layer and the layer queried for the extent.
const TSLStandardDataLayer * TSLIsland::features | ( | ) | const |
Returns the island features as a data layer. If the data layer has not yet been constructed, then it is constructed now and the data loaded.
const char * TSLIsland::id | ( | ) | const |
Returns the unique ID of the layer.
void TSLIsland::id | ( | const char * | islandID | ) |
Sets the unique ID of the island.
islandID | A string representing the unique ID of the island. |
|
static |
Static method that merges a set of islands. The difference between this method and the other mergeIslands() method is that this method will automatically update existing features with respect to version changes and it will also attempt to preserve 'departed' features.
islands | The input island set. |
mapName | The full path of the map which is associated with the islands. |
mapRefHandler | The entity-reference handler for the map. |
mergedIslands | The resulting set of merged islands. |
replaceDepartedFeatures | If true, departed features will have their geometry replaced with that of the original feature from the map. Default is true. |
|
static |
Static method that merges a set of islands. This is a purely geometrical merge.
islands | The input island set. |
mergedIslands | The resulting set of merged islands. |
|
static |
Static method that merges a data layer with a set of islands. The difference between this method and the other mergeIslands() method is that this method will automatically update existing features with respect to version changes and it will also attempt to preserve 'departed' features.
islands | The input island set. |
layer | The data layer. |
mapName | The full path of the map which is associated with the islands. |
mapRefHandler | The entity-reference handler for the map. |
mergedIslands | The resulting set of merged islands. |
replaceDepartedFeatures | If true, departed features will have their geometry replaced with that of the original feature from the map. Default is true. |
void TSLIsland::operator delete | ( | void * | ) |
void * TSLIsland::operator new | ( | size_t | ) |
Allocation override for API redirection.
void * TSLIsland::operator new | ( | size_t | , |
char * | , | ||
int | ) |
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.
|
static |
Static method that rearranges departed features present in the source islands as points into the correct island based on the location of the original feature in the map.
This method is intended for use after a call to createIslands(TSLStandardd DataLayer, TSLIslandSet) as this method does not correctly place these departed features in the resulting island set. This method can also be used to correctly place departed features in islands created by the other createIslands() method that are inside the island rather than having contiguous edges and so would otherwise be placed into a separate island.
No features will be deleted by this operation.
mapLayer | The map layer that is associated with the islands. |
mapRefHandler | The entity reference handler for the map. |
islands | An island set containing the features to be reorganised. |