use of uk.me.parabola.mkgmap.filters.LineSizeSplitterFilter in project mkgmap by openstreetmap.
the class MapArea method addLines.
/**
* Add the lines, making sure that they are not too big for resolution
* that we are working with.
* @param src The map data.
* @param resolution The current resolution of the layer.
*/
private void addLines(MapDataSource src, final int resolution) {
// Split lines for size, such that it is appropriate for the
// resolution that it is at.
MapFilterChain chain = new MapFilterChain() {
public void doFilter(MapElement element) {
MapLine line = (MapLine) element;
addLine(line);
}
};
LineSizeSplitterFilter filter = new LineSizeSplitterFilter();
FilterConfig config = new FilterConfig();
config.setResolution(resolution);
config.setBounds(bounds);
filter.init(config);
for (MapLine l : src.getLines()) {
if (l.getMaxResolution() < resolution)
continue;
// %%% ??? if not appearing at this level no need to filter
filter.doFilter(l, chain);
}
}
Aggregations