C# Класс SharpMap.Data.Providers.GeometryProvider

Datasource for storing a limited set of geometries.

The GeometryProvider 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 GeometryProvider 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 GeometryProvider(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<SharpMap.Geometries.Geometry> geometries = new List<SharpMap.Geometries.Geometry>(); //Add two points geometries.Add(new SharpMap.Geometries.Point(23.345,64.325)); geometries.Add(new SharpMap.Geometries.Point(23.879,64.194)); SharpMap.Layers.VectorLayer layerVehicles = new SharpMap.Layers.VectorLayer("Vechicles"); layerVehicles.DataSource = new SharpMap.Data.Providers.GeometryProvider(geometries); layerVehicles.Style.Symbol = Bitmap.FromFile(@"C:\data\car.gif"); myMap.Layers.Add(layerVehicles);
Наследование: SharpMap.Data.Providers.IProvider, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Closes the datasource

Dispose ( ) : void

Disposes the object

ExecuteIntersectionQuery ( Geometry geom, SharpMap.Data.FeatureDataSet ds ) : void

Throws an NotSupportedException. Attribute data is not supported by this datasource

ExecuteIntersectionQuery ( SharpMap box, SharpMap.Data.FeatureDataSet ds ) : void

Throws an NotSupportedException. Attribute data is not supported by this datasource

GeometryProvider ( SharpMap.Data.FeatureDataRow feature ) : System

Initializes a new instance of the GeometryProvider

GeometryProvider ( FeatureDataTable features ) : System

Initializes a new instance of the GeometryProvider

GeometryProvider ( Geometry geometry ) : System

Initializes a new instance of the GeometryProvider

GeometryProvider ( List geometries ) : System

Initializes a new instance of the GeometryProvider

GeometryProvider ( byte wellKnownBinaryGeometry ) : System

Initializes a new instance of the GeometryProvider

GeometryProvider ( string wellKnownTextGeometry ) : System

Initializes a new instance of the GeometryProvider

GetExtents ( ) : BoundingBox

Boundingbox of dataset

GetFeature ( uint RowID ) : SharpMap.Data.FeatureDataRow

Throws an NotSupportedException. Attribute data is not supported by this datasource

GetFeatureCount ( ) : int

Returns the number of features in the dataset

GetGeometriesInView ( BoundingBox bbox ) : List

Returns features within the specified bounding box

GetGeometryByID ( uint oid ) : Geometry

Returns the geometry corresponding to the Object ID

GetObjectIDsInView ( BoundingBox bbox ) : List

Returns all objects whose boundingbox intersects 'bbox'.

GetXYTolerance ( ) : double?
Open ( ) : void

Opens the datasource

Описание методов

Close() публичный Метод

Closes the datasource
public Close ( ) : void
Результат void

Dispose() публичный Метод

Disposes the object
public Dispose ( ) : void
Результат void

ExecuteIntersectionQuery() публичный Метод

Throws an NotSupportedException. Attribute data is not supported by this datasource
public ExecuteIntersectionQuery ( Geometry geom, SharpMap.Data.FeatureDataSet ds ) : void
geom Geometry
ds SharpMap.Data.FeatureDataSet FeatureDataSet to fill data into
Результат void

ExecuteIntersectionQuery() публичный Метод

Throws an NotSupportedException. Attribute data is not supported by this datasource
public ExecuteIntersectionQuery ( SharpMap box, SharpMap.Data.FeatureDataSet ds ) : void
box SharpMap
ds SharpMap.Data.FeatureDataSet FeatureDataSet to fill data into
Результат void

GeometryProvider() публичный Метод

Initializes a new instance of the GeometryProvider
public GeometryProvider ( SharpMap.Data.FeatureDataRow feature ) : System
feature SharpMap.Data.FeatureDataRow Feature to be in this datasource
Результат System

GeometryProvider() публичный Метод

Initializes a new instance of the GeometryProvider
public GeometryProvider ( FeatureDataTable features ) : System
features FeatureDataTable Features to be included in this datasource
Результат System

GeometryProvider() публичный Метод

Initializes a new instance of the GeometryProvider
public GeometryProvider ( Geometry geometry ) : System
geometry Geometry Geometry to be in this datasource
Результат System

GeometryProvider() публичный Метод

Initializes a new instance of the GeometryProvider
public GeometryProvider ( List geometries ) : System
geometries List Set of geometries that this datasource should contain
Результат System

GeometryProvider() публичный Метод

Initializes a new instance of the GeometryProvider
public GeometryProvider ( byte wellKnownBinaryGeometry ) : System
wellKnownBinaryGeometry byte as Well-known Binary to be included in this datasource
Результат System

GeometryProvider() публичный Метод

Initializes a new instance of the GeometryProvider
public GeometryProvider ( string wellKnownTextGeometry ) : System
wellKnownTextGeometry string as Well-known Text to be included in this datasource
Результат System

GetExtents() публичный Метод

Boundingbox of dataset
public GetExtents ( ) : BoundingBox
Результат BoundingBox

GetFeature() публичный Метод

Throws an NotSupportedException. Attribute data is not supported by this datasource
public GetFeature ( uint RowID ) : SharpMap.Data.FeatureDataRow
RowID uint
Результат SharpMap.Data.FeatureDataRow

GetFeatureCount() публичный Метод

Returns the number of features in the dataset
public GetFeatureCount ( ) : int
Результат int

GetGeometriesInView() публичный Метод

Returns features within the specified bounding box
public GetGeometriesInView ( BoundingBox bbox ) : List
bbox BoundingBox
Результат List

GetGeometryByID() публичный Метод

Returns the geometry corresponding to the Object ID
public GetGeometryByID ( uint oid ) : Geometry
oid uint Object ID
Результат Geometry

GetObjectIDsInView() публичный Метод

Returns all objects whose boundingbox intersects 'bbox'.
public GetObjectIDsInView ( BoundingBox bbox ) : List
bbox BoundingBox
Результат List

GetXYTolerance() публичный Метод

public GetXYTolerance ( ) : double?
Результат double?

Open() публичный Метод

Opens the datasource
public Open ( ) : void
Результат void