uk.me.parabola.mkgmap.filters
Class LineSizeSplitterFilter

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

public class LineSizeSplitterFilter
extends java.lang.Object
implements MapFilter

A filter to make sure that a line does not have a greater dimension that would cause an overflow of a TRE area which can only have 15 bits of size. We want to keep things well under this.

Author:
Steve Ratcliffe

Constructor Summary
LineSizeSplitterFilter()
           
 
Method Summary
 void doFilter(MapElement element, MapFilterChain next)
          Keep track of the max dimensions of a line and split when they get too big.
 void init(FilterConfig config)
          Initialise the filter and pass in parameters that may be needed for the run.
static double testDims(int height, int width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineSizeSplitterFilter

public LineSizeSplitterFilter()
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.

testDims

public static double testDims(int height,
                              int width)

doFilter

public void doFilter(MapElement element,
                     MapFilterChain next)
Keep track of the max dimensions of a line and split when they get too big.

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