Search in sources :

Example 1 with AreaClipper

use of uk.me.parabola.mkgmap.general.AreaClipper in project mkgmap by openstreetmap.

the class StyledConverter method setBoundingBox.

/**
 * Set the bounding box for this map.  This should be set before any other
 * elements are converted if you want to use it. All elements that are added
 * are clipped to this box, new points are added as needed at the boundary.
 *
 * If a node or a way falls completely outside the boundary then it would be
 * omitted.  This would not normally happen in the way this option is typically
 * used however.
 *
 * @param bbox The bounding area, must not be null.
 */
public void setBoundingBox(Area bbox) {
    this.clipper = new AreaClipper(bbox);
    this.bbox = bbox;
    // we calculate our own bounding box, now let the collector know about it.
    collector.addToBounds(new Coord(bbox.getMinLat(), bbox.getMinLong()));
    collector.addToBounds(new Coord(bbox.getMaxLat(), bbox.getMaxLong()));
}
Also used : AreaClipper(uk.me.parabola.mkgmap.general.AreaClipper) Coord(uk.me.parabola.imgfmt.app.Coord)

Aggregations

Coord (uk.me.parabola.imgfmt.app.Coord)1 AreaClipper (uk.me.parabola.mkgmap.general.AreaClipper)1