uk.me.parabola.mkgmap.filters
Class LineSplitterFilter

java.lang.Object
  extended by uk.me.parabola.mkgmap.filters.LineSplitterFilter
All Implemented Interfaces:
MapFilter

public class LineSplitterFilter
extends java.lang.Object
implements MapFilter

A filter that ensures that a line does not exceed the allowed number of points that a line can have.

Author:
Steve Ratcliffe

Field Summary
static int MAX_POINTS_IN_LINE
           
 
Constructor Summary
LineSplitterFilter()
           
 
Method Summary
 void doFilter(MapElement element, MapFilterChain next)
          If the line is short enough then we just pass it on straight away.
 void init(FilterConfig config)
          Initialise the filter and pass in parameters that may be needed for the run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_POINTS_IN_LINE

public static final int MAX_POINTS_IN_LINE
See Also:
Constant Field Values
Constructor Detail

LineSplitterFilter

public LineSplitterFilter()
Method Detail

init

public void init(FilterConfig config)
Description copied from interface: MapFilter
Initialise the filter and pass in parameters that may be needed for the run.

Specified by:
init in interface MapFilter
Parameters:
config - Configuration information, giving parameters of the map level that is being produced through this filter.

doFilter

public void doFilter(MapElement element,
                     MapFilterChain next)
If the line is short enough then we just pass it on straight away. Otherwise we cut it into pieces that are short enough and hand them on.

Specified by:
doFilter in interface MapFilter
Parameters:
element - A map element.
next - This is used to pass the possibly transformed element onward.