Example #1
0
        /// <summary>
        /// Gets the values from the raster. If MaxSampleCount is less than the
        /// number of cells, then it randomly samples the raster with MaxSampleCount
        /// values. Otherwise it gets all the values in the raster.
        /// </summary>
        /// <param name="raster">The raster to sample.</param>
        public void GetValues(IRaster raster)
        {
            Values = raster.GetRandomValues(EditorSettings.MaxSampleCount);
            var keepers = Values.Where(val => val != raster.NoDataValue).ToList();

            Values = keepers;
            Statistics.Calculate(Values);
        }
Example #2
0
        /// <summary>
        /// Gets the values from the raster.  If MaxSampleCount is less than the
        /// number of cells, then it randomly samples the raster with MaxSampleCount
        /// values.  Otherwise it gets all the values in the raster.
        /// </summary>
        /// <param name="raster">The raster to sample</param>
        public void GetValues(IRaster raster)
        {
            Values = raster.GetRandomValues(EditorSettings.MaxSampleCount);
            List <double> keepers = new List <double>();

            foreach (double val in Values)
            {
                if (val != raster.NoDataValue)
                {
                    keepers.Add(val);
                }
            }
            Values = keepers;
            Statistics.Calculate(Values, raster.Minimum, raster.Maximum);
        }
        private void ReadValues()
        {
            if (_isRaster)
            {
                _values = _raster.GetRandomValues(_rasterSymbolizer.EditorSettings.MaxSampleCount);
                _statistics.Calculate(_values);
                if (_values == null)
                {
                    return;
                }
                return;
            }

            _values = _scheme.Values;
            if (_values == null)
            {
                return;
            }
            _scheme.Statistics.Calculate(_values);
        }
 /// <summary>
 /// Gets the values from the raster.  If MaxSampleCount is less than the
 /// number of cells, then it randomly samples the raster with MaxSampleCount
 /// values.  Otherwise it gets all the values in the raster.
 /// </summary>
 /// <param name="raster">The raster to sample</param>
 public void GetValues(IRaster raster)
 {
     Values = raster.GetRandomValues(EditorSettings.MaxSampleCount);
     Statistics.Calculate(Values, EditorSettings.Min, EditorSettings.Max);
 }
Example #5
0
 /// <summary>
 /// Gets the values from the raster.  If MaxSampleCount is less than the
 /// number of cells, then it randomly samples the raster with MaxSampleCount
 /// values.  Otherwise it gets all the values in the raster.
 /// </summary>
 /// <param name="raster">The raster to sample</param>
 public void GetValues(IRaster raster)
 {
     Values = raster.GetRandomValues(EditorSettings.MaxSampleCount);
     List<double> keepers = new List<double>();
     foreach (double val in Values)
     {
         if (val != raster.NoDataValue)
         {
             keepers.Add(val);
         }
     }
     Values = keepers;
     Statistics.Calculate(Values, raster.Minimum, raster.Maximum);
 }
Example #6
0
 /// <summary>
 /// Gets the values from the raster.  If MaxSampleCount is less than the
 /// number of cells, then it randomly samples the raster with MaxSampleCount
 /// values.  Otherwise it gets all the values in the raster.
 /// </summary>
 /// <param name="raster">The raster to sample</param>
 public void GetValues(IRaster raster)
 {
     Values = raster.GetRandomValues(EditorSettings.MaxSampleCount);
     var keepers = Values.Where(val => val != raster.NoDataValue).ToList();
     Values = keepers;
     Statistics.Calculate(Values, raster.Minimum, raster.Maximum);
 }