Table of Contents

Class S100CatalogueScope

Namespace
EncDotNet.S100.Collections.Library
Assembly
EncDotNet.S100.Collections.dll

A scope of a remote S-100 exchange catalogue (issue #685; NOAA's S-102 on AWS): regions, each with its areas, and a resolution that applies to every area. Sizes come from listing the bucket one region at a time (SizeGroupAsync(LibraryChoiceGroup?)); Changed is raised when they arrive.

public sealed class S100CatalogueScope : LibraryCatalogueScope
Inheritance
S100CatalogueScope
Inherited Members

Constructors

S100CatalogueScope(Uri, Func<Uri, CancellationToken, Task<RemoteS100Catalogue>>, Func<RemoteS100Catalogue, IReadOnlyList<string>, CancellationToken, Task<IReadOnlyDictionary<Uri, S3Object>?>>?)

Creates a scope of the catalogue at catalogUri.

public S100CatalogueScope(Uri catalogUri, Func<Uri, CancellationToken, Task<RemoteS100Catalogue>> load, Func<RemoteS100Catalogue, IReadOnlyList<string>, CancellationToken, Task<IReadOnlyDictionary<Uri, S3Object>?>>? listFolders = null)

Parameters

catalogUri Uri

The catalogue's URL.

load Func<Uri, CancellationToken, Task<RemoteS100Catalogue>>

Reads the catalogue.

listFolders Func<RemoteS100Catalogue, IReadOnlyList<string>, CancellationToken, Task<IReadOnlyDictionary<Uri, S3Object>>>

Lists folders for their file sizes, or null when sizes cannot be had.

Properties

CurrentFilter

The filter for the current region, area and resolution choices.

public S100CatalogueFilter CurrentFilter { get; }

Property Value

S100CatalogueFilter

EverythingSummary

"5 209 tiles · 17,3 GB online" for the whole catalogue at the chosen resolution.

public override string EverythingSummary { get; }

Property Value

string

Groups

The regions, each a group of its areas (its Key is the region's folder).

public override IReadOnlyList<LibraryChoiceGroup> Groups { get; }

Property Value

IReadOnlyList<LibraryChoiceGroup>

HasResolutions

True when the catalogue has more than one navigation purpose to choose between.

public bool HasResolutions { get; }

Property Value

bool

IsEverything

True when the source will include everything: the suggested name is then the catalogue's alone.

public override bool IsEverything { get; }

Property Value

bool

IsLoaded

True once the catalogue has been read.

public override bool IsLoaded { get; }

Property Value

bool

Resolutions

The resolution choices: all, then each navigation purpose, finest first.

public IReadOnlyList<LibraryResolution> Resolutions { get; }

Property Value

IReadOnlyList<LibraryResolution>

ScopeSummary

The datasets are listed, not downloaded: the summary says so.

public override string ScopeSummary { get; }

Property Value

string

SelectedResolution

The chosen resolution; it applies to every area.

public LibraryResolution? SelectedResolution { get; set; }

Property Value

LibraryResolution

SelectionSummary

What the ticked choices (or, with none, the whole catalogue) amount to, e.g. "12 cells · 3 MB".

public override string SelectionSummary { get; }

Property Value

string

SingleEntry

The catalogue's only download, when it lists just one (there is nothing to choose); otherwise null.

public override LibraryChoice? SingleEntry { get; }

Property Value

LibraryChoice

Methods

Build(Guid, string?)

The source the scope describes.

public override CollectionSource Build(Guid id, string? name)

Parameters

id Guid

The new source's id.

name string

The source's name when everything is included (the catalogue's name); a selection names it after the selection. A manifest source always takes it.

Returns

CollectionSource

DescribeSelection()

The ticked areas and the resolution ("Boston, Penobscot Bay · Port 4 m"), or null for everything.

public override string? DescribeSelection()

Returns

string

LoadAsync(CancellationToken)

Reads the catalogue and creates its choices.

public override Task<string?> LoadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels the read.

Returns

Task<string>

Why the catalogue could not be read, or null when it was.

SizeGroupAsync(LibraryChoiceGroup?)

Lists a region's files for their sizes, once; its areas show "sizing…" until then.

public Task SizeGroupAsync(LibraryChoiceGroup? region)

Parameters

region LibraryChoiceGroup

The region (a group of Groups).

Returns

Task