Table of Contents

Class HonuaFeatureServerClient

Namespace
Honua.Sdk.GeoServices.FeatureServer
Assembly
Honua.Sdk.GeoServices.dll

HTTP client implementation for the Honua FeatureServer (GeoServices) read/query API.

public sealed class HonuaFeatureServerClient : IHonuaFeatureServerClient, IHonuaFeatureServerEditClient, IHonuaFeatureQueryClient, IHonuaFeatureEditClient, IHonuaFeatureDescriptorClient, IHonuaFeatureAttachmentClient
Inheritance
HonuaFeatureServerClient
Implements
Inherited Members
Extension Methods

Constructors

HonuaFeatureServerClient(HttpClient)

Initializes a new instance of the HonuaFeatureServerClient class that addresses {BaseAddress}/rest/services/{serviceId}/FeatureServer with the default response size ceiling.

public HonuaFeatureServerClient(HttpClient httpClient)

Parameters

httpClient HttpClient

The HTTP client configured with base address and auth handlers.

HonuaFeatureServerClient(HttpClient, HonuaFeatureServerClientOptions)

Creates a client for an arbitrary GeoServices REST service root (path prefix, foldered service ids, FeatureServer or MapServer).

public HonuaFeatureServerClient(HttpClient httpClient, HonuaFeatureServerClientOptions options)

Parameters

httpClient HttpClient
options HonuaFeatureServerClientOptions

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.

AddFeaturesAsync(string, int, IReadOnlyList<FeatureServerFeature>, bool, CancellationToken)

Adds features using the FeatureServer applyEdits endpoint.

public Task<FeatureServerEditResponse> AddFeaturesAsync(string serviceId, int layerId, IReadOnlyList<FeatureServerFeature> features, bool rollbackOnFailure = true, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

features IReadOnlyList<FeatureServerFeature>

Features to add.

rollbackOnFailure bool

Whether the server should roll back all edits if any add fails.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerEditResponse>

Edit response with add results.

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.

ApplyEditsAsync(string, int, FeatureServerEditRequest, CancellationToken)

Applies add, update, and delete feature edits using the FeatureServer applyEdits endpoint.

public Task<FeatureServerEditResponse> ApplyEditsAsync(string serviceId, int layerId, FeatureServerEditRequest request, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

request FeatureServerEditRequest

Edit request containing adds, updates, deletes, and rollback behavior.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerEditResponse>

Edit response with per-operation results.

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.

DeleteFeaturesAsync(string, int, IReadOnlyList<long>, bool, CancellationToken)

Deletes features using the FeatureServer applyEdits endpoint.

public Task<FeatureServerEditResponse> DeleteFeaturesAsync(string serviceId, int layerId, IReadOnlyList<long> objectIds, bool rollbackOnFailure = true, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

objectIds IReadOnlyList<long>

Object IDs to delete.

rollbackOnFailure bool

Whether the server should roll back all edits if any delete fails.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerEditResponse>

Edit response with delete results.

DownloadAttachmentAsync(FeatureAttachmentDownloadRequest, CancellationToken)

Downloads one attachment.

[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Response ownership is transferred to FeatureAttachmentContent.Content.")]
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.

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.

GetEditCapabilitiesAsync(string, int, CancellationToken)

Gets FeatureServer edit capabilities for a layer.

public Task<FeatureEditCapabilities> GetEditCapabilitiesAsync(string serviceId, int layerId, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureEditCapabilities>

Provider-neutral edit capabilities inferred from layer metadata.

GetFeatureAsync(string, int, long, FeatureServerQueryParams?, CancellationToken)

Gets a single feature by object ID.

public Task<FeatureServerFeature?> GetFeatureAsync(string serviceId, int layerId, long objectId, FeatureServerQueryParams? query = null, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

objectId long

The object ID to read.

query FeatureServerQueryParams

Optional query parameters for projection, geometry, and output spatial reference.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerFeature>

The matching feature, or null when no feature is returned.

GetLayerInfoAsync(string, int, CancellationToken)

Gets detailed metadata for a specific layer in a FeatureServer service.

public Task<FeatureServerLayerInfo> GetLayerInfoAsync(string serviceId, int layerId, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerLayerInfo>

Layer metadata including fields, extent, and capabilities.

GetLayerMetadataAsync(string, int, CancellationToken)

Reads layer metadata without projecting it into typed models. Source member presence, explicit nulls and provider extensions are preserved for migration inventories.

public Task<JsonDocument> GetLayerMetadataAsync(string serviceId, int layerId, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier, including any folder segments.

layerId int

The source layer or table identifier.

cancellationToken CancellationToken

Cancellation token for the bounded response read.

Returns

Task<JsonDocument>

A document owned by the caller, who must dispose it. The HTTP response is already disposed.

GetServiceInfoAsync(string, CancellationToken)

Gets service-level metadata for a FeatureServer service.

public Task<FeatureServerServiceInfo> GetServiceInfoAsync(string serviceId, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerServiceInfo>

Service metadata including layers, extent, and capabilities.

GetServiceMetadataAsync(string, CancellationToken)

Reads service metadata without projecting it into typed models. Source member presence, explicit nulls and provider extensions are preserved for migration inventories.

public Task<JsonDocument> GetServiceMetadataAsync(string serviceId, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier, including any folder segments.

cancellationToken CancellationToken

Cancellation token for the bounded response read.

Returns

Task<JsonDocument>

A document owned by the caller, who must dispose it. The HTTP response is already disposed.

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.

QueryAsync(string, int, FeatureServerQueryParams, CancellationToken)

Executes a feature query and returns a single page of results.

public Task<FeatureServerQueryResponse> QueryAsync(string serviceId, int layerId, FeatureServerQueryParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerQueryParams

Query parameters including filters, paging, and projection.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerQueryResponse>

Query response containing features and metadata.

QueryAttachmentsAsync(string, int, IReadOnlyList<long>, CancellationToken)

Lists attachment metadata for a batch of features with one layer queryAttachments request, instead of one /{objectId}/attachments request per feature.

public Task<FeatureServerAttachmentGroupsResponse> QueryAttachmentsAsync(string serviceId, int layerId, IReadOnlyList<long> objectIds, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

objectIds IReadOnlyList<long>

Parent feature object IDs. An empty list returns no groups without a request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerAttachmentGroupsResponse>

Attachment metadata grouped by parent object ID; features without attachments have no group.

QueryCountAsync(string, int, FeatureServerQueryParams, CancellationToken)

Executes a count-only query, returning the number of matching features.

public Task<long> QueryCountAsync(string serviceId, int layerId, FeatureServerQueryParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerQueryParams

Query parameters for filtering.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<long>

The count of matching features.

Exceptions

HonuaFeatureServerException

The response omits the count or returns a null count.

QueryExtentAsync(string, int, FeatureServerQueryParams, CancellationToken)

Executes an extent-only query, returning the bounding extent of matching features.

public Task<FeatureServerExtent> QueryExtentAsync(string serviceId, int layerId, FeatureServerQueryParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerQueryParams

Query parameters for filtering.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerExtent>

The bounding extent of matching features.

QueryIdsAsync(string, int, FeatureServerQueryParams, CancellationToken)

Executes an IDs-only query, returning object IDs of matching features.

public Task<IReadOnlyList<long>> QueryIdsAsync(string serviceId, int layerId, FeatureServerQueryParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerQueryParams

Query parameters for filtering.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyList<long>>

A list of matching object IDs.

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.

QueryPagesAsync(string, int, FeatureServerQueryParams, CancellationToken)

Executes a feature query with automatic paging via IAsyncEnumerable<T>. Advances ResultOffset automatically and stops when the server indicates no more records. A source that ignores or repeats resultOffset is detected before any duplicate record is yielded and fails with InvalidOperationException; use QueryAllFeaturesByObjectIdBatchesAsync(string, int, FeatureServerQueryParams, int, CancellationToken) for such sources.

public IAsyncEnumerable<FeatureServerQueryResponse> QueryPagesAsync(string serviceId, int layerId, FeatureServerQueryParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerQueryParams

Query parameters. ResultOffset will be advanced automatically.

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<FeatureServerQueryResponse>

An async enumerable of query response pages.

QueryRawAsync(string, int, FeatureServerQueryParams, CancellationToken)

Executes a query and returns the raw HttpResponseMessage for binary formats (PBF, FlatGeobuf, Parquet, etc.). The caller is responsible for disposing the response.

public Task<HttpResponseMessage> QueryRawAsync(string serviceId, int layerId, FeatureServerQueryParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerQueryParams

Query parameters including the desired output format.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<HttpResponseMessage>

The raw HTTP response message.

QueryStatisticsAsync(string, int, FeatureServerStatisticsParams, CancellationToken)

Executes a statistics query on a layer.

public Task<FeatureServerQueryResponse> QueryStatisticsAsync(string serviceId, int layerId, FeatureServerStatisticsParams query, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

query FeatureServerStatisticsParams

Statistics query parameters including outStatistics, groupBy, and having.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerQueryResponse>

Query response containing statistics results as features.

QueryVectorAsync(string, int, FeatureServerQueryParams, VectorPayloadFormat?, CancellationToken)

public Task<VectorPayloadFeatureSet> QueryVectorAsync(string serviceId, int layerId, FeatureServerQueryParams query, VectorPayloadFormat? format = null, CancellationToken cancellationToken = default)

Parameters

serviceId string
layerId int
query FeatureServerQueryParams
format VectorPayloadFormat?
cancellationToken CancellationToken

Returns

Task<VectorPayloadFeatureSet>

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.

UpdateFeaturesAsync(string, int, IReadOnlyList<FeatureServerFeature>, bool, CancellationToken)

Updates features using the FeatureServer applyEdits endpoint.

public Task<FeatureServerEditResponse> UpdateFeaturesAsync(string serviceId, int layerId, IReadOnlyList<FeatureServerFeature> features, bool rollbackOnFailure = true, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

features IReadOnlyList<FeatureServerFeature>

Features to update. Each feature must include the layer object ID field.

rollbackOnFailure bool

Whether the server should roll back all edits if any update fails.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerEditResponse>

Edit response with update results.

ValidateSqlAsync(string, int, string, CancellationToken)

Validates a SQL WHERE clause against a layer.

public Task<FeatureServerValidateSqlResponse> ValidateSqlAsync(string serviceId, int layerId, string where, CancellationToken cancellationToken = default)

Parameters

serviceId string

The service identifier.

layerId int

The layer ID within the service.

where string

The SQL WHERE clause to validate.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureServerValidateSqlResponse>

Validation result indicating whether the SQL is valid.