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); } } } }
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()); }
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()); }
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); } } } }