From 1de91c050155347a04e70c3486c358d49b11727d Mon Sep 17 00:00:00 2001 From: singhdan Date: Sat, 21 Mar 2020 21:59:17 +0000 Subject: [PATCH 1/2] Addition of code comments and spelling corrections in GridSetFactory and GridSet --- .../java/org/geowebcache/grid/GridSet.java | 8 ++-- .../org/geowebcache/grid/GridSetFactory.java | 42 +++++++++++++++++-- 2 files changed, 43 insertions(+), 7 deletions(-) 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..f8deb4ba3 100644 --- a/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java +++ b/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java @@ -47,9 +47,28 @@ 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, final SRS srs, @@ -184,6 +203,23 @@ 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, From 115c516dcc4ff489e1cc4b356988d97d33ca4820 Mon Sep 17 00:00:00 2001 From: singhdan Date: Sat, 28 Mar 2020 17:49:19 +0000 Subject: [PATCH 2/2] Addition of code comments and spelling corrections in GridSetFactory and GridSet --- .../org/geowebcache/grid/GridSetFactory.java | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) 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 f8deb4ba3..a2d9feaa2 100644 --- a/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java +++ b/geowebcache/core/src/main/java/org/geowebcache/grid/GridSetFactory.java @@ -48,27 +48,30 @@ private static GridSet baseGridSet(String name, SRS srs, int tileWidth, int tile /** * 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. + * 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 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 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, final SRS srs, @@ -205,16 +208,19 @@ public static GridSet createGridSet( /** * 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 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 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