uk.me.parabola.mkgmap.filters
Interface MapFilter

All Known Implementing Classes:
BaseFilter, DouglasPeuckerFilter, LineSizeSplitterFilter, LineSplitterFilter, PolygonSizeSplitterFilter, PolygonSplitterBase, PolygonSplitterFilter, PreserveHorizontalAndVerticalLinesFilter, RemoveEmpty, RoundCoordsFilter, SizeFilter, SmoothingFilter

public interface MapFilter

Used for filtering the elements that are added to the levels. We make several transformations, such as smoothing lines and splitting them so they do not overflow limitations for example.

Author:
Steve Ratcliffe

Method Summary
 void doFilter(MapElement element, MapFilterChain next)
          Filter an element.
 void init(FilterConfig config)
          Initialise the filter and pass in parameters that may be needed for the run.
 

Method Detail

init

void init(FilterConfig config)
Initialise the filter and pass in parameters that may be needed for the run.

Parameters:
config - Configuration information, giving parameters of the map level that is being produced through this filter.

doFilter

void doFilter(MapElement element,
              MapFilterChain next)
Filter an element. The filter looks at the element and can simply pass it on to the next filter in the chain by calling the MapFilterChain.doFilter(MapElement) method.

The filter may modify the element or create a new element or even more than one element and pass them all to the next part of the chain.

It is allowed to call the next doFilter more than once (this is used to split elements for example). You are also allowed to not call it at all, in which case the element will not appear in the map at that level.

Parameters:
element - A map element.
next - This is used to pass the possibly transformed element onward.