// Copyright 2005, 2006 - Morten Nielsen (www.iter.dk) // // This file is part of SharpMap. // SharpMap is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // SharpMap is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public License // along with SharpMap; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections; using GeoAPI.CoordinateSystems; using GeoAPI.Extensions.Feature; using GeoAPI.Geometries; namespace SharpMap.Api { /// /// Interface for data providers /// TODO: move all editing-related properties / functions into a separate interface, IFeatureInteractor, IFeatureCollection? /// public interface IFeatureProvider : IDisposable { event EventHandler FeaturesChanged; event EventHandler CoordinateSystemChanged; /// /// Type of the features provided. /// Type FeatureType { get; } IList Features { get; } bool IsReadOnly { get; } [Obsolete("Create features somewhere else (e.g. in IFeatureEditor and add them to the repository")] Func AddNewFeatureFromGeometryDelegate { get; set; } /// /// The spatial reference system code (WKT). /// string SrsWkt { get; set; } /// /// Gets or sets the coordinate system. /// ICoordinateSystem CoordinateSystem { get; set; } /// /// Adds a new feature to the feature storage using geometry. /// /// [Obsolete("Create features somewhere else (e.g. in IFeatureEditor and add them to the repository")] IFeature Add(IGeometry geometry); /// /// Returns the number of features in the dataset /// /// number of features int GetFeatureCount(); /// /// Returns the geometry corresponding to the Object ID /// /// Object ID /// geometry IGeometry GetGeometryByID(int oid); /// /// Returns a based on a RowID /// /// /// /// datarow IFeature GetFeature(int index); /// /// Returns true if feature belongs to provider. /// /// /// bool Contains(IFeature feature); /// /// Returns the index of the feature in the internal list, or -1 if it does not contain the feature /// /// /// int IndexOf(IFeature feature); /// /// of dataset /// /// boundingbox IEnvelope GetExtents(); IEnvelope GetBounds(int recordIndex); } }