protected override void OnClick() { //Set path to a .NetCDF _path = @"E:\Data\SDK\Test\ForSamples\2.7\VoxelData\china_epa.nc"; var map = MapView.Active.Map; QueuedTask.Run(() => { var cim_connection = new CIMVoxelDataConnection() { URI = _path }; //Can also just use the path.... var createParams = VoxelLayerCreationParams.Create(cim_connection); createParams.IsVisible = true; //VoxelLayerCreationParams allows you to enumerate the variables within the voxel var variables = createParams.Variables; foreach (var variable in variables) { var line = $"{variable.Variable}: {variable.DataType}, " + $"{variable.Description}, {variable.IsDefault}, {variable.IsSelected}"; System.Diagnostics.Debug.WriteLine(line); } //You can also pick the default variable createParams.SetDefaultVariable(variables.Last()); //Create the layer - map must be a local scene! LayerFactory.Instance.CreateLayer <VoxelLayer>(createParams, map); }); }
private void InitDataConnection(CIMVoxelDataConnection _) { }