Struct MvtValue
- Namespace
- SpatialNET.IO
- Assembly
- SpatialNET.IO.dll
An attribute value of a vector tile feature. The SpatialNET.IO.MvtValue.Kind fixes the protobuf field, so that a decoded value is encoded again into the same bytes. Values of the same kind and value are deduplicated in the layer's value table.
public readonly record struct MvtValue : IEquatable<MvtValue>Implements
Inherited Members
Properties
Kind
The protobuf field the value is stored in.
public MvtValueKind Kind { get; }Property Value
Value
The value as a CLR object: System.String, System.Single, System.Double, System.Int64 (Int and SInt), System.UInt64 (UInt) or System.Boolean.
public object Value { get; }Property Value
Methods
Bool(bool)
Creates a bool_value.
public static MvtValue Bool(bool value)Parameters
valuebool-
The value.
Returns
Double(double)
Creates a double_value.
public static MvtValue Double(double value)Parameters
valuedouble-
The value.
Returns
Float(float)
Creates a float_value.
public static MvtValue Float(float value)Parameters
valuefloat-
The value.
Returns
From(object)
Converts a CLR value: System.String → String, System.Boolean → Bool, System.Single → Float, System.Double and System.Decimal → Double, unsigned integers → UInt, signed integers → UInt when ≥ 0 and SInt when negative, SpatialNET.IO.MvtValue unchanged; anything else (dates, GUIDs, …) → String in the invariant culture.
public static MvtValue From(object value)Parameters
valueobject-
The value.
Returns
Exceptions
- ArgumentNullException
-
valueisnull; MVT has no null value.
Int(long)
Creates an int_value (int64, negative values take ten bytes).
public static MvtValue Int(long value)Parameters
valuelong-
The value.
Returns
SInt(long)
Creates a sint_value (zigzag encoded).
public static MvtValue SInt(long value)Parameters
valuelong-
The value.
Returns
String(string)
Creates a string_value.
public static MvtValue String(string value)Parameters
valuestring-
The string.
Returns
Exceptions
- ArgumentNullException
-
valueisnull.
ToString()
The value in the invariant culture.
public override string ToString()Returns
UInt(ulong)
Creates a uint_value.
public static MvtValue UInt(ulong value)Parameters
valueulong-
The value.