@@ -55,7 +55,7 @@ public GridSet buildGridset(
5555 */
5656 final double [] scaleDenominators = null ;
5757 final Double metersPerUnit ;
58- final String [] scaleNames = null ;
58+ final String [] scaleNames ;
5959 final int tileWidth = tileCacheInfo .getTileCols ();
6060 final int tileHeight = tileCacheInfo .getTileRows ();
6161 final boolean yCoordinateFirst = false ;
@@ -71,6 +71,9 @@ public GridSet buildGridset(
7171 resolutions = resAndScales [0 ];
7272
7373 double [] scales = resAndScales [1 ];
74+
75+ scaleNames = getScaleNames (lodInfos );
76+
7477 // TODO: check whether pixelSize computed above should be used instead
7578 metersPerUnit = (GridSetFactory .DEFAULT_PIXEL_SIZE_METER * scales [0 ]) / resolutions [0 ];
7679 }
@@ -126,13 +129,25 @@ public GridSet buildGridset(
126129
127130 private double [][] getResolutions (List <LODInfo > lodInfos ) {
128131 final int numLevelsOfDetail = lodInfos .size ();
129- double [][] resolutionsAndScales = new double [2 ][numLevelsOfDetail ];
132+ double [][] resolutionsAndScales = new double [3 ][numLevelsOfDetail ];
130133 LODInfo lodInfo ;
131134 for (int i = 0 ; i < numLevelsOfDetail ; i ++) {
132135 lodInfo = lodInfos .get (i );
133136 resolutionsAndScales [0 ][i ] = lodInfo .getResolution ();
134137 resolutionsAndScales [1 ][i ] = lodInfo .getScale ();
138+ resolutionsAndScales [2 ][i ] = lodInfo .getLevelID ();
135139 }
136140 return resolutionsAndScales ;
137141 }
142+
143+ private String [] getScaleNames (List <LODInfo > lodInfos ) {
144+ final int numLevelsOfDetail = lodInfos .size ();
145+ String [] scaleNames = new String [numLevelsOfDetail ];
146+ LODInfo lodInfo ;
147+ for (int i = 0 ; i < numLevelsOfDetail ; i ++) {
148+ lodInfo = lodInfos .get (i );
149+ scaleNames [i ] = String .valueOf (lodInfo .getLevelID ());
150+ }
151+ return scaleNames ;
152+ }
138153}
0 commit comments