|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.mkgmap.filters.DouglasPeuckerFilter
public class DouglasPeuckerFilter
This is a filter that smooths out lines at low resolutions. If the element has no size at all at the given resolution, then it is not passed on down the chain at all is excluded from the map at that resolution.
Constructor Summary | |
---|---|
DouglasPeuckerFilter(double filterDistance)
|
Method Summary | |
---|---|
void |
doFilter(MapElement element,
MapFilterChain next)
This applies to both lines and polygons. |
protected void |
douglasPeucker(java.util.List<Coord> points,
int startIndex,
int endIndex,
double allowedError)
Reduces point density by Douglas-Peucker algorithm |
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 |
Constructor Detail |
---|
public DouglasPeuckerFilter(double filterDistance)
Method Detail |
---|
public void init(FilterConfig config)
MapFilter
init
in interface MapFilter
config
- Configuration information, giving parameters of the map
level that is being produced through this filter.public void doFilter(MapElement element, MapFilterChain next)
doFilter
in interface MapFilter
element
- A map element that will be a line or a polygon.next
- This is used to pass the possibly transformed element onward.protected void douglasPeucker(java.util.List<Coord> points, int startIndex, int endIndex, double allowedError)
points
- The list of points to simplify.startIndex
- First index of segment. The point with this index will not be changedendIndex
- Last index of segment. The point with this index will not be changedallowedError
- Maximal allowed error to be introduced by simplification.
returns number of removed points.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |