uk.me.parabola.mkgmap.filters
Class PolygonSplitterFilter

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

public class PolygonSplitterFilter
extends PolygonSplitterBase
implements MapFilter

Split polygons so that they have less than the maximum number of points. This is handled by using java built in classes. Basically I am just taking the bounding box, splitting that in half and getting the intersection of each half-box with the original shape. Recurse until all are small enough.

Cutting things up may make discontiguous shapes, but this is handled by the java classes (for sure) and my code (probably).

Written assuming that this is not very common, once we start doing sea areas, may want to re-examine to see if we can optimize.

Author:
Steve Ratcliffe

Field Summary
static int MAX_POINT_IN_ELEMENT
           
 
Fields inherited from class uk.me.parabola.mkgmap.filters.PolygonSplitterBase
MAX_SIZE
 
Constructor Summary
PolygonSplitterFilter()
           
 
Method Summary
 void doFilter(MapElement element, MapFilterChain next)
          Split up polygons that have more than the max allowed number of points.
 
Methods inherited from class uk.me.parabola.mkgmap.filters.PolygonSplitterBase
split
 
Methods inherited from class uk.me.parabola.mkgmap.filters.BaseFilter
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.me.parabola.mkgmap.filters.MapFilter
init
 

Field Detail

MAX_POINT_IN_ELEMENT

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

PolygonSplitterFilter

public PolygonSplitterFilter()
Method Detail

doFilter

public void doFilter(MapElement element,
                     MapFilterChain next)
Split up polygons that have more than the max allowed number of points. Initially I shall just throw out polygons that have too many points to see if this is causing particular problems.

Specified by:
doFilter in interface MapFilter
Overrides:
doFilter in class BaseFilter
Parameters:
element - A map element, only polygons will be processed.
next - This is used to pass the possibly transformed element onward.