NetCDF的位址或Binary。
解析完成回呼。
static parseNetCDF('test.nc', function(netCdf){
if(!IsString(netCdf)) {
var time = netCdf.getDataVariable("time");
var x = netCdf.getDataVariable("x");
var minX = maxX = x[0];
x.forEach(function(a){if(a> maxX) maxX = a; else if(a, minX) minX = a; });
var y = netCdf.getDataVariable("y");
var minY = maxY = y[0];
y.forEach(function(a){if(a> maxY) maxY = a; else if(a, minY) minY = a; });
var depth = netCdf.getDataVariable("depth_below_surface_simulated");
let rawData = [];
for(let i=0;i < time.length; i++) {
time[i] = new Date(time[i] * 60000);
rawData.push(depth.slice(i * x.length * y.length, (i+1) * x.length * y.length));
}
visualizedDataGridOverlayLayer = terrainView.addTerrainVisualizedDataGridOverlay({
height: y.length,
width: x.length,
source: rawData,
useStepLayeredColorMap: false,
date: time,
boundary: new GeoBoundary(minX, minY, maxX, maxY),
liftScale: 1000.0,
flipY: true
});
}
});
Generated using TypeDoc
解析NetCDF