![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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 TSLEntitySet * | getOutputEntitySet (int index) const |
const TSLPolygon * | getExampleInputPolygon (int index) const |
typedef bool(* TSLPolygonAggregationHelper::ProgressFunctionPtr) (double percentComplete) |
typedef bool(* TSLPolygonAggregationHelper::SetFunctionPtr) (TSLPolygon const &entity, int *setID) |
TSLPolygonAggregationHelper::TSLPolygonAggregationHelper | ( | ) |
Constructor.
TSLPolygonAggregationHelper::~TSLPolygonAggregationHelper | ( | ) |
Destructor. Deletes all owned results sets.
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.
inputEntities | set of entities to extract polygons from |
selector | selector 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. |
progress | progress object whose progress() method will be called to notify progress information. Pass 0 to receive no progress information. |
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.
progress | progress object whose progress() method will receive progress information. May be 0 for no progress notification. |
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.
index | zero-based index into the set of example entities |
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.
index | zero-based index into the set of result entities |
int TSLPolygonAggregationHelper::numOutputEntitySets | ( | ) | const |
Returns the number of aggregated results sets available. Use this to index into getOutputEntitySet.