Class MultipleFeatureSource
This MultipleFeatureSource is a special FeatureSource which holds a bunch of FeatureSource.
public class MultipleFeatureSource : FeatureSource
- Inheritance
-
MultipleFeatureSource
- Inherited Members
Remarks
Almost all API apply to MultipleFeatureSource will apply to each FeautureSource individually.
Constructors
MultipleFeatureSource()
This is the default constructor for the MultipleFeatureSource class.
public MultipleFeatureSource()
Remarks
All this constructor, you can add FeautureSources to this MultipleFeatureSource by calling the property FeatureSources.
MultipleFeatureSource(IEnumerable<FeatureSource>)
This is a constructor for the class by passing a group of FeeatureSources.
public MultipleFeatureSource(IEnumerable<FeatureSource> featureSources)
Parameters
featureSources
IEnumerable<FeatureSource>The target FeatureSources will be included in this MultipleFeatureSource.
Properties
FeatureSources
This property specify the FeatureSource collection within the MultipleFeatureSource.
public Collection<FeatureSource> FeatureSources { get; }
Property Value
IsEditable
This property returns if the FeatureSource allows edits or is read only.
public override bool IsEditable { get; }
Property Value
Remarks
This property is useful to check if a specific FeatureSource accepts editing.
If you call the BeginTransaction and this property is false then an exception will
be raised.
For developers who are creating or extending a FeatureSource it is expected that
you override this virtual method if the new FeatureSource you are creating allows
edits. By default the decimalDegreesValue if false meaning that if you want to allow edits you
must override this method and return true.
Methods
CloseCore()
This method closes the FeatureSource and releases any resources it was using.
protected override void CloseCore()
Remarks
This API will close all FeatureSource included in this MultipleFEatureSource.
CommitTransactionCore(TransactionBuffer)
This API is not supported in this concrete FeatureSource: MultipleFeatureSource.
protected override TransactionResult CommitTransactionCore(TransactionBuffer transactions)
Parameters
transactions
TransactionBufferThis parameter encapsulates all of the adds, edits and deleted that make up the transaction. You will use this data to write the changes to your underlying data source.
Returns
- TransactionResult
The return decimalDegreesValue of this method is a TransactionResult class which gives you the status of the transaction you just committed. It includes how many of the updates, adds, and deletes were successful and any error that were encountered during the committing of the transaction.
GetAllFeaturesCore(IEnumerable<string>)
This method returns all of the InternalFeatures in the MutipleFeatureSource.
protected override Collection<Feature> GetAllFeaturesCore(IEnumerable<string> returningColumnNames)
Parameters
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
The return value is a collection of all of the InternalFeatures in the MutipleFeatureSource.
Remarks
This returning collection of Features will include all the features counting all the FeatureSources in this MultipleFeautureSource.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
GetBoundingBoxCore()
This method returns the bounding box which encompasses all of the FeatureSources in the MutlpleFeatureSource.
protected override RectangleShape GetBoundingBoxCore()
Returns
- RectangleShape
This method returns the bounding box which encompasses all of the FeatureSources in the MutlpleFeatureSource.
Exceptions
- InvalidOperationException
If the operation is done under source closed state it will throw a InvalidOperationException.
GetColumnsCore()
This method returns the columns available for the FeatureSources within this MultipleFeatureSource.
protected override Collection<FeatureSourceColumn> GetColumnsCore()
Returns
- Collection<FeatureSourceColumn>
This method returns the columns available for the FeatureSources within this MultipleFeatureSource.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
GetCountCore()
This method returns the count of the number of records in this FeatureSource.
protected override long GetCountCore()
Returns
- long
This method returns the count of the number of records in this FeatureSource.
Remarks
This returning features count stands for the total count in all FeatureSource included in this MultipleFeatureSource.
Exceptions
- InvalidOperationException
If the operation is done under source closed state it will throw a InvalidOperationException.
GetFeaturesByIdsCore(IEnumerable<string>, IEnumerable<string>)
This method returns a collection of Features by providing a group of Ids.
protected override Collection<Feature> GetFeaturesByIdsCore(IEnumerable<string> ids, IEnumerable<string> returningColumnNames)
Parameters
ids
IEnumerable<string>This parameter represents the group of Ids which uniquely identified the Features in the FeatureSource.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
This method returns a collection of Features by providing a group of Ids.
Remarks
This returning collection of Features will include all the features with the passed in Ids insides all the FeatureSources in this MultipleFeautureSource.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
- ArgumentNullException
If you pass a null as the ids we will throw an ArgumentNullException.
- ArgumentNullException
If you pass a null as the returningColumnNames we will throw an ArgumentNullException.
GetFeaturesForDrawingCore(RectangleShape, double, double, IEnumerable<string>)
This method returns the InternalFeatures that will be used for drawing.
protected override Collection<Feature> GetFeaturesForDrawingCore(RectangleShape boundingBox, double screenWidth, double screenHeight, IEnumerable<string> returningColumnNames)
Parameters
boundingBox
RectangleShapeThis parameter is the bounding box of the InternalFeatures you want to draw.
screenWidth
doubleThis parameter is the width in screen pixels of the view you will draw on.
screenHeight
doubleThis parameter is the height in screen pixels of the view you will draw on.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
This method returns the InternalFeatures that will be used for drawing.
Remarks
This method returns all of the InternalFeatures of this FeatureSources with the MultipleFeatureSource in this MultipleFeautureSource. inside of the specified bounding box.
GetFeaturesInsideBoundingBoxCore(RectangleShape, IEnumerable<string>)
This method returns all of the InternalFeatures of this MultipleFeatureSource inside of the specified bounding box.
protected override Collection<Feature> GetFeaturesInsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable<string> returningColumnNames)
Parameters
boundingBox
RectangleShapeThis parameter represents the bounding box you with to find InternalFeatures inside of.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
Remarks
This returning collection of Features will include all the features insides all the FeatureSources in this MultipleFeautureSource.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
- ArgumentNullException
If you pass a null as the returningColumnNames we will throw an ArgumentNullException.
- ArgumentNullException
If you pass a null as the boundingBox we will throw an ArgumentNullException.
GetFeaturesNearestToCore(BaseShape, GeographyUnit, int, IEnumerable<string>)
This method will get a user defined number of Features that are closest to the TargetShape from all the FeatureSources within the MutlipleFeatureSource.
protected override Collection<Feature> GetFeaturesNearestToCore(BaseShape targetShape, GeographyUnit unitOfData, int maxItemsToFind, IEnumerable<string> returningColumnNames)
Parameters
targetShape
BaseShapeThis parameter is the shape you should to find close InternalFeatures to.
unitOfData
GeographyUnitThis parameter is the unit of what the TargetShape and the FeatureSource is in such as feet, meters etc.
maxItemsToFind
intThis parameter defines how many close InternalFeatures to find around the TargetShape.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
This method returns a user defined number of InternalFeatures that are closest to the TargetShape from all the FeatureSources within the MutlipleFeatureSource.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
- ArgumentNullException
If you pass a null as the targetShape we will throw an ArgumentNullException.
- ArgumentNullException
If you pass a null as the returningColumnNames we will throw an ArgumentNullException.
- ArgumentOutOfRangeException
If you pass in a maxItemsToFind that is not greater than 0 it will throw a ArgumentOutOfRangeException.
- ArgumentException
If you pass in a targetShape which is invalid we will throw an ArgumentException.
GetFeaturesOutsideBoundingBoxCore(RectangleShape, IEnumerable<string>)
This method returns all of the InternalFeatures of this FeatureSource outside of the specified bounding box from all the FeatureSources within the MutlipleFeatureSource.
protected override Collection<Feature> GetFeaturesOutsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable<string> returningColumnNames)
Parameters
boundingBox
RectangleShapeThis parameter represents the bounding box you with to find InternalFeatures outside of.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
This method returns all of the Features of this FeatureSource outside of the specified bounding box from all the FeatureSources within the MutlipleFeatureSource.
Remarks
This method returns all of the InternalFeatures of this FeatureSource outside of the
specified bounding box. If you are in a transaction and that transaction is live then
it will also take that into consideration.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
- ArgumentNullException
If you pass a null as the returningColumnNames we will throw an ArgumentNullException.
- ArgumentNullException
If you pass a null as the boundingBox we will throw an ArgumentNullException.
GetFeaturesWithinDistanceOfCore(BaseShape, GeographyUnit, DistanceUnit, double, IEnumerable<string>)
This method returns a collection of InternalFeatures that are within a certain distance of the TargetShape.This query will apply to all featureSource within this MultipleFeatureSource.
protected override Collection<Feature> GetFeaturesWithinDistanceOfCore(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance, IEnumerable<string> returningColumnNames)
Parameters
targetShape
BaseShapeThe shape you wish to find InternalFeatures within a distance of.
unitOfData
GeographyUnitThis parameter is the unit of data that the FeatureSource and TargetShape are in.
distanceUnit
DistanceUnitThis parameter specifies the unit of the distance parameter such as feet, miles or kilometers etc.
distance
doubleThis parameter specifies the distance in which to find InternalFeatures around the TargetShape.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
This method returns a collection of InternalFeatures that are within a certain distance of the TargetShape.
Remarks
This method returns a collection of InternalFeatures that are within a certain distance
of the TargetShape. It is important to note that the TargetShape and the FeatureSource
use the same unit such as feet or meters. If they do not then the results will not be
predictable or correct. If there is a current transaction and it is marked as live then
the results will include any transaction Feature that applies.
The implementation we provided create a bounding box around the TargetShape using the
distance supplied and then queries the features inside of it. This may not the most
efficient method for this operation. If you underlying data provider exposes a more
efficient way we recommend you override the Core version of this method and implement
it.
The default implementation of GetFeaturesWithinDistanceOfCore uses the
GetFeaturesInsideBoundingBoxCore method for speed. We strongly recommend that you
provide your own implementation for this method that will be more efficient. We
recommend when you override GetFeaturesInsideBoundingBoxCore method that you use any
spatial indexes you have at your disposal to make this method as fast as
possible.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
- ArgumentNullException
If you pass a null as the targetShape we will throw an ArgumentNullException.
- ArgumentNullException
If you pass a null as the returningColumnNames we will throw an ArgumentNullException.
- ArgumentOutOfRangeException
If you pass in a unitOfData that is not defined it will throw a ArgumentOutOfRangeException.
- ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined it will throw a ArgumentOutOfRangeException.
- ArgumentException
If you pass in a targetShape which is invalid we will throw an ArgumentException.
OpenCore()
This method opens the FeatureSource so that it is initialized and ready to use.
protected override void OpenCore()
Remarks
This API will open all FeatureSource included in this MultipleFEatureSource.
SpatialQueryCore(BaseShape, QueryType, IEnumerable<string>)
This method returns all of the InternalFeatures based on the target Feature and the spatial query type specified.
protected override Collection<Feature> SpatialQueryCore(BaseShape targetShape, QueryType queryType, IEnumerable<string> returningColumnNames)
Parameters
targetShape
BaseShapeThis parameter specifies the target shape used in the spatial query.
queryType
QueryTypeThis parameter specifies what kind of spatial query you wish to perform.
returningColumnNames
IEnumerable<string>This parameter allows you to select the field names of the column data you wish to return with each Feature.
Returns
- Collection<Feature>
The return value is a collection of Features that match the spatial query you executed based on the TargetShape.
Remarks
This method returns all of the InternalFeatures based on the target Feature and the
spatial query type specified below. This spatial query will apply to all featureSource
within this MultipleFeatureSource.
Spatial Query Types:
Disjoint - This method returns InternalFeatures where the specific Feature and
the targetShape have no points in common.
Intersects - This method returns InternalFeatures where the specific Feature
and the targetShape have at least one point in common.
Touches - This method returns InternalFeatures where the specific Feature and
the targetShape have at least one boundary point in common, but no interior
points.
Crosses - This method returns InternalFeatures where the specific Feature and
the targetShape share some but not all interior points.
Within - This method returns InternalFeatures where the specific Feature lies
within the interior of the targetShape.
Contains - This method returns InternalFeatures where the specific Feature
lies within the interior of the current shape.
Overlaps - This method returns InternalFeatures where the specific Feature and
the targetShape share some but not all points in common.
TopologicalEqual - This method returns InternalFeatures where the specific
Feature and the target Shape are topologically equal.
The default implementation of SpatialQueryCore uses the
GetFeaturesInsideBoundingBoxCore method to pre-filter the spatial query. We strongly
recommend that you provide your own implementation for this method that will be more
efficient. We recommend when you override that method that you use any spatial indexes
you have at your disposal to make this method as fast as possible.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a feature source which has not been opened it will throw an InvalidOperationException.
- ArgumentNullException
If you pass a null as the targetShape we will throw an ArgumentNullException.
- ArgumentNullException
If you pass a null as the returningColumnNames we will throw an ArgumentNullException.
- ArgumentOutOfRangeException
If you pass in a queryType that is not defined in the enumeration it will throw a ArgumentOutOfRangeException.
- ArgumentException
If you pass in a targetShape which is invalid we will throw an ArgumentException.