Пример #1
0
        /// <summary>
        /// Method to query all the ids of features in this node that intersect the box defined
        /// by <paramref name="minx"/>, <paramref name="miny"/>, <paramref name="maxx"/>
        /// and <paramref name="maxy"/>
        /// </summary>
        /// <param name="minx">The lower x-ordinate</param>
        /// <param name="miny">The lower y-ordinate</param>
        /// <param name="maxx">The upper x-ordinate</param>
        /// <param name="maxy">The upper y-ordinate</param>
        /// <param name="fidList">A list of feature ids to add to</param>
        /// <returns>An enumeration of feature ids</returns>
        internal void QueryFids(byte minx, byte miny, byte maxx, byte maxy, List <uint> fidList)
        {
            if (ContainedBy(minx, miny, maxx, maxy))
            {
                AddAllFidsInNode(fidList);
                return;
            }

            foreach (var feature in this)
            {
                if (feature.Intersects(minx, maxx, miny, maxy))
                {
                    fidList.Add(feature.Fid);
                }
            }

            if (Nid < _tree.FirstLeafNodeId)
            {
                if (Child1.Intersects(minx, miny, maxx, maxy))
                {
                    Child1.QueryFids(minx, miny, maxx, maxy, fidList);
                }
                if (Child2.Intersects(minx, miny, maxx, maxy))
                {
                    Child2.QueryFids(minx, miny, maxx, maxy, fidList);
                }
            }
        }