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
Mostrar archivo Open project: jumpinjackie/fdotoolbox Class Usage Examples

Public Methods

Method 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 method

Closes the datasource
public Close ( ) : void
return void

Dispose() public method

Disposes the object
public Dispose ( ) : void
return void

ExecuteIntersectionQuery() public method

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
return void

ExecuteIntersectionQuery() public method

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
return void

GeometryProvider() public method

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

GeometryProvider() public method

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

GeometryProvider() public method

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

GeometryProvider() public method

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

GeometryProvider() public method

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

GeometryProvider() public method

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

GetExtents() public method

Boundingbox of dataset
public GetExtents ( ) : BoundingBox
return BoundingBox

GetFeature() public method

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

GetFeatureCount() public method

Returns the number of features in the dataset
public GetFeatureCount ( ) : int
return int

GetGeometriesInView() public method

Returns features within the specified bounding box
public GetGeometriesInView ( BoundingBox bbox ) : List
bbox BoundingBox
return List

GetGeometryByID() public method

Returns the geometry corresponding to the Object ID
public GetGeometryByID ( uint oid ) : Geometry
oid uint Object ID
return Geometry

GetObjectIDsInView() public method

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

GetXYTolerance() public method

public GetXYTolerance ( ) : double?
return double?

Open() public method

Opens the datasource
public Open ( ) : void
return void