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

Detailed Description

Joins together polygons that touch or overlap.

The usual polygon intersection geometry calculations must be used if holes are to be retained, perhaps with a tiling strategy if many thousands of polygons are to be considered.

Public Types

typedef bool(* SetFunctionPtr) (TSLPolygon const &entity, int *setID)
 
typedef bool(* ProgressFunctionPtr) (double percentComplete)
 

Public Member Functions

 TSLPolygonAggregationHelper ()
 
 ~TSLPolygonAggregationHelper ()
 
bool addOnlyPolygons (const TSLEntitySet *inputEntities, TSLPolyAggSelector *selector, TSLPolyAggProgress *progress)
 
bool aggregate (TSLPolyAggProgress *progress)
 
int numOutputEntitySets () const
 
const TSLEntitySetgetOutputEntitySet (int index) const
 
const TSLPolygongetExampleInputPolygon (int index) const
 

Member Typedef Documentation

◆ ProgressFunctionPtr

typedef bool(* TSLPolygonAggregationHelper::ProgressFunctionPtr) (double percentComplete)

◆ SetFunctionPtr

typedef bool(* TSLPolygonAggregationHelper::SetFunctionPtr) (TSLPolygon const &entity, int *setID)

Constructor & Destructor Documentation

◆ TSLPolygonAggregationHelper()

TSLPolygonAggregationHelper::TSLPolygonAggregationHelper ( )

Constructor.

◆ ~TSLPolygonAggregationHelper()

TSLPolygonAggregationHelper::~TSLPolygonAggregationHelper ( )

Destructor. Deletes all owned results sets.

Member Function Documentation

◆ addOnlyPolygons()

bool TSLPolygonAggregationHelper::addOnlyPolygons ( const TSLEntitySet * inputEntities,
TSLPolyAggSelector * selector,
TSLPolyAggProgress * progress )

Extract all polygons from the given entity set (other types of entity are ignored) and record their edges.

If no selector object is passed, then all polygons are added to a single set.

If a selector object is passed, then polygons are added to the same set if the selector object select() method returns the same value in its setID parameter (and the method returns true). If the select() method returns false then the polygon is not added to any set, and is not processed.

If a progress object is passed, the progress() method will be called regularly to provide progress indication to the caller. The method should return true to cancel the operation, false to continue.

Polygons in the same set will later be joined by aggregate() if they touch or overlap.

Parameters
inputEntitiesset of entities to extract polygons from
selectorselector object whose select() method is called for each polygon to determine which logical set of polygons each polygon should be placed in. Each set will then be aggregated. Pass 0 to add all polygons to a single set.
progressprogress object whose progress() method will be called to notify progress information. Pass 0 to receive no progress information.
Returns
true on success, false on failure.

◆ aggregate()

bool TSLPolygonAggregationHelper::aggregate ( TSLPolyAggProgress * progress)

Aggregate each logical set of polygons.

Each set will consist of one polygon if the original polygons in that set touch or overlapped, more than one polygon if they did not touch. Call get OutputEntitySet to get results.

If progress is not zero, the object's progress() method will be called regularly to provide progress indication to the caller.

Parameters
progressprogress object whose progress() method will receive progress information. May be 0 for no progress notification.
Returns
true on success, false on failure.

◆ getExampleInputPolygon()

const TSLPolygon * TSLPolygonAggregationHelper::getExampleInputPolygon ( int index) const

Access a copy of one of the input polygons that contributed to a given results set. The user can use this to extract example attributes.

Parameters
indexzero-based index into the set of example entities
Returns
a reference to the indexed entity if the index is within range, zero otherwise.

◆ getOutputEntitySet()

const TSLEntitySet * TSLPolygonAggregationHelper::getOutputEntitySet ( int index) const

Access one set of aggregated results, using zero-based index.

The aggregation helper owns the entity sets and will delete them when it is destroyed.

Parameters
indexzero-based index into the set of result entities
Returns
a reference to the indexed entity if the index is within range, zero otherwise.

◆ numOutputEntitySets()

int TSLPolygonAggregationHelper::numOutputEntitySets ( ) const

Returns the number of aggregated results sets available. Use this to index into getOutputEntitySet.