uk.me.parabola.mkgmap.filters
Class PolygonSplitterFilter
java.lang.Object
uk.me.parabola.mkgmap.filters.BaseFilter
uk.me.parabola.mkgmap.filters.PolygonSplitterBase
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
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 |
MAX_POINT_IN_ELEMENT
public static final int MAX_POINT_IN_ELEMENT
- See Also:
- Constant Field Values
PolygonSplitterFilter
public PolygonSplitterFilter()
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.