Table of Contents

Class HonuaWfsClient

Namespace
Honua.Sdk.OgcFeatures.Wfs
Assembly
Honua.Sdk.OgcFeatures.dll

WFS 2.0 read/query client for Honua Server.

public sealed class HonuaWfsClient : IHonuaWfsClient, IHonuaFeatureQueryClient, IHonuaFeatureEditClient, IHonuaFeatureDescriptorClient, IHonuaFeatureAttachmentClient
Inheritance
HonuaWfsClient
Implements
Inherited Members
Extension Methods

Constructors

HonuaWfsClient(HttpClient)

Initializes a new instance of the HonuaWfsClient class.

public HonuaWfsClient(HttpClient httpClient)

Parameters

httpClient HttpClient

The HTTP client configured with base address and auth.

Properties

AttachmentCapabilities

Provider attachment capabilities exposed by this client.

public FeatureAttachmentCapabilities AttachmentCapabilities { get; }

Property Value

FeatureAttachmentCapabilities

EditCapabilities

Provider edit capabilities exposed by this client.

public FeatureEditCapabilities EditCapabilities { get; }

Property Value

FeatureEditCapabilities

ProviderName

Provider name for diagnostics and provider selection.

public string ProviderName { get; }

Property Value

string

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

FeatureQueryCapabilities

Methods

AddAttachmentAsync(FeatureAttachmentAddRequest, CancellationToken)

Adds an attachment to one feature.

public Task<FeatureAttachmentResult> AddAttachmentAsync(FeatureAttachmentAddRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentAddRequest

Provider-neutral attachment add request.

cancellationToken CancellationToken

Cancellation 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

request FeatureEditRequest

Provider-neutral edit request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureEditResponse>

Provider-neutral edit response.

DeleteAttachmentAsync(FeatureAttachmentDeleteRequest, CancellationToken)

Deletes one attachment.

public Task<FeatureAttachmentResult> DeleteAttachmentAsync(FeatureAttachmentDeleteRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentDeleteRequest

Provider-neutral attachment delete request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentResult>

Attachment operation result.

DescribeFeatureTypeAsync(string, CancellationToken)

Retrieves the schema definition for a feature type.

public Task<WfsFeatureTypeSchema> DescribeFeatureTypeAsync(string typeName, CancellationToken cancellationToken = default)

Parameters

typeName string

The qualified feature type name.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<WfsFeatureTypeSchema>

DownloadAttachmentAsync(FeatureAttachmentDownloadRequest, CancellationToken)

Downloads one attachment.

public Task<FeatureAttachmentContent> DownloadAttachmentAsync(FeatureAttachmentDownloadRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentDownloadRequest

Provider-neutral attachment download request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentContent>

Downloaded attachment content. Dispose the returned content stream when finished.

GetCapabilitiesAsync(CancellationToken)

Retrieves the service capabilities document.

public Task<WfsCapabilities> GetCapabilitiesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<WfsCapabilities>

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

descriptor SourceDescriptor

Source descriptor containing the provider-specific locator.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<SourceDescriptor>

The source descriptor enriched with discovered schema and capabilities.

GetFeatureCountAsync(string, string?, CancellationToken)

Returns the count of features matching the query (RESULTTYPE=hits). Returns null if the server reports "unknown".

public Task<long?> GetFeatureCountAsync(string typeName, string? filter = null, CancellationToken cancellationToken = default)

Parameters

typeName string

The qualified feature type name.

filter string

Optional FES 2.0 XML filter expression.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<long?>

GetFeaturesAsync(GetFeaturesRequest, CancellationToken)

Retrieves features using the default GeoJSON output format.

public Task<WfsFeatureCollection> GetFeaturesAsync(GetFeaturesRequest request, CancellationToken cancellationToken = default)

Parameters

request GetFeaturesRequest

The feature request parameters.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<WfsFeatureCollection>

GetFeaturesAsyncEnumerable(GetFeaturesRequest, CancellationToken)

Auto-pages through all matching features, yielding each feature as it becomes available.

public IAsyncEnumerable<WfsFeature> GetFeaturesAsyncEnumerable(GetFeaturesRequest request, CancellationToken cancellationToken = default)

Parameters

request GetFeaturesRequest

The feature request parameters. Count controls the page size; StartIndex controls the starting offset.

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<WfsFeature>

Exceptions

InvalidOperationException

Thrown when the internal safety limit of 100 pages is reached. Use manual paging with GetFeaturesAsync(GetFeaturesRequest, CancellationToken) for result sets exceeding this limit.

GetFeaturesAsync<TResult>(GetFeaturesRequest, IWfsOutputFormatHandler<TResult>, CancellationToken)

Retrieves features using a custom output format handler.

[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Response ownership is transferred to ResponseOwningStream when the handler owns the response stream.")]
public Task<TResult> GetFeaturesAsync<TResult>(GetFeaturesRequest request, IWfsOutputFormatHandler<TResult> handler, CancellationToken cancellationToken = default)

Parameters

request GetFeaturesRequest

The feature request parameters.

handler IWfsOutputFormatHandler<TResult>

The output format handler to process the response.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TResult>

Type Parameters

TResult

The result type produced by the handler.

GetFeaturesVectorAsync(GetFeaturesRequest, VectorPayloadFormat, CancellationToken)

public Task<VectorPayloadFeatureSet> GetFeaturesVectorAsync(GetFeaturesRequest request, VectorPayloadFormat format = VectorPayloadFormat.GeoJson, CancellationToken cancellationToken = default)

Parameters

request GetFeaturesRequest
format VectorPayloadFormat
cancellationToken CancellationToken

Returns

Task<VectorPayloadFeatureSet>

ListAttachmentsAsync(FeatureAttachmentListRequest, CancellationToken)

Lists attachments for one feature.

public Task<IReadOnlyList<FeatureAttachmentInfo>> ListAttachmentsAsync(FeatureAttachmentListRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentListRequest

Provider-neutral attachment list request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyList<FeatureAttachmentInfo>>

Attachment metadata.

QueryAsync(FeatureQueryRequest, CancellationToken)

Executes a feature query and returns a single result page.

public Task<FeatureQueryResult> QueryAsync(FeatureQueryRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureQueryRequest

Provider-neutral query request.

cancellationToken CancellationToken

Cancellation 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

request FeatureQueryRequest

Provider-neutral query request.

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<FeatureQueryResult>

Provider-neutral result pages.

UpdateAttachmentAsync(FeatureAttachmentUpdateRequest, CancellationToken)

Updates one attachment.

public Task<FeatureAttachmentResult> UpdateAttachmentAsync(FeatureAttachmentUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentUpdateRequest

Provider-neutral attachment update request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentResult>

Attachment operation result.