Esempio n. 1
0
        private List <int> SelectByRectangle()
        {
            _select_cs.Items.Clear();
            _featurelayer.ClearSelection();
            List <int> process = new List <int>();
            List <int> result = new List <int>();
            double     _minX, _minY, _maxX, _maxY;

            if (_startPoint1.X < _endPoint1.X)
            {
                _minX = _startPoint1.X;
                _maxX = _endPoint1.X;
            }
            else
            {
                _minX = _endPoint1.X;
                _maxX = _startPoint1.X;
            }

            if (_startPoint1.Y < _endPoint1.Y)
            {
                _minY = _startPoint1.Y;
                _maxY = _endPoint1.Y;
            }
            else
            {
                _minY = _endPoint1.Y;
                _maxY = _startPoint1.Y;
            }

            foreach (ColumnItem item in _cs.Items)
            {
                if (item.Value < _minY || (item.CategoryIndex + 0.25) < _minX || (item.CategoryIndex - 0.25) > _maxX)
                {
                    continue;
                }
                else
                {
                    foreach (string i in _dic_back.Keys)
                    {
                        if (_dic_back[i].Count == item.Value)
                        {
                            process = _dic_back[i];
                        }
                    }

                    foreach (int fid in process)
                    {
                        result.Add(fid);
                    }
                }
            }
            _ms.plotView1.Refresh();
            return(result);
        }
Esempio n. 2
0
        private List <int> SelectByRectangle()
        {
            _select_cs.Items.Clear();
            _featurelayer.ClearSelection();
            List <int> process = new List <int>();
            List <int> result = new List <int>();
            double     minX, minY, maxX, maxY;

            if (_startPoint1.X < _endPoint1.X)
            {
                minX = _startPoint1.X;
                maxX = _endPoint1.X;
            }
            else
            {
                minX = _endPoint1.X;
                maxX = _startPoint1.X;
            }

            if (_startPoint1.Y < _endPoint1.Y)
            {
                minY = _startPoint1.Y;
                maxY = _endPoint1.Y;
            }
            else
            {
                minY = _endPoint1.Y;
                maxY = _startPoint1.Y;
            }

            foreach (ColumnItem item in _cs.Items)
            {
                if (item.Value < minY || (item.CategoryIndex + 0.25) < minX || (item.CategoryIndex - 0.25) > maxX)
                {
                    continue;
                }
                else
                {
                    process = _dic_back[item.Value.ToString()];
                    foreach (int fid in process)
                    {
                        result.Add(fid);
                    }

                    //_select_cs.Items.Add(new ColumnItem {Value=item.Value,CategoryIndex =item.CategoryIndex } );
                }
            }

            _ms.plotView1.Refresh();
            return(result);
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="selectlb"></param>
        /// <param name="lb"></param>
        /// <param name="ms"></param>
        /// <param name="featurelayer"></param>
        /// <returns></returns>
        public List <int> SelectByRectangle(LineSeries selectlb, LineSeries lb, MapStatistics ms, IFeatureLayer featurelayer)
        {
            selectlb.Points.Clear();
            featurelayer.ClearSelection();
            List <int> result = new List <int>();
            double     minX, minY, maxX, maxY;

            if (ms._startPoint1.X < ms._endPoint1.X)
            {
                minX = ms._startPoint1.X;
                maxX = ms._endPoint1.X;
            }
            else
            {
                minX = ms._endPoint1.X;
                maxX = ms._startPoint1.X;
            }

            if (ms._startPoint1.Y < ms._endPoint1.Y)
            {
                minY = ms._startPoint1.Y;
                maxY = ms._endPoint1.Y;
            }
            else
            {
                minY = ms._endPoint1.Y;
                maxY = ms._startPoint1.Y;
            }

            foreach (DataPoint item in lb.Points)
            {
                if (item.X < minX || item.X > maxX || item.Y < minY || item.Y > maxY)
                {
                    continue;
                }
                else
                {
                    int pointIndex = ms._pointDic1[item.ToString()];
                    result.Add(pointIndex);
                    selectlb.Points.Add(item);
                }
            }

            ms.plotView1.Refresh();
            return(result);
        }