Show / Hide Table of Contents

    Class MemoryProvider

    Datasource for storing a limited set of geometries.

    Inheritance
    System.Object
    MemoryProvider
    Implements
    IProvider
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Mapsui.Providers
    Assembly: Mapsui.dll
    Syntax
    public class MemoryProvider : IProvider
    Remarks

    The MemoryProvider doesn’t utilize performance optimizations of spatial indexing, and thus is primarily meant for rendering a limited set of Geometries.

    A common use of the MemoryProvider is for highlighting a set of selected features.

    The following example gets data within a BoundingBox of another datasource and adds it to the map.

    List<Geometry> geometries = myMap.Layers[0].DataSource.GetGeometriesInView(myBox);
    VectorLayer laySelected = new VectorLayer("Selected Features");
    laySelected.DataSource = new MemoryProvider(geometries);
    laySelected.Style.Outline = new Pen(Color.Magenta, 3f);
    laySelected.Style.EnableOutline = true;
    myMap.Layers.Add(laySelected);

    Adding points of interest to the map. This is useful for vehicle tracking etc.

    List<Mapsui.Geometries.Geometry> geometries = new List<Mapsui.Geometries.Geometry>();
    //Add two points
    geometries.Add(new Mapsui.Geometries.Point(23.345,64.325));
    geometries.Add(new Mapsui.Geometries.Point(23.879,64.194));
    Mapsui.Layers.VectorLayer layerVehicles = new Mapsui.Layers.VectorLayer("Vechicles");
    layerVehicles.DataSource = new Mapsui.Data.Providers.MemoryProvider(geometries);
    layerVehicles.Style.Symbol = Bitmap.FromFile(@"C:\data\car.gif");
    myMap.Layers.Add(layerVehicles);

    Constructors

    | Improve this Doc View Source

    MemoryProvider()

    Declaration
    public MemoryProvider()
    | Improve this Doc View Source

    MemoryProvider(Geometry)

    Initializes a new instance of the MemoryProvider

    Declaration
    public MemoryProvider(Geometry geometry)
    Parameters
    Type Name Description
    Geometry geometry

    Geometry to be in this datasource

    | Improve this Doc View Source

    MemoryProvider(IFeature)

    Initializes a new instance of the MemoryProvider

    Declaration
    public MemoryProvider(IFeature feature)
    Parameters
    Type Name Description
    IFeature feature

    Feature to be in this datasource

    | Improve this Doc View Source

    MemoryProvider(Byte[])

    Initializes a new instance of the MemoryProvider

    Declaration
    public MemoryProvider(byte[] wellKnownBinaryGeometry)
    Parameters
    Type Name Description
    System.Byte[] wellKnownBinaryGeometry

    Geometry as Well-known Binary to be included in this datasource

    | Improve this Doc View Source

    MemoryProvider(IEnumerable<IGeometry>)

    Initializes a new instance of the MemoryProvider

    Declaration
    public MemoryProvider(IEnumerable<IGeometry> geometries)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<IGeometry> geometries

    Set of geometries that this datasource should contain

    | Improve this Doc View Source

    MemoryProvider(IEnumerable<IFeature>)

    Initializes a new instance of the MemoryProvider

    Declaration
    public MemoryProvider(IEnumerable<IFeature> features)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<IFeature> features

    Features to be included in this datasource

    | Improve this Doc View Source

    MemoryProvider(String)

    Initializes a new instance of the MemoryProvider

    Declaration
    public MemoryProvider(string wellKnownTextGeometry)
    Parameters
    Type Name Description
    System.String wellKnownTextGeometry

    Geometry as Well-known Text to be included in this datasource

    Properties

    | Improve this Doc View Source

    CRS

    The spatial reference ID (CRS)

    Declaration
    public string CRS { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Features

    Gets or sets the geometries this datasource contains

    Declaration
    public IReadOnlyList<IFeature> Features { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<IFeature>
    | Improve this Doc View Source

    SymbolSize

    Declaration
    public double SymbolSize { get; set; }
    Property Value
    Type Description
    System.Double

    Methods

    | Improve this Doc View Source

    Clear()

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Find(Object, String)

    Declaration
    public IFeature Find(object value, string primaryKey)
    Parameters
    Type Name Description
    System.Object value
    System.String primaryKey
    Returns
    Type Description
    IFeature
    | Improve this Doc View Source

    GetExtents()

    Boundingbox of dataset

    Declaration
    public BoundingBox GetExtents()
    Returns
    Type Description
    BoundingBox

    boundingbox

    | Improve this Doc View Source

    GetFeaturesInView(BoundingBox, Double)

    Declaration
    public virtual IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
    Parameters
    Type Name Description
    BoundingBox box
    System.Double resolution
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<IFeature>
    | Improve this Doc View Source

    ReplaceFeatures(IEnumerable<IFeature>)

    Declaration
    public void ReplaceFeatures(IEnumerable<IFeature> features)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<IFeature> features

    Implements

    IProvider
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX