//支持空间插值 public ContourLine[] Generate(double resolutionX, double resolutionY, enumDataType dataType, double[] contourValues, IDW_Interpolation interpolate, Action <int, string> tracker) { if (contourValues == null || contourValues.Length == 0) { return(null); } using (IContourGenerator gen = ContourGeneratorFactory.GetContourGenerator(dataType)) { double[] rasPointValue; int width, height; if (tracker != null) { tracker(1, "正在进行空间插值..."); } interpolate.DoIDWinterpolation(resolutionX, resolutionY, out width, out height, out rasPointValue); gen.NoDataForOutsideAOI = _noData; gen.IsOutputUncompleted = _isOutputUncomplete; gen.Sample = _sample; if (tracker != null) { tracker(9, "正在准备数据..."); } gen.SetDataValue(rasPointValue, width, height); ContourLine[] retLines = gen.Generate(width, height, contourValues, tracker); _contourValues = gen.ContourValues; return(retLines); } }
public ContourLine[] Generate(IRasterBand raster, double[] contourValues, int[] aoi, Action <int, string> tracker) { if (raster == null || contourValues == null || contourValues.Length == 0) { return(null); } using (IContourGenerator gen = ContourGeneratorFactory.GetContourGenerator(raster.DataType)) { gen.NoDataForOutsideAOI = _noData; gen.IsOutputUncompleted = _isOutputUncomplete; gen.Sample = _sample; ContourLine[] retLines = gen.Generate(raster, contourValues, aoi, tracker); _contourValues = gen.ContourValues; return(retLines); } }