Exemplo n.º 1
0
        public virtual IEnumerable <IFeature> GetFeaturesInView(BoundingBox box, double resolution)
        {
            if (box == null)
            {
                throw new ArgumentNullException("box");
            }

            lock (_syncRoot)
            {
                var features = Features.ToList();

                // Use a larger extent so that symbols partially outside of the extent are included
                var grownBox = box.Grow(resolution * SymbolSize * 0.5);

                foreach (var feature in features)
                {
                    if (feature.Geometry == null)
                    {
                        continue;
                    }

                    var boundingBox = feature.Geometry.GetBoundingBox();
                    if (boundingBox != null && grownBox.Intersects(boundingBox))
                    {
                        yield return(feature);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public virtual IEnumerable <IFeature> GetFeaturesInView(BoundingBox box, double resolution)
        {
            if (box == null)
            {
                throw new ArgumentNullException(nameof(box));
            }

            var features = Features.ToList();

            // Use a larger extent so that symbols partially outside of the extent are included
            var grownBox = box.Grow(resolution * SymbolSize * 0.5);

            return(features.Where(f => f.Geometry != null && f.Geometry.BoundingBox.Intersects(grownBox)).ToList());
        }
Exemplo n.º 3
0
        public virtual IEnumerable <T> GetFeatures(FetchInfo fetchInfo)
        {
            if (fetchInfo == null)
            {
                throw new ArgumentNullException(nameof(fetchInfo));
            }
            if (fetchInfo.Extent == null)
            {
                throw new ArgumentNullException(nameof(fetchInfo.Extent));
            }

            var features = Features.ToList();

            fetchInfo = new FetchInfo(fetchInfo);
            // Use a larger extent so that symbols partially outside of the extent are included
            var biggerBox     = fetchInfo.Extent?.Grow(fetchInfo.Resolution * SymbolSize * 0.5);
            var grownFeatures = features.Where(f => f != null && (f.Extent?.Intersects(biggerBox) ?? false));

            return(grownFeatures.ToList());
        }
Exemplo n.º 4
0
        public IEnumerable <IFeature> GetFeaturesInView(BoundingBox box, double resolution)
        {
            lock (syncRoot)
            {
                var features = Features.ToList();

                foreach (var feature in features)
                {
                    if (feature.Geometry == null)
                    {
                        continue;
                    }

                    if (box.Intersects(feature.Geometry.GetBoundingBox()))
                    {
                        yield return(feature);
                    }
                }
            }
        }