EncDotNet.S100.Features
EncDotNet.S100.Features parses S-100 feature catalogue XML (ISO 19110,
S-100 Part 5) into a model of feature types, information types, attributes,
roles and associations. Reference it when you need to read a feature catalogue
directly, for example to look up attribute names or enumerated values. The
EncDotNet.S100 facade uses it for you through
S100FeatureCatalogue.
Install
dotnet add package EncDotNet.S100.Features
Example: read a catalogue and decode codes
using EncDotNet.S100.Features;
FeatureCatalogue catalogue = FeatureCatalogueReader.Read("path/to/feature_catalogue.xml");
Console.WriteLine($"{catalogue.Name} {catalogue.VersionNumber}: {catalogue.FeatureTypes.Count} feature types");
var decoder = new FeatureCatalogueDecoder(catalogue);
Console.WriteLine(decoder.ResolveFeatureTypeName("DepthArea"));
Main entry points
FeatureCatalogueReaderreads a feature catalogue from a stream or a file path and returns aFeatureCatalogue.FeatureCatalogueis the parsed model. It lists feature types, information types, simple and complex attributes, roles, and feature and information associations.FeatureTypeandInformationTypedefine the types.AttributeBinding,FeatureBindingandInformationBindingare the attributes, feature associations and information associations a type binds. A feature or information binding can allow several target types:FeatureTypeRefsandInformationTypeRefslist them all, andFeatureTypeRefandInformationTypeRefgive the first.SimpleAttribute,ComplexAttributeandListedValuedefine attributes and enumerated values. A numericSimpleAttributealso has aUom, aUnitOfMeasurewith a name and symbol parsed from<S100FC:uom>. For example,depthRangeMinimumValueresolves tometre/m, so you can label values with their unit from the catalogue instead of guessing it.FeatureAssociation,InformationAssociationandRoledescribe relationships between features.FeatureCatalogueDecoderlooks up names in a parsed catalogue in constant time:ResolveAttributeName,ResolveFeatureTypeName,ResolveInformationTypeNameandIsEnumeratedAttribute.- For enumerated simple attributes,
ResolveListedValuereturns the value's label andResolveListedValueDefinitionreturns its definition, such as"Grey Ice"for an S-411 stage-of-development code. Both take the attribute code and the raw value, and returnnullfor an attribute that isn't enumerated or a value that isn't listed.
FeatureCatalogueManagerresolves, parses and caches oneFeatureCatalogueper product specification.- It reads catalogues through a stream resolver you supply.
SetSourceregisters anIAssetSourceas a bundled fallback for a product, and clears that product's cached catalogue, decoder and content hash. GetCatalogueHashAsync(spec)(fromICatalogueProvider<T>) returns the lowercase hexadecimal SHA-256 of the catalogue XML that the resolver returns. Because it hashes the resolved bytes, it reflects any command-line or settings override. That makes it a safer cache-invalidation key than the declared version, which an override can leave unchanged. The hash is computed once per product, when first requested. A failure (null) isn't cached, so the next call tries again.
- It reads catalogues through a stream resolver you supply.
See also
- Custom catalogues and validation: use your own feature catalogue with the facade.
- Typed data models: typed views over feature attributes.