Class HonuaOgcFeaturesClient
- Namespace
- Honua.Sdk.OgcFeatures
- Assembly
- Honua.Sdk.OgcFeatures.dll
HTTP client implementation for the Honua OGC API Features read/query API.
public sealed class HonuaOgcFeaturesClient : IHonuaOgcFeaturesClient, IHonuaOgcFeaturesEditClient, IHonuaOgcFeaturesPatchClient, IHonuaFeatureQueryClient, IHonuaFeatureEditClient, IHonuaFeatureDescriptorClient, IHonuaFeatureAttachmentClient
- Inheritance
-
HonuaOgcFeaturesClient
- Implements
- Inherited Members
- Extension Methods
Constructors
HonuaOgcFeaturesClient(HttpClient)
Initializes a new instance of the HonuaOgcFeaturesClient class.
public HonuaOgcFeaturesClient(HttpClient httpClient)
Parameters
httpClientHttpClientThe HTTP client configured with base address and auth handlers.
Properties
AttachmentCapabilities
Provider attachment capabilities exposed by this client.
public FeatureAttachmentCapabilities AttachmentCapabilities { get; }
Property Value
EditCapabilities
Provider edit capabilities exposed by this client.
public FeatureEditCapabilities EditCapabilities { get; }
Property Value
ProviderName
Provider name for diagnostics and provider selection.
public string ProviderName { get; }
Property Value
QueryCapabilities
Provider query capabilities exposed by this client. A geoprocessing tool inspects these flags (for example SupportsTimeFilter or SupportsHaving) to pick a provider that supports a temporal or grouped-statistics query instead of catching a runtime NotSupportedException. The default implementation reports every facet as unsupported so providers must opt in explicitly.
public FeatureQueryCapabilities QueryCapabilities { get; }
Property Value
Methods
AddAttachmentAsync(FeatureAttachmentAddRequest, CancellationToken)
Adds an attachment to one feature.
public Task<FeatureAttachmentResult> AddAttachmentAsync(FeatureAttachmentAddRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentAddRequestProvider-neutral attachment add request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentResult>
Attachment operation result.
ApplyEditsAsync(FeatureEditRequest, CancellationToken)
Applies add, update, and delete feature edits.
public Task<FeatureEditResponse> ApplyEditsAsync(FeatureEditRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureEditRequestProvider-neutral edit request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureEditResponse>
Provider-neutral edit response.
CreateItemAsync(string, OgcFeature, CancellationToken)
Creates a feature in a collection with the OGC API Features items endpoint.
public Task<OgcFeature> CreateItemAsync(string collectionId, OgcFeature feature, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
featureOgcFeatureGeoJSON feature to create.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcFeature>
The created feature representation returned by the server.
DeleteAttachmentAsync(FeatureAttachmentDeleteRequest, CancellationToken)
Deletes one attachment.
public Task<FeatureAttachmentResult> DeleteAttachmentAsync(FeatureAttachmentDeleteRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentDeleteRequestProvider-neutral attachment delete request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentResult>
Attachment operation result.
DeleteItemAsync(string, string, CancellationToken)
Deletes a feature from a collection with the OGC API Features item endpoint.
public Task DeleteItemAsync(string collectionId, string featureId, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
featureIdstringThe feature identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
DownloadAttachmentAsync(FeatureAttachmentDownloadRequest, CancellationToken)
Downloads one attachment.
public Task<FeatureAttachmentContent> DownloadAttachmentAsync(FeatureAttachmentDownloadRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentDownloadRequestProvider-neutral attachment download request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentContent>
Downloaded attachment content. Dispose the returned content stream when finished.
GetCollectionAsync(string, CancellationToken)
Gets metadata for a specific collection.
public Task<OgcCollection> GetCollectionAsync(string collectionId, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcCollection>
Collection metadata including extent, CRS, and links.
GetConformanceAsync(CancellationToken)
Gets the conformance declaration listing supported OGC standards.
public Task<OgcConformance> GetConformanceAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcConformance>
The conformance response with URIs of supported conformance classes.
GetDescriptorAsync(SourceDescriptor, CancellationToken)
Retrieves provider-neutral source schema and capability metadata for the supplied source descriptor.
public Task<SourceDescriptor> GetDescriptorAsync(SourceDescriptor descriptor, CancellationToken cancellationToken = default)
Parameters
descriptorSourceDescriptorSource descriptor containing the provider-specific locator.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<SourceDescriptor>
The source descriptor enriched with discovered schema and capabilities.
GetItemAsync(string, string, CancellationToken)
Gets a single feature by ID from a collection.
public Task<OgcFeature> GetItemAsync(string collectionId, string featureId, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
featureIdstringThe feature identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcFeature>
The requested GeoJSON feature.
GetItemsAsync(string, OgcItemsParams?, CancellationToken)
Gets a single page of features from a collection.
public Task<OgcFeatureCollection> GetItemsAsync(string collectionId, OgcItemsParams? query = null, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
queryOgcItemsParamsOptional query parameters for filtering, paging, and projection.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcFeatureCollection>
A GeoJSON FeatureCollection with features and paging links.
GetItemsPagesAsync(string, OgcItemsParams?, CancellationToken)
Gets features from a collection with automatic paging via IAsyncEnumerable<T>. Follows HATEOAS "next" links for subsequent pages.
public IAsyncEnumerable<OgcFeatureCollection> GetItemsPagesAsync(string collectionId, OgcItemsParams? query = null, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
queryOgcItemsParamsOptional query parameters for filtering and projection.
cancellationTokenCancellationTokenCancellation token.
Returns
- IAsyncEnumerable<OgcFeatureCollection>
An async enumerable of feature collection pages.
GetItemsRawAsync(string, OgcItemsParams?, CancellationToken)
Gets features in a raw HTTP response for non-JSON formats (GML, CSV, HTML, Parquet, Arrow); the caller owns response disposal.
public Task<HttpResponseMessage> GetItemsRawAsync(string collectionId, OgcItemsParams? query = null, CancellationToken cancellationToken = default)
Parameters
collectionIdstringqueryOgcItemsParamscancellationTokenCancellationToken
Returns
GetItemsStreamAsync(string, OgcFeaturesFormat, CancellationToken)
Gets features as a status- and content-type-validated raw stream for the requested format (such as Parquet or Arrow); decoding is left to the caller and the returned stream owns response disposal.
public Task<Stream> GetItemsStreamAsync(string collectionId, OgcFeaturesFormat format, CancellationToken cancellationToken = default)
Parameters
collectionIdstringformatOgcFeaturesFormatcancellationTokenCancellationToken
Returns
GetItemsStreamAsync(string, OgcItemsParams?, CancellationToken)
Gets features as a status- and content-type-validated raw stream using query parameters (including columnar formats such as Parquet or Arrow); decoding is left to the caller and the returned stream owns response disposal.
public Task<Stream> GetItemsStreamAsync(string collectionId, OgcItemsParams? query = null, CancellationToken cancellationToken = default)
Parameters
collectionIdstringqueryOgcItemsParamscancellationTokenCancellationToken
Returns
GetItemsVectorAsync(string, OgcItemsParams?, VectorPayloadFormat?, CancellationToken)
public Task<VectorPayloadFeatureSet> GetItemsVectorAsync(string collectionId, OgcItemsParams? query = null, VectorPayloadFormat? format = null, CancellationToken cancellationToken = default)
Parameters
collectionIdstringqueryOgcItemsParamsformatVectorPayloadFormat?cancellationTokenCancellationToken
Returns
GetLandingPageAsync(CancellationToken)
Gets the OGC API landing page with service metadata and navigation links.
public Task<OgcLandingPage> GetLandingPageAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcLandingPage>
The landing page response.
GetQueryablesAsync(string, CancellationToken)
Gets the queryable properties for a collection (JSON Schema).
public Task<OgcQueryables> GetQueryablesAsync(string collectionId, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcQueryables>
Queryable properties as a JSON Schema object.
ListAttachmentsAsync(FeatureAttachmentListRequest, CancellationToken)
Lists attachments for one feature.
public Task<IReadOnlyList<FeatureAttachmentInfo>> ListAttachmentsAsync(FeatureAttachmentListRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentListRequestProvider-neutral attachment list request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IReadOnlyList<FeatureAttachmentInfo>>
Attachment metadata.
ListCollectionsAsync(CancellationToken)
Lists all available feature collections.
public Task<IReadOnlyList<OgcCollection>> ListCollectionsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IReadOnlyList<OgcCollection>>
A list of collections with metadata.
PatchItemAsync(string, string, JsonElement, CancellationToken)
Applies an RFC 7396 JSON Merge Patch payload to a feature in a collection.
public Task<OgcFeature> PatchItemAsync(string collectionId, string featureId, JsonElement patch, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
featureIdstringThe feature identifier.
patchJsonElementJSON Merge Patch payload.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcFeature>
The patched feature representation returned by the server.
QueryAsync(FeatureQueryRequest, CancellationToken)
Executes a feature query and returns a single result page.
public Task<FeatureQueryResult> QueryAsync(FeatureQueryRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureQueryRequestProvider-neutral query request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureQueryResult>
A provider-neutral result page.
QueryPagesAsync(FeatureQueryRequest, CancellationToken)
Executes a feature query and returns provider-neutral result pages.
public IAsyncEnumerable<FeatureQueryResult> QueryPagesAsync(FeatureQueryRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureQueryRequestProvider-neutral query request.
cancellationTokenCancellationTokenCancellation token.
Returns
- IAsyncEnumerable<FeatureQueryResult>
Provider-neutral result pages.
UpdateAttachmentAsync(FeatureAttachmentUpdateRequest, CancellationToken)
Updates one attachment.
public Task<FeatureAttachmentResult> UpdateAttachmentAsync(FeatureAttachmentUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentUpdateRequestProvider-neutral attachment update request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentResult>
Attachment operation result.
UpdateItemAsync(string, string, OgcFeature, CancellationToken)
Updates or replaces a feature in a collection with the OGC API Features item endpoint.
public Task<OgcFeature> UpdateItemAsync(string collectionId, string featureId, OgcFeature feature, CancellationToken cancellationToken = default)
Parameters
collectionIdstringThe collection identifier.
featureIdstringThe feature identifier.
featureOgcFeatureGeoJSON feature payload.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<OgcFeature>
The updated feature representation returned by the server.