Table of Contents

Class UsaceIencFeedIndexer

Namespace
EncDotNet.S100.Collections.Indexing
Assembly
EncDotNet.S100.Collections.dll

Indexes a UsaceIencFeedSource: fetches (or revalidates) a USACE Inland ENC product catalogue and turns each cell on the selected rivers into an online item with its bounding box, edition, update and download.

public sealed class UsaceIencFeedIndexer : ICollectionSourceIndexer
Inheritance
UsaceIencFeedIndexer
Implements
Inherited Members

Remarks

Caching follows NoaaEncFeedIndexer: one raw copy per URL, revalidated with conditional requests, served from cache when offline. USACE catalogues carry a bounding box per cell but no coverage polygon.

Constructors

UsaceIencFeedIndexer(HttpClient, string, FeedCacheOptions?, TimeProvider?)

Creates an indexer.

public UsaceIencFeedIndexer(HttpClient httpClient, string cacheDirectory, FeedCacheOptions? options = null, TimeProvider? timeProvider = null)

Parameters

httpClient HttpClient

The client used to fetch catalogues.

cacheDirectory string

Where raw catalogues are cached.

options FeedCacheOptions

Cache options; defaults to Default.

timeProvider TimeProvider

The clock; defaults to System.

Methods

CanIndex(CollectionSource)

Returns true when this indexer handles source.

public bool CanIndex(CollectionSource source)

Parameters

source CollectionSource

Returns

bool

GetCatalogAsync(Uri, bool, CancellationToken)

Returns the (cached or freshly fetched) catalogue at catalogUri, for example to list its rivers when choosing a filter.

public Task<UsaceIencProductCatalog> GetCatalogAsync(Uri catalogUri, bool forceRevalidate = false, CancellationToken cancellationToken = default)

Parameters

catalogUri Uri
forceRevalidate bool
cancellationToken CancellationToken

Returns

Task<UsaceIencProductCatalog>

Exceptions

HttpRequestException

The server could not be reached and nothing is cached.

GetFingerprintAsync(CollectionSource, CancellationToken)

Cheaply computes a fingerprint of the source's current state. When it equals a previous index's Fingerprint, that index is still valid. Returns null when the state cannot be determined (for example the source is unavailable).

public ValueTask<string?> GetFingerprintAsync(CollectionSource source, CancellationToken cancellationToken)

Parameters

source CollectionSource
cancellationToken CancellationToken

Returns

ValueTask<string>

IndexAsync(CollectionSource, IProgress<IndexProgress>?, CancellationToken)

Indexes source.

public ValueTask<SourceIndex> IndexAsync(CollectionSource source, IProgress<IndexProgress>? progress, CancellationToken cancellationToken)

Parameters

source CollectionSource
progress IProgress<IndexProgress>
cancellationToken CancellationToken

Returns

ValueTask<SourceIndex>

Map(UsaceIencCell)

Maps one catalogue cell onto a neutral item.

public static CollectionItem Map(UsaceIencCell cell)

Parameters

cell UsaceIencCell

Returns

CollectionItem

Rivers(UsaceIencProductCatalog)

Summarises the rivers in catalog (cell counts and download sizes), for choosing a UsaceIencFilter.

public static IReadOnlyList<CatalogFacetValue> Rivers(UsaceIencProductCatalog catalog)

Parameters

catalog UsaceIencProductCatalog

Returns

IReadOnlyList<CatalogFacetValue>