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
httpClientHttpClientThe client used to fetch catalogues.
cacheDirectorystringWhere raw catalogues are cached.
optionsFeedCacheOptionsCache options; defaults to Default.
timeProviderTimeProviderThe clock; defaults to System.
Methods
CanIndex(CollectionSource)
Returns true when this indexer handles source.
public bool CanIndex(CollectionSource source)
Parameters
sourceCollectionSource
Returns
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
catalogUriUriforceRevalidateboolcancellationTokenCancellationToken
Returns
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
sourceCollectionSourcecancellationTokenCancellationToken
Returns
IndexAsync(CollectionSource, IProgress<IndexProgress>?, CancellationToken)
Indexes source.
public ValueTask<SourceIndex> IndexAsync(CollectionSource source, IProgress<IndexProgress>? progress, CancellationToken cancellationToken)
Parameters
sourceCollectionSourceprogressIProgress<IndexProgress>cancellationTokenCancellationToken
Returns
Map(UsaceIencCell)
Maps one catalogue cell onto a neutral item.
public static CollectionItem Map(UsaceIencCell cell)
Parameters
cellUsaceIencCell
Returns
Rivers(UsaceIencProductCatalog)
Summarises the rivers in catalog (cell counts and
download sizes), for choosing a UsaceIencFilter.
public static IReadOnlyList<CatalogFacetValue> Rivers(UsaceIencProductCatalog catalog)
Parameters
catalogUsaceIencProductCatalog