public int getZoomLevel ( ) { Projection projection = getProjection ( ) ; if ( projection == null ) { throw new GeoPackageException ( "No projection was set which is required to determine the zoom level" ) ; } int zoomLevel = 0 ; BoundingBox boundingBox = getBoundingBox ( ) ; if ( boundingBox != null ) { if ( projection . isUnit ( Units . DEGREES ) ) { boundingBox = TileBoundingBoxUtils . boundDegreesBoundingBoxWithWebMercatorLimits ( boundingBox ) ; } ProjectionTransform webMercatorTransform = projection . getTransformation ( ProjectionConstants . EPSG_WEB_MERCATOR ) ; BoundingBox webMercatorBoundingBox = boundingBox . transform ( webMercatorTransform ) ; zoomLevel = TileBoundingBoxUtils . getZoomLevel ( webMercatorBoundingBox ) ; } return zoomLevel ; }
Get the approximate zoom level of where the bounding box of the user data fits into the world