Nice.

And now I know why it's working, or better: I know the conditions when it's working:

- The map provider must provide the outer and inner (and maybe more inner) polygons separately.

- Each polygon must be closed.

- The point order must flipped in each level of polygons, i.e. if the outer-most polygon is clockwise, the next inner polygon must be counter-clockwise, etc.

The attachment contains a small project demonstrating the principle.

The polygon order is not changed by the polygon simplification, and the fact that the polygon is closed is not changed either. Therefore, the hole remains after simplification.

There is one issue left which prevents me from including this in TAChart. As I already said, it is not only the line series or polygon series which could benefit, an area series, a spline series and maybe some others might need it too and thus would have to duplicate the algorithm. This is not good. It would be better if the algorithm were implemented in the ChartSource which provides the data for the series. One idea how to do this:

- Create a new TFilteredChartSource (or a new option in TCalculatedChartsource, but this looks more complicated to me)
- This source gets a property Origin: TCustomChartSource to which the user must "hook" the original source containing the data
- This source gets in integer list in which all the data point indices from the original source will be stored which are included after the filtering process.
- The FilterChartSource must implement the filtering algorithm. It gets the data from the Origin source as pointers to TChartDataItem records (type TChartDataItem = record X, Y: Double; ...; end) and stores the accepted index in the mentioned list.
- As any other chartsoure, TFilteredChartSource must override the function
`GetItem(AIndex: Integer): PChartDataItem`. AIndex is the data point index that the series wants to plot. The filtered source must lookup the original point index in its integer list and then finds the PChartDataItem under this index in the original source.

One problem, maybe, of this approach: Since filtering is done on the original data the effect might be not be suitable for visual presentation. Suppose a time series in which the y data are plotted logarithmically...

Maybe it's better to provide a filter directly in the series as "plug-in component" filter which operates on the points obtained after world-to-screen transformation. But something like this has not been provided in the TAChart infrastructure...