AsyncFeatureSource¶
Namespace: ThinkGeo.Core
Represents a source of features that is read asynchronously, typically over a network.
public abstract class AsyncFeatureSource
Inheritance object → AsyncFeatureSource
Remarks:
This is the asynchronous counterpart to FeatureSource, and it is deliberately much smaller. FeatureSource declares a single abstract method, GetAllFeaturesCore, and derives almost everything else from it by filtering the whole dataset in memory. That is workable for a file or a database, and a trap for a service: a spatial query against a remote server should never begin by downloading every feature it has.
So the only query declared here is the one every network service can actually answer - AsyncFeatureSource.GetFeaturesInsideBoundingBoxAsync(RectangleShape, IEnumerable<string>, CancellationToken). It is abstract rather than virtual precisely so that no derived source can inherit a download-everything-then-filter implementation by accident.
Anything a service may or may not support stays on the derived source instead of being promoted here - paging, counting, filtering on a column, addressing features by id. What is on offer is fixed by the protocol, so the concrete source type is where to look for it: a WFS 2.0 source can page and count, a WFS 1.0 source can do neither.
Transactions are not part of this model. None of the network-backed feature sources in the SDK implements write support, so the editing surface of FeatureSource has no counterpart here.
Properties¶
ConcurrentAccess¶
Gets or sets whether this source can be read from more than one thread at once, and if it cannot, whether copying it per worker is the cheap way to read it anyway.
public ConcurrentAccess ConcurrentAccess { get; set; }
Property Value¶
Remarks:
The same declaration FeatureSource.ConcurrentAccess carries, for the same reason: whoever cuts or draws several tiles at once asks the source before deciding whether to copy it per worker. ConcurrentAccess.UnsafeLock by default; a source that answers each read from its own request says ConcurrentAccess.Safe. https://community.thinkgeo.com/t/features-cut-off-on-tile-border-with-gpu-rendering/12481
IsOpen¶
Gets a value indicating whether the source has been opened and is ready to answer queries.
public bool IsOpen { get; private set; }
Property Value¶
ProjectionConverter¶
Gets or sets the converter that translates between the coordinate system the service publishes and the one the map is drawn in.
public ProjectionConverter ProjectionConverter { get; set; }
Property Value¶
Remarks:
Bounding boxes passed in are converted to the service's own projection before the request is issued, and the features that come back are converted to the map's projection. Where a service can reproject on request, asking it to do so is usually better than converting afterwards, because the server holds the authoritative transformation for its own grid.
GeometryType¶
Gets the kind of geometry the source holds - points, lines or areas - as its service declares it.
public WellKnownType GeometryType { get; protected set; }
Property Value¶
Remarks:
Read when the source opens, at no cost of its own: WFS from the DescribeFeatureType the open already fetches, ArcGIS Server from the layer definition. It is WellKnownType.Invalid before that, after the source closes, and whenever the service does not say - OGC API - Features has no required schema, and a WFS schema may name a geometry (gml:GeometryPropertyType) without saying which. Invalid is not a promise that the source holds no geometry. https://community.thinkgeo.com/t/v15-beta160-follow-up-remaining-gpu-style-parity-source-lifecycle-wfs-v2-and-wms-gaps/12468
Methods¶
OpenAsync(CancellationToken)¶
Opens the source so that it is initialized and ready to answer queries.
public Task OpenAsync(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task
A task that represents the asynchronous operation.
Remarks:
Several callers may open the same source at once - the tiles of a map do. The opens are taken one at a time, so OpenAsyncCore runs once, and every other caller waits and then finds the source open. If the open fails or is cancelled, the source stays closed, whatever the attempt built is released, the failure or the cancellation reaches the caller, and the next caller, including one that was waiting, tries again. CloseAsync calls off an open under way, through the token OpenAsyncCore is given, and takes its turn after it; the open it called off ends in an OperationCanceledException. Queries are not taken in turn, so do not close a source while a query is still running.
CloseAsync(CancellationToken)¶
Closes the source and releases whatever it was holding.
public Task CloseAsync(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task
A task that represents the asynchronous operation.
GetColumnsAsync(CancellationToken)¶
Returns the columns this source publishes.
public Task<Collection<FeatureSourceColumn>> GetColumnsAsync(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<FeatureSourceColumn>>
The columns available on the features this source returns.
Remarks:
How much this can promise depends on the service. WFS publishes a schema through DescribeFeatureType, which the specification requires and which every feature of the type conforms to; ArcGIS Server lists its fields in the layer definition. Both are dependable, and WFS in particular cannot narrow a response without them.
OGC API - Features is weaker: a schema document is optional there, and GeoJSON does not oblige every feature to carry the same properties. When no schema is published this returns an empty collection rather than inventing one.
The result is cached until the source is closed.
GetFeaturesInsideBoundingBoxAsync(RectangleShape, CancellationToken)¶
Returns the features that fall inside , with whatever column values the service returns by default.
public Task<Collection<Feature>> GetFeaturesInsideBoundingBoxAsync(RectangleShape boundingBox, CancellationToken cancellationToken)
Parameters¶
boundingBox RectangleShape
The extent to query, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features inside the bounding box.
GetFeaturesInsideBoundingBoxAsync(RectangleShape, IEnumerable<string>, CancellationToken)¶
Returns the features that fall inside .
public Task<Collection<Feature>> GetFeaturesInsideBoundingBoxAsync(RectangleShape boundingBox, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
boundingBox RectangleShape
The extent to query, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature. Null asks for whatever the service returns
by default, which for WFS is every column; an empty collection asks for geometry only.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features inside the bounding box.
Remarks:
Not every service can honour a column list. WFS narrows the response with propertyname; ArcGIS Server takes its field list from its own OutFields setting, and OGC API - Features returns whole GeoJSON features. A source that cannot narrow the response simply ignores this.
GetFeaturesIntersectingAsync(BaseShape, CancellationToken)¶
Returns the features that share any portion of space with .
public Task<Collection<Feature>> GetFeaturesIntersectingAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesIntersectingAsync(Feature, CancellationToken)¶
Returns the features that share any portion of space with .
public Task<Collection<Feature>> GetFeaturesIntersectingAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesIntersectingAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that share any portion of space with .
public Task<Collection<Feature>> GetFeaturesIntersectingAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesIntersectingAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that share any portion of space with .
public Task<Collection<Feature>> GetFeaturesIntersectingAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesContainingAsync(BaseShape, CancellationToken)¶
Returns the features that contain .
public Task<Collection<Feature>> GetFeaturesContainingAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesContainingAsync(Feature, CancellationToken)¶
Returns the features that contain .
public Task<Collection<Feature>> GetFeaturesContainingAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesContainingAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that contain .
public Task<Collection<Feature>> GetFeaturesContainingAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesContainingAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that contain .
public Task<Collection<Feature>> GetFeaturesContainingAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesCrossingAsync(BaseShape, CancellationToken)¶
Returns the features that cross .
public Task<Collection<Feature>> GetFeaturesCrossingAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesCrossingAsync(Feature, CancellationToken)¶
Returns the features that cross .
public Task<Collection<Feature>> GetFeaturesCrossingAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesCrossingAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that cross .
public Task<Collection<Feature>> GetFeaturesCrossingAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesCrossingAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that cross .
public Task<Collection<Feature>> GetFeaturesCrossingAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesOverlappingAsync(BaseShape, CancellationToken)¶
Returns the features that overlap .
public Task<Collection<Feature>> GetFeaturesOverlappingAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesOverlappingAsync(Feature, CancellationToken)¶
Returns the features that overlap .
public Task<Collection<Feature>> GetFeaturesOverlappingAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesOverlappingAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that overlap .
public Task<Collection<Feature>> GetFeaturesOverlappingAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesOverlappingAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that overlap .
public Task<Collection<Feature>> GetFeaturesOverlappingAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTopologicalEqualAsync(BaseShape, CancellationToken)¶
Returns the features that are topologically equal to .
public Task<Collection<Feature>> GetFeaturesTopologicalEqualAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTopologicalEqualAsync(Feature, CancellationToken)¶
Returns the features that are topologically equal to .
public Task<Collection<Feature>> GetFeaturesTopologicalEqualAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTopologicalEqualAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that are topologically equal to .
public Task<Collection<Feature>> GetFeaturesTopologicalEqualAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTopologicalEqualAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that are topologically equal to .
public Task<Collection<Feature>> GetFeaturesTopologicalEqualAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTouchingAsync(BaseShape, CancellationToken)¶
Returns the features that touch .
public Task<Collection<Feature>> GetFeaturesTouchingAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTouchingAsync(Feature, CancellationToken)¶
Returns the features that touch .
public Task<Collection<Feature>> GetFeaturesTouchingAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTouchingAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that touch .
public Task<Collection<Feature>> GetFeaturesTouchingAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesTouchingAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that touch .
public Task<Collection<Feature>> GetFeaturesTouchingAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesWithinAsync(BaseShape, CancellationToken)¶
Returns the features that lie within .
public Task<Collection<Feature>> GetFeaturesWithinAsync(BaseShape targetShape, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesWithinAsync(Feature, CancellationToken)¶
Returns the features that lie within .
public Task<Collection<Feature>> GetFeaturesWithinAsync(Feature targetFeature, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesWithinAsync(Feature, IEnumerable<string>, CancellationToken)¶
Returns the features that lie within .
public Task<Collection<Feature>> GetFeaturesWithinAsync(Feature targetFeature, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesWithinAsync(BaseShape, IEnumerable<string>, CancellationToken)¶
Returns the features that lie within .
public Task<Collection<Feature>> GetFeaturesWithinAsync(BaseShape targetShape, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to test against, in the map's projection.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
GetFeaturesNearestToAsync(BaseShape, GeographyUnit, int, DistanceUnit, double, CancellationToken)¶
Returns the features nearest to , looking no further than .
public Task<Collection<Feature>> GetFeaturesNearestToAsync(BaseShape targetShape, GeographyUnit unitOfData, int maxItemsToFind, DistanceUnit distanceUnit, double searchRadius, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
maxItemsToFind int
The greatest number of features to return.
distanceUnit DistanceUnit
The unit is expressed in.
searchRadius double
How far from the target to look.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The nearest features, closest first. Fewer than requested when the radius holds fewer.
GetFeaturesNearestToAsync(Feature, GeographyUnit, int, DistanceUnit, double, CancellationToken)¶
Returns the features nearest to , looking no further than .
public Task<Collection<Feature>> GetFeaturesNearestToAsync(Feature targetFeature, GeographyUnit unitOfData, int maxItemsToFind, DistanceUnit distanceUnit, double searchRadius, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
maxItemsToFind int
The greatest number of features to return.
distanceUnit DistanceUnit
The unit is expressed in.
searchRadius double
How far from the target to look.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The nearest features, closest first.
GetFeaturesNearestToAsync(Feature, GeographyUnit, int, DistanceUnit, double, IEnumerable<string>, CancellationToken)¶
Returns the features nearest to , looking no further than .
public Task<Collection<Feature>> GetFeaturesNearestToAsync(Feature targetFeature, GeographyUnit unitOfData, int maxItemsToFind, DistanceUnit distanceUnit, double searchRadius, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
maxItemsToFind int
The greatest number of features to return.
distanceUnit DistanceUnit
The unit is expressed in.
searchRadius double
How far from the target to look.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The nearest features, closest first.
GetFeaturesNearestToAsync(BaseShape, GeographyUnit, int, DistanceUnit, double, IEnumerable<string>, CancellationToken)¶
Returns the features nearest to , looking no further than .
public Task<Collection<Feature>> GetFeaturesNearestToAsync(BaseShape targetShape, GeographyUnit unitOfData, int maxItemsToFind, DistanceUnit distanceUnit, double searchRadius, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
maxItemsToFind int
The greatest number of features to return.
distanceUnit DistanceUnit
The unit is expressed in.
searchRadius double
How far from the target to look.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The nearest features, closest first. Fewer than requested when the radius holds fewer.
Remarks:
The radius is required, and that is the difference from QueryTools.GetFeaturesNearestTo(BaseShape, GeographyUnit, int, IEnumerable<string>). Nearest-N over an unbounded area has no safe implementation against a service: the synchronous version either downloads the whole collection, when asked for a hundred or more, or widens a box and re-queries until it has enough - a request per round, with nothing stopping it if the area is empty. Naming the radius turns this into a single bounded request, and an empty area costs one round trip instead of many.
GetFeaturesWithinDistanceOfAsync(BaseShape, GeographyUnit, DistanceUnit, double, CancellationToken)¶
Returns the features lying within of .
public Task<Collection<Feature>> GetFeaturesWithinDistanceOfAsync(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
distanceUnit DistanceUnit
The unit is expressed in.
distance double
How far from the target a feature may be and still be returned.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features within the distance.
GetFeaturesWithinDistanceOfAsync(Feature, GeographyUnit, DistanceUnit, double, CancellationToken)¶
Returns the features lying within of .
public Task<Collection<Feature>> GetFeaturesWithinDistanceOfAsync(Feature targetFeature, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
distanceUnit DistanceUnit
The unit is expressed in.
distance double
How far from the target a feature may be and still be returned.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features within the distance.
GetFeaturesWithinDistanceOfAsync(Feature, GeographyUnit, DistanceUnit, double, IEnumerable<string>, CancellationToken)¶
Returns the features lying within of .
public Task<Collection<Feature>> GetFeaturesWithinDistanceOfAsync(Feature targetFeature, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetFeature Feature
The feature to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
distanceUnit DistanceUnit
The unit is expressed in.
distance double
How far from the target a feature may be and still be returned.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features within the distance.
GetFeaturesWithinDistanceOfAsync(BaseShape, GeographyUnit, DistanceUnit, double, IEnumerable<string>, CancellationToken)¶
Returns the features lying within of .
public Task<Collection<Feature>> GetFeaturesWithinDistanceOfAsync(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
distanceUnit DistanceUnit
The unit is expressed in.
distance double
How far from the target a feature may be and still be returned.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features within the distance.
Remarks:
This asks the service for the target's bounding box grown by , then measures the candidates that come back. The service still does the narrowing, so this is one request over a small extent rather than a scan of the collection - the same shape FeatureSource.GetFeaturesWithinDistanceOf(BaseShape, GeographyUnit, DistanceUnit, double, IEnumerable<string>) has always had.
GetFeaturesWithinDistanceOfAsyncCore(BaseShape, GeographyUnit, DistanceUnit, double, IEnumerable<string>, CancellationToken)¶
When overridden in a derived class, returns the features lying within of .
protected Task<Collection<Feature>> GetFeaturesWithinDistanceOfAsyncCore(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
targetShape BaseShape
The shape to measure from, in the map's projection.
unitOfData GeographyUnit
The unit the map's coordinates are in.
distanceUnit DistanceUnit
The unit is expressed in.
distance double
How far from the target a feature may be and still be returned.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features within the distance.
Remarks:
The default grows the target's bounding box by the distance, asks for what falls inside it, and measures the candidates. Override this where the service can measure distance itself - a WFS 2.0 server can, through a DWithin filter - so that the candidates never cross the wire.
GetSearchExtent(BaseShape, GeographyUnit, DistanceUnit, double)¶
Grows the target's bounding box by the search distance, so the extent sent to the service covers everything that could be within range.
protected static RectangleShape GetSearchExtent(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, double distance)
Parameters¶
targetShape BaseShape
The shape to measure from.
unitOfData GeographyUnit
The unit the map's coordinates are in.
distanceUnit DistanceUnit
The unit the distance is expressed in.
distance double
The search distance.
Returns¶
RectangleShape
The extent to request.
OpenAsyncCore(CancellationToken)¶
When overridden in a derived class, opens whatever the source needs to answer queries - typically a capabilities or schema request against the service.
protected Task OpenAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task
A task that represents the asynchronous operation.
CloseAsyncCore(CancellationToken)¶
When overridden in a derived class, releases whatever acquired.
protected Task CloseAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task
A task that represents the asynchronous operation.
GetColumnsAsyncCore(CancellationToken)¶
When overridden in a derived class, returns the columns the service publishes.
protected Task<Collection<FeatureSourceColumn>> GetColumnsAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<FeatureSourceColumn>>
The columns available on the features this source returns.
Remarks:
The default returns an empty collection, which suits a service that has no schema document to describe its features.
GetFeaturesInsideBoundingBoxAsyncCore(RectangleShape, IEnumerable<string>, CancellationToken)¶
When overridden in a derived class, returns the features inside .
protected abstract Task<Collection<Feature>> GetFeaturesInsideBoundingBoxAsyncCore(RectangleShape boundingBox, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
boundingBox RectangleShape
The extent to query, already in the service's own projection.
returningColumnNames IEnumerable<string>
The column values to bring back with each feature.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features inside the bounding box.
Remarks:
This is the one query every derived source must implement, and it is abstract on purpose. Push the extent to the service; do not fetch everything and filter here.
GetBoundingBoxAsync(CancellationToken)¶
Returns the extent of the data, in the map's projection.
public Task<RectangleShape> GetBoundingBoxAsync(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<RectangleShape>
The extent, or null when the service reports none.
Exceptions¶
NotSupportedException
The source cannot report an extent.
Remarks:
What it costs is the service's. OGC API - Features, WFS 2.0 and ArcGIS Server advertise an extent that the source reads when it opens, so this answers at once; WFS 1.0 publishes none and costs one request, for a single feature whose boundedBy it reads.
GetBoundingBoxAsyncCore(CancellationToken)¶
Returns the extent of the data in the service's own projection, or null when it reports none. A source that can tell overrides this; the base cannot and throws NotSupportedException.
protected Task<RectangleShape> GetBoundingBoxAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<RectangleShape>
The extent in the service's projection.
GetCountAsync(CancellationToken)¶
Returns how many features the source holds.
public Task<long> GetCountAsync(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<long>
The count, or -1 when the service answers without one.
Exceptions¶
NotSupportedException
The source cannot count its features.
GetCountAsyncCore(CancellationToken)¶
Returns how many features the source holds, or -1 when the service answers without one. A source that can count overrides this; the base cannot and throws NotSupportedException.
protected Task<long> GetCountAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<long>
The count.
GetFeaturesByIdsAsync(IEnumerable<string>, CancellationToken)¶
Returns the features with the given ids, with whatever column values the service returns by default.
public Task<Collection<Feature>> GetFeaturesByIdsAsync(IEnumerable<string> ids, CancellationToken cancellationToken)
Parameters¶
ids IEnumerable<string>
The feature ids. Blank ids are skipped.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features found, in the map's projection.
Exceptions¶
NotSupportedException
The source cannot fetch features by id.
GetFeaturesByIdsAsync(IEnumerable<string>, IEnumerable<string>, CancellationToken)¶
Returns the features with the given ids.
public Task<Collection<Feature>> GetFeaturesByIdsAsync(IEnumerable<string> ids, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
ids IEnumerable<string>
The feature ids. Blank ids are skipped.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature, as for
.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features found, in the map's projection.
Exceptions¶
NotSupportedException
The source cannot fetch features by id.
GetFeaturesByIdsAsyncCore(IReadOnlyList<string>, IEnumerable<string>, CancellationToken)¶
Returns the features with the given ids, in the service's projection. A source that can fetch by id overrides this; the base cannot and throws NotSupportedException.
protected Task<Collection<Feature>> GetFeaturesByIdsAsyncCore(IReadOnlyList<string> ids, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
ids IReadOnlyList<string>
The feature ids, none of them blank, at least one.
returningColumnNames IEnumerable<string>
The columns to bring back, or null for the service's default.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The features found.
GetFeaturesByColumnValueAsync(string, string, CancellationToken)¶
Returns the features whose equals , with whatever column values the service returns by default.
public Task<Collection<Feature>> GetFeaturesByColumnValueAsync(string columnName, string columnValue, CancellationToken cancellationToken)
Parameters¶
columnName string
The column to match.
columnValue string
The value to match it against.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features, in the map's projection.
Exceptions¶
NotSupportedException
The source cannot filter by a column value.
GetFeaturesByColumnValueAsync(string, string, IEnumerable<string>, CancellationToken)¶
Returns the features whose equals .
public Task<Collection<Feature>> GetFeaturesByColumnValueAsync(string columnName, string columnValue, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
columnName string
The column to match.
columnValue string
The value to match it against.
returningColumnNames IEnumerable<string>
The columns to bring back with each feature, as for
.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features, in the map's projection.
Exceptions¶
NotSupportedException
The source cannot filter by a column value.
GetFeaturesByColumnValueAsyncCore(string, string, IEnumerable<string>, CancellationToken)¶
Returns the features whose column equals the value, in the service's projection. A source that can filter by a column value overrides this; the base cannot and throws NotSupportedException.
protected Task<Collection<Feature>> GetFeaturesByColumnValueAsyncCore(string columnName, string columnValue, IEnumerable<string> returningColumnNames, CancellationToken cancellationToken)
Parameters¶
columnName string
The column to match, not blank.
columnValue string
The value to match it against.
returningColumnNames IEnumerable<string>
The columns to bring back, or null for the service's default.
cancellationToken CancellationToken
A token that cancels the operation.
Returns¶
Task<Collection<Feature>>
The matching features.
A(RectangleShape)¶
internal RectangleShape A(RectangleShape )
Parameters¶
Returns¶
ConvertToInternalProjection(RectangleShape)¶
Converts an extent from the map's projection to the service's own.
protected RectangleShape ConvertToInternalProjection(RectangleShape boundingBox)
Parameters¶
boundingBox RectangleShape
The extent in the map's projection.
Returns¶
RectangleShape
The extent in the service's projection.
ConvertToExternalProjection(Collection<Feature>)¶
Converts features from the service's projection to the map's.
protected Collection<Feature> ConvertToExternalProjection(Collection<Feature> features)
Parameters¶
features Collection<Feature>
The features as the service returned them.
Returns¶
Collection<Feature>
The features in the map's projection.
CheckIsOpen()¶
Throws when the source has not been opened.
protected void CheckIsOpen()