@Test public void testBuildCenterAspectTierDimensionsList() { final Bounds roughStackBounds = new Bounds(50000.0, 40000.0, 1.0, 70000.0, 65000.0, 3.0); final int fullScalePixelsPerCell = 1024 * 1024; final List<TierDimensions> tierDimensionsList = TierDimensions.buildCenterAspectTierDimensionsList(roughStackBounds, fullScalePixelsPerCell); final Object[][] expectedTierValues = { { 50000, 40000, 70000, 65000, 1, 1, 0.04576 }, { 49020, 38772, 70980, 66228, 3, 3, 0.125 }, { 47190, 36484, 72810, 68516, 7, 7, 0.25 }, { 49935, 39916, 70065, 65084, 11, 11, 0.5 }, { 49477, 39344, 70522, 65656, 23, 23, 1.0 } }; validateTiers(expectedTierValues, tierDimensionsList); }
static List<TierDimensions> buildCenterAspectTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerCell) { final double stackAspectRatio = roughStackFullScaleBounds.getDeltaX() / roughStackFullScaleBounds.getDeltaY(); final double cellHeight = Math.sqrt(maxPixelsPerCell / stackAspectRatio); final double cellWidth = stackAspectRatio * cellHeight; return buildCenterTierDimensionsList(roughStackFullScaleBounds, (int) cellWidth, (int) cellHeight); }
TierDimensions implements Serializable { static List<TierDimensions> buildCenterAspectTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerCell) { final double stackAspectRatio = roughStackFullScaleBounds.getDeltaX() / roughStackFullScaleBounds.getDeltaY(); final double cellHeight = Math.sqrt(maxPixelsPerCell / stackAspectRatio); final double cellWidth = stackAspectRatio * cellHeight; return buildCenterTierDimensionsList(roughStackFullScaleBounds, (int) cellWidth, (int) cellHeight); } }
TierDimensions implements Serializable { static List<TierDimensions> buildCenterAspectTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerCell) { final double stackAspectRatio = roughStackFullScaleBounds.getDeltaX() / roughStackFullScaleBounds.getDeltaY(); final double cellHeight = Math.sqrt(maxPixelsPerCell / stackAspectRatio); final double cellWidth = stackAspectRatio * cellHeight; return buildCenterTierDimensionsList(roughStackFullScaleBounds, (int) cellWidth, (int) cellHeight); } private  TierDimensions(final int fullScaleCellWidth,
                           final int fullScaleCellHeight,
                           final double scale,
                           final int rows,
                           final int columns,
                           final Bounds fullScaleBounds); }
TierDimensions implements Serializable { static List<TierDimensions> buildCenterAspectTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerCell) { final double stackAspectRatio = roughStackFullScaleBounds.getDeltaX() / roughStackFullScaleBounds.getDeltaY(); final double cellHeight = Math.sqrt(maxPixelsPerCell / stackAspectRatio); final double cellWidth = stackAspectRatio * cellHeight; return buildCenterTierDimensionsList(roughStackFullScaleBounds, (int) cellWidth, (int) cellHeight); } private  TierDimensions(final int fullScaleCellWidth,
                           final int fullScaleCellHeight,
                           final double scale,
                           final int rows,
                           final int columns,
                           final Bounds fullScaleBounds); int getRows(); int getColumns(); double getScale(); double getMinX(); double getMinY(); @Override String toString(); String toJson(); @JsonIgnore List<HierarchicalStack> getSplitStacks(final StackId roughTilesStackId,
                                                  final int tier); static List<TierDimensions> buildTierDimensionsList(final LayerSplitMethod splitMethod,
                                                               final Bounds roughStackFullScaleBounds,
                                                               final int cellPixelWidth,
                                                               final int cellPixelHeight,
                                                               final Integer maxNumberOfTiers); }
TierDimensions implements Serializable { static List<TierDimensions> buildCenterAspectTierDimensionsList(final Bounds roughStackFullScaleBounds, final int maxPixelsPerCell) { final double stackAspectRatio = roughStackFullScaleBounds.getDeltaX() / roughStackFullScaleBounds.getDeltaY(); final double cellHeight = Math.sqrt(maxPixelsPerCell / stackAspectRatio); final double cellWidth = stackAspectRatio * cellHeight; return buildCenterTierDimensionsList(roughStackFullScaleBounds, (int) cellWidth, (int) cellHeight); } private  TierDimensions(final int fullScaleCellWidth,
                           final int fullScaleCellHeight,
                           final double scale,
                           final int rows,
                           final int columns,
                           final Bounds fullScaleBounds); int getRows(); int getColumns(); double getScale(); double getMinX(); double getMinY(); @Override String toString(); String toJson(); @JsonIgnore List<HierarchicalStack> getSplitStacks(final StackId roughTilesStackId,
                                                  final int tier); static List<TierDimensions> buildTierDimensionsList(final LayerSplitMethod splitMethod,
                                                               final Bounds roughStackFullScaleBounds,
                                                               final int cellPixelWidth,
                                                               final int cellPixelHeight,
                                                               final Integer maxNumberOfTiers); static final JsonUtils.Helper<TierDimensions> JSON_HELPER; }