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 ScaleZoomLevelMatcher
createMatcher(ReferencedEnvelope requestExtent, CoordinateReferenceSystem crsTiles, double scale)
CoordinateReferenceSystem
getCrsMap()
CoordinateReferenceSystem
getCrsTiles()
ReferencedEnvelope
getMapExtentTileCrs()
double
getOptimumScaleFromZoomLevel(int zoomLevel, TileService wmtSource)
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.static ReferencedEnvelope
getProjectedEnvelope(ReferencedEnvelope envelope, CoordinateReferenceSystem destinationCRS, MathTransform transformation)
Re-Projects the given envelope to destinationCRS using transformation.double
getScale()
int
getZoomLevelFromScale(TileService service, double[] tempScaleList)
Finds out the best fitting zoom-level for a given map-scale.ReferencedEnvelope
projectMapToTileCrs(ReferencedEnvelope boundsInMapCrs)
ReferencedEnvelope
projectTileToMapCrs(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:
FactoryException
TransformException
-
getProjectedEnvelope
public static ReferencedEnvelope getProjectedEnvelope(ReferencedEnvelope envelope, CoordinateReferenceSystem destinationCRS, MathTransform transformation) throws TransformException, FactoryException
Re-Projects the given envelope to destinationCRS using transformation.- Throws:
TransformException
FactoryException
-
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
-
-