public static URI createRestURI ( final String matrixId , final int row , final int col , final WMTSLayerParam layerParam ) throws URISyntaxException { String path = layerParam . baseURL ; if ( layerParam . dimensions != null ) { for ( int i = 0 ; i < layerParam . dimensions . length ; i ++ ) { String dimension = layerParam . dimensions [ i ] ; String value = layerParam . dimensionParams . optString ( dimension ) ; if ( value == null ) { value = layerParam . dimensionParams . getString ( dimension . toUpperCase ( ) ) ; } path = path . replace ( "{" + dimension + "}" , value ) ; } } path = path . replace ( "{TileMatrixSet}" , layerParam . matrixSet ) ; path = path . replace ( "{TileMatrix}" , matrixId ) ; path = path . replace ( "{TileRow}" , String . valueOf ( row ) ) ; path = path . replace ( "{TileCol}" , String . valueOf ( col ) ) ; path = path . replace ( "{style}" , layerParam . style ) ; path = path . replace ( "{Layer}" , layerParam . layer ) ; return new URI ( path ) ; }
Prepare the baseURL to make a request .