Package org.mapfish.print.attribute.map
Class BBoxMapBounds
java.lang.Object
org.mapfish.print.attribute.map.MapBounds
org.mapfish.print.attribute.map.BBoxMapBounds
Represent the map bounds with a bounding box.
Created by Jesse on 3/26/14.
-
Constructor Summary
ConstructorsConstructorDescriptionBBoxMapBounds
(org.geotools.api.referencing.crs.CoordinateReferenceSystem projection, double minX, double minY, double maxX, double maxY) Constructor.BBoxMapBounds
(org.geotools.api.referencing.crs.CoordinateReferenceSystem projection, org.locationtech.jts.geom.Envelope envelope) Constructor.BBoxMapBounds
(org.geotools.geometry.jts.ReferencedEnvelope bbox) Create from a bbox. -
Method Summary
Modifier and TypeMethodDescriptionadjustBoundsToNearestScale
(ZoomLevels zoomLevels, double tolerance, ZoomLevelSnapStrategy zoomLevelSnapStrategy, boolean geodetic, Rectangle paintArea, double dpi) Adjust these bounds so that they are adjusted to the nearest scale in the provided set of scales.adjustBoundsToRotation
(double rotation) In case a rotation is used for the map, the bounds have to be adjusted so that all visible parts are rendered.adjustedEnvelope
(Rectangle paintArea) Create aReferencedEnvelope
representing the bounds.boolean
Expand the bounds by the given margin (in pixel).org.locationtech.jts.geom.Coordinate
Get the center.Calculate and return the scale of the map bounds.int
hashCode()
org.geotools.geometry.jts.ReferencedEnvelope
toReferencedEnvelope
(Rectangle paintArea) Create aReferencedEnvelope
representing the bounds.toString()
zoomOut
(double factor) Zooms-out the bounds by the given factor.zoomToScale
(Scale scale) Zoom to the given scale.Methods inherited from class org.mapfish.print.attribute.map.MapBounds
getNearestScale, getProjection
-
Constructor Details
-
BBoxMapBounds
public BBoxMapBounds(org.geotools.api.referencing.crs.CoordinateReferenceSystem projection, org.locationtech.jts.geom.Envelope envelope) Constructor.- Parameters:
projection
- the projection these bounds are defined in.envelope
- the bounds
-
BBoxMapBounds
public BBoxMapBounds(org.geotools.api.referencing.crs.CoordinateReferenceSystem projection, double minX, double minY, double maxX, double maxY) Constructor.- Parameters:
projection
- the projection these bounds are defined in.minX
- min X coordinate for the MapBoundsminY
- min Y coordinate for the MapBoundsmaxX
- max X coordinate for the MapBoundsmaxY
- max Y coordinate for the MapBounds
-
BBoxMapBounds
public BBoxMapBounds(org.geotools.geometry.jts.ReferencedEnvelope bbox) Create from a bbox.- Parameters:
bbox
- the bounds.
-
-
Method Details
-
toReferencedEnvelope
Description copied from class:MapBounds
Create aReferencedEnvelope
representing the bounds.- Specified by:
toReferencedEnvelope
in classMapBounds
- Parameters:
paintArea
- the size of the map that will be drawn (at 72 DPI).
-
adjustedEnvelope
Description copied from class:MapBounds
Create aReferencedEnvelope
representing the bounds.- Specified by:
adjustedEnvelope
in classMapBounds
- Parameters:
paintArea
- the size of the map that will be drawn.
-
adjustBoundsToNearestScale
public MapBounds adjustBoundsToNearestScale(ZoomLevels zoomLevels, double tolerance, ZoomLevelSnapStrategy zoomLevelSnapStrategy, boolean geodetic, Rectangle paintArea, double dpi) Description copied from class:MapBounds
Adjust these bounds so that they are adjusted to the nearest scale in the provided set of scales.The center should remain the same and the scale should be adjusted
- Specified by:
adjustBoundsToNearestScale
in classMapBounds
- Parameters:
zoomLevels
- the list of Zoom Levelstolerance
- the tolerance to use when considering if two values are equal. For example if 12.0 == 12.001. The tolerance is a percentagezoomLevelSnapStrategy
- the strategy to use for snapping to the nearest zoom level.geodetic
- snap to geodetic scales.paintArea
- the paint area of the map.dpi
- the DPI.
-
getScale
Description copied from class:MapBounds
Calculate and return the scale of the map bounds. -
adjustBoundsToRotation
Description copied from class:MapBounds
In case a rotation is used for the map, the bounds have to be adjusted so that all visible parts are rendered.- Specified by:
adjustBoundsToRotation
in classMapBounds
- Parameters:
rotation
- The rotation of the map in radians.- Returns:
- Bounds adjusted to the map rotation.
-
zoomOut
Description copied from class:MapBounds
Zooms-out the bounds by the given factor. -
zoomToScale
Description copied from class:MapBounds
Zoom to the given scale.- Specified by:
zoomToScale
in classMapBounds
- Parameters:
scale
- The new scale.- Returns:
- Bounds adjusted to the scale.
-
getCenter
public org.locationtech.jts.geom.Coordinate getCenter()Description copied from class:MapBounds
Get the center. -
expand
Expand the bounds by the given margin (in pixel).- Parameters:
margin
- Value in pixel.paintArea
- the paint area of the map.
-
equals
-
hashCode
public int hashCode() -
toString
-