コード例 #1
0
        /// <summary>
        /// Method to query the feature's ids
        /// </summary>
        /// <param name="envelope">The extent in which to look for features</param>
        /// <returns>An enumeration of feature ids</returns>
        public IEnumerable <uint> QueryFids(Envelope envelope)
        {
            if (envelope == null || envelope.IsNull)
            {
                return(null);
            }

            envelope = envelope.Intersection(_sbnHeader.Extent);
            var res = new List <uint>();

            if (envelope.IsNull)
            {
                return(res);
            }

            byte minx, miny, maxx, maxy;

            ClampUtility.Clamp(_sbnHeader.Extent, envelope, out minx, out miny, out maxx, out maxy);

            var nodes = new List <SbnQueryOnlyNode>();

            Root.QueryNodes(minx, miny, maxx, maxy, nodes);
            nodes.Sort();
            foreach (var node in nodes)
            {
                node.QueryFids(minx, miny, maxx, maxy, res, false);
            }

            //Root.QueryFids(minx, miny, maxx, maxy, res);

            res.Sort();
            return(res);
        }
コード例 #2
0
ファイル: SbnTree.cs プロジェクト: FObermaier/SharpSbn
        /// <summary>
        /// Method to query the ids of features that intersect with <paramref name="extent"/>
        /// </summary>
        /// <param name="extent">The extent</param>
        /// <returns>An enumeration of feature ids</returns>
        public IEnumerable <uint> QueryFids(Envelope extent)
        {
            var res = new List <uint>();

            Monitor.Enter(_syncRoot);

            extent = _header.Extent.Intersection(extent);
            byte minx, miny, maxx, maxy;

            ClampUtility.Clamp(_header.Extent, extent,
                               out minx, out miny, out maxx, out maxy);

            Root.QueryFids(minx, miny, maxx, maxy, res);

            Monitor.Exit(_syncRoot);

            res.Sort();

            return(res);
        }
コード例 #3
0
ファイル: SbnFeature.cs プロジェクト: FObermaier/SharpSbn
 /// <summary>
 /// Creates an instance of this class using the provided <paramref name="fid"/> and <paramref name="extent"/>
 /// </summary>
 /// <param name="sfExtent">The extent of the index</param>
 /// <param name="fid">The feature's id</param>
 /// <param name="extent">The feature's extent</param>
 public SbnFeature(Envelope sfExtent, uint fid, Envelope extent)
 {
     _fid = fid;
     ClampUtility.Clamp(sfExtent, extent, out MinX, out MinY, out MaxX, out MaxY);
 }