Package org.geotools.tile.impl
Class ScaleZoomLevelMatcher
- Object
-
- ScaleZoomLevelMatcher
-
public class ScaleZoomLevelMatcher extends Object
This class is responsible for finding the right zoom-level for a given map extent.- Since:
- 12
- Author:
- to.srwn
-
-
Constructor Summary
Constructors Constructor Description ScaleZoomLevelMatcher(CoordinateReferenceSystem crsMap, CoordinateReferenceSystem crsTiles, MathTransform transformMapToTileCrs, MathTransform transformTileCrsToMap, ReferencedEnvelope mapExtentTileCrs, ReferencedEnvelope mapExtentMapCrs, double scale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScaleZoomLevelMatchercreateMatcher(ReferencedEnvelope requestExtent, CoordinateReferenceSystem crsTiles, double scale)CoordinateReferenceSystemgetCrsMap()CoordinateReferenceSystemgetCrsTiles()ReferencedEnvelopegetMapExtentTileCrs()doublegetOptimumScaleFromZoomLevel(int zoomLevel, TileService wmtSource)doublegetOptimumScaleFromZoomLevel(int zoomLevel, TileService service, double[] tempScaleList)Calculates the "best" scale for a given zoom-level by calculating the scale for a tile in the center of the map-extent and by taking the mapCrs in account.static ReferencedEnvelopegetProjectedEnvelope(ReferencedEnvelope envelope, CoordinateReferenceSystem destinationCRS, MathTransform transformation)Re-Projects the given envelope to destinationCRS using transformation.doublegetScale()intgetZoomLevelFromScale(TileService service, double[] tempScaleList)Finds out the best fitting zoom-level for a given map-scale.ReferencedEnvelopeprojectMapToTileCrs(ReferencedEnvelope boundsInMapCrs)ReferencedEnvelopeprojectTileToMapCrs(ReferencedEnvelope boundsInTileCrs)
-
-
-
Constructor Detail
-
ScaleZoomLevelMatcher
public ScaleZoomLevelMatcher(CoordinateReferenceSystem crsMap, CoordinateReferenceSystem crsTiles, MathTransform transformMapToTileCrs, MathTransform transformTileCrsToMap, ReferencedEnvelope mapExtentTileCrs, ReferencedEnvelope mapExtentMapCrs, double scale)
-
-
Method Detail
-
createMatcher
public static ScaleZoomLevelMatcher createMatcher(ReferencedEnvelope requestExtent, CoordinateReferenceSystem crsTiles, double scale) throws FactoryException, TransformException
- Throws:
FactoryExceptionTransformException
-
getProjectedEnvelope
public static ReferencedEnvelope getProjectedEnvelope(ReferencedEnvelope envelope, CoordinateReferenceSystem destinationCRS, MathTransform transformation) throws TransformException, FactoryException
Re-Projects the given envelope to destinationCRS using transformation.- Throws:
TransformExceptionFactoryException
-
getCrsMap
public CoordinateReferenceSystem getCrsMap()
-
getCrsTiles
public CoordinateReferenceSystem getCrsTiles()
-
getMapExtentTileCrs
public ReferencedEnvelope getMapExtentTileCrs()
-
getScale
public double getScale()
-
getZoomLevelFromScale
public int getZoomLevelFromScale(TileService service, double[] tempScaleList)
Finds out the best fitting zoom-level for a given map-scale.
-
getOptimumScaleFromZoomLevel
public double getOptimumScaleFromZoomLevel(int zoomLevel, TileService service, double[] tempScaleList)Calculates the "best" scale for a given zoom-level by calculating the scale for a tile in the center of the map-extent and by taking the mapCrs in account. "Best" scale is the scale where a 256x256 tile has also this size when displayed in uDig.
-
getOptimumScaleFromZoomLevel
public double getOptimumScaleFromZoomLevel(int zoomLevel, TileService wmtSource)
-
projectTileToMapCrs
public ReferencedEnvelope projectTileToMapCrs(ReferencedEnvelope boundsInTileCrs) throws Exception
- Throws:
Exception
-
projectMapToTileCrs
public ReferencedEnvelope projectMapToTileCrs(ReferencedEnvelope boundsInMapCrs) throws Exception
- Throws:
Exception
-
-