diff --git a/geowebcache/core/src/main/java/org/geowebcache/grid/GridSet.java b/geowebcache/core/src/main/java/org/geowebcache/grid/GridSet.java index 873952341..de6dbb4e2 100644 --- a/geowebcache/core/src/main/java/org/geowebcache/grid/GridSet.java +++ b/geowebcache/core/src/main/java/org/geowebcache/grid/GridSet.java @@ -57,7 +57,7 @@ public class GridSet implements Info { /** * {@code true} if the resolutions are preserved and the scaleDenominators calculated, {@code - * false} if the resolutions are calculated based on the sacale denominators. + * false} if the resolutions are calculated based on the scale denominators. */ private boolean resolutionsPreserved; @@ -94,7 +94,7 @@ void setOriginalExtent(BoundingBox originalExtent) { /** * @return {@code true} if the resolutions are preserved and the scaleDenominators calculated, - * {@code false} if the resolutions are calculated based on the sacale denominators. + * {@code false} if the resolutions are calculated based on the scale denominators. */ public boolean isResolutionsPreserved() { return resolutionsPreserved; @@ -103,7 +103,7 @@ public boolean isResolutionsPreserved() { /** * @param resolutionsPreserved {@code true} if the resolutions are preserved and the * scaleDenominators calculated, {@code false} if the resolutions are calculated based on - * the sacale denominators. + * the scale denominators. */ void setResolutionsPreserved(boolean resolutionsPreserved) { this.resolutionsPreserved = resolutionsPreserved; @@ -412,7 +412,7 @@ void setGridLevels(Grid[] gridLevels) { } /** - * The base cordinates in x/y order, used to map tile indexes to coordinate bounding boxes. + * The base coordinates in x/y order, used to map tile indexes to coordinate bounding boxes. * These can either be top left or bottom left, so must be kept private. * *

This is a derived property of {@link #getOriginalExtent()} and {@link diff --git a/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java b/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java index 0d0a568b0..a2d9feaa2 100644 --- a/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java +++ b/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java @@ -47,8 +47,30 @@ private static GridSet baseGridSet(String name, SRS srs, int tileWidth, int tile } /** - * Note that you should provide EITHER resolutions or scales. Providing both will cause a - * precondition violation exception. + * Creates a gridset and automatically calculates the grids (scale sets) based on either + * resolutions or on scaleDenoms .Note that you should provide EITHER resolutions or scales. + * Providing both will cause a precondition violation exception. + * + * @param extent the bounding box for the gridset + * @param resolutions the resolutions of each grid. Set to {@code null} if grids should be + * calculated using scaleDenoms instead. Resolutions should be in metres per pixel + * @param scaleDenoms the scale Denominators of each grid. Set to {@code null} if grids should + * be calculated using resolutions instead + * @param pixelSize the size of a pixel in meters. Used when calculating grids using scale + * denominators + * @param scaleNames the names of each grid + * @param tileWidth the width of each tile in pixels + * @param tileHeight the height of each tile in pixels + * @param alignTopLeft Indicates how the matrix should be aligned within the extent, where + * {@code true} means that the matrix should be aligned with the top left of the extent and + * {@code false} means that it should be aligned with the bottom left. + * @param metersPerUnit the number of meters per unit in the scale denominator. e.g. if the + * scale is 1/28000, then this should be set to 1.0 and the relevant scaleDenom will be + * 28000 + * @param name the name to be applied to the gridset + * @param srs the srs associated with this gridset + * @param yCoordinateFirst used to set the {@link GridSet#setyCoordinateFirst} value + * @return the created Gridset */ public static GridSet createGridSet( final String name, @@ -184,6 +206,26 @@ public static GridSet createGridSet( return gridSet; } + /** + * Creates a gridset with grids based on the extent and number of levels required. + * + * @param name the name to be applied to the gridset + * @param srs the srs associated with this gridset + * @param extent the bounding box for the gridset + * @param alignTopLeft Indicates how the matrix should be aligned within the extent, where + * {@code true} means that the matrix should be aligned with the top left of the extent and + * {@code false} means that it should be aligned with the bottom left. + * @param levels the number of levels that the gridset should have + * @param metersPerUnit the number of meters per unit in the scale denominator. e.g. if the + * scale is 1/28000, then this should be set to 1.0 and the relevant scaleDenom will be + * 28000 + * @param pixelSize the size of a pixel in meters. Used when calculating grids using scale + * denominators + * @param tileWidth the width of each tile in pixels + * @param tileHeight the height of each tile in pixels + * @param yCoordinateFirst used to set the {@link GridSet#setyCoordinateFirst} value + * @return the created GridSet + */ public static GridSet createGridSet( final String name, final SRS srs,