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
catalogUriUriThe catalogue's URL.
loadFunc<Uri, CancellationToken, Task<RemoteS100Catalogue>>Reads the catalogue.
listFoldersFunc<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
EverythingSummary
"5 209 tiles · 17,3 GB online" for the whole catalogue at the chosen resolution.
public override string EverythingSummary { get; }
Property Value
Groups
The regions, each a group of its areas (its Key is the region's folder).
public override IReadOnlyList<LibraryChoiceGroup> Groups { get; }
Property Value
HasResolutions
True when the catalogue has more than one navigation purpose to choose between.
public bool HasResolutions { get; }
Property Value
IsEverything
True when the source will include everything: the suggested name is then the catalogue's alone.
public override bool IsEverything { get; }
Property Value
IsLoaded
True once the catalogue has been read.
public override bool IsLoaded { get; }
Property Value
Resolutions
The resolution choices: all, then each navigation purpose, finest first.
public IReadOnlyList<LibraryResolution> Resolutions { get; }
Property Value
ScopeSummary
The datasets are listed, not downloaded: the summary says so.
public override string ScopeSummary { get; }
Property Value
SelectedResolution
The chosen resolution; it applies to every area.
public LibraryResolution? SelectedResolution { get; set; }
Property Value
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
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
Methods
Build(Guid, string?)
The source the scope describes.
public override CollectionSource Build(Guid id, string? name)
Parameters
idGuidThe new source's id.
namestringThe 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
DescribeSelection()
The ticked areas and the resolution ("Boston, Penobscot Bay · Port 4 m"), or null for everything.
public override string? DescribeSelection()
Returns
LoadAsync(CancellationToken)
Reads the catalogue and creates its choices.
public override Task<string?> LoadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the read.
Returns
SizeGroupAsync(LibraryChoiceGroup?)
Lists a region's files for their sizes, once; its areas show "sizing…" until then.
public Task SizeGroupAsync(LibraryChoiceGroup? region)
Parameters
regionLibraryChoiceGroupThe region (a group of Groups).