Package org.geotools.tile.impl
Class ScaleZoomLevelMatcher
Object
ScaleZoomLevelMatcher
This class is responsible for finding the right zoom-level for a given map extent.
- Since:
- 12
- Author:
- to.srwn
-
Constructor Summary
ConstructorsConstructorDescriptionScaleZoomLevelMatcher
(CoordinateReferenceSystem crsMap, CoordinateReferenceSystem crsTiles, MathTransform transformMapToTileCrs, MathTransform transformTileCrsToMap, ReferencedEnvelope mapExtentTileCrs, ReferencedEnvelope mapExtentMapCrs, double scale) -
Method Summary
Modifier and TypeMethodDescriptionstatic ScaleZoomLevelMatcher
createMatcher
(ReferencedEnvelope requestExtent, CoordinateReferenceSystem crsTiles, double scale) 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.projectMapToTileCrs
(ReferencedEnvelope boundsInMapCrs) projectTileToMapCrs
(ReferencedEnvelope boundsInTileCrs)
-
Constructor Details
-
ScaleZoomLevelMatcher
public ScaleZoomLevelMatcher(CoordinateReferenceSystem crsMap, CoordinateReferenceSystem crsTiles, MathTransform transformMapToTileCrs, MathTransform transformTileCrsToMap, ReferencedEnvelope mapExtentTileCrs, ReferencedEnvelope mapExtentMapCrs, double scale)
-
-
Method Details
-
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
-
getCrsTiles
-
getMapExtentTileCrs
-
getScale
public double getScale() -
getZoomLevelFromScale
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
-
projectTileToMapCrs
- Throws:
Exception
-
projectMapToTileCrs
- Throws:
Exception
-