C# Class 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);
Inheritance: SharpMap.Data.Providers.IProvider, IDisposable
Afficher le fichier Open project: jumpinjackie/fdotoolbox Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

Close() public méthode

Closes the datasource
public Close ( ) : void
Résultat void

Dispose() public méthode

Disposes the object
public Dispose ( ) : void
Résultat void

ExecuteIntersectionQuery() public méthode

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
Résultat void

ExecuteIntersectionQuery() public méthode

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
Résultat void

GeometryProvider() public méthode

Initializes a new instance of the GeometryProvider
public GeometryProvider ( SharpMap.Data.FeatureDataRow feature ) : System
feature SharpMap.Data.FeatureDataRow Feature to be in this datasource
Résultat System

GeometryProvider() public méthode

Initializes a new instance of the GeometryProvider
public GeometryProvider ( FeatureDataTable features ) : System
features FeatureDataTable Features to be included in this datasource
Résultat System

GeometryProvider() public méthode

Initializes a new instance of the GeometryProvider
public GeometryProvider ( Geometry geometry ) : System
geometry Geometry Geometry to be in this datasource
Résultat System

GeometryProvider() public méthode

Initializes a new instance of the GeometryProvider
public GeometryProvider ( List geometries ) : System
geometries List Set of geometries that this datasource should contain
Résultat System

GeometryProvider() public méthode

Initializes a new instance of the GeometryProvider
public GeometryProvider ( byte wellKnownBinaryGeometry ) : System
wellKnownBinaryGeometry byte as Well-known Binary to be included in this datasource
Résultat System

GeometryProvider() public méthode

Initializes a new instance of the GeometryProvider
public GeometryProvider ( string wellKnownTextGeometry ) : System
wellKnownTextGeometry string as Well-known Text to be included in this datasource
Résultat System

GetExtents() public méthode

Boundingbox of dataset
public GetExtents ( ) : BoundingBox
Résultat BoundingBox

GetFeature() public méthode

Throws an NotSupportedException. Attribute data is not supported by this datasource
public GetFeature ( uint RowID ) : SharpMap.Data.FeatureDataRow
RowID uint
Résultat SharpMap.Data.FeatureDataRow

GetFeatureCount() public méthode

Returns the number of features in the dataset
public GetFeatureCount ( ) : int
Résultat int

GetGeometriesInView() public méthode

Returns features within the specified bounding box
public GetGeometriesInView ( BoundingBox bbox ) : List
bbox BoundingBox
Résultat List

GetGeometryByID() public méthode

Returns the geometry corresponding to the Object ID
public GetGeometryByID ( uint oid ) : Geometry
oid uint Object ID
Résultat Geometry

GetObjectIDsInView() public méthode

Returns all objects whose boundingbox intersects 'bbox'.
public GetObjectIDsInView ( BoundingBox bbox ) : List
bbox BoundingBox
Résultat List

GetXYTolerance() public méthode

public GetXYTolerance ( ) : double?
Résultat double?

Open() public méthode

Opens the datasource
public Open ( ) : void
Résultat void