Table of Contents

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

MvtValueKind

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

object

Methods

Bool(bool)

Creates a bool_value.

public static MvtValue Bool(bool value)

Parameters

value bool

The value.

Returns

MvtValue

Double(double)

Creates a double_value.

public static MvtValue Double(double value)

Parameters

value double

The value.

Returns

MvtValue

Float(float)

Creates a float_value.

public static MvtValue Float(float value)

Parameters

value float

The value.

Returns

MvtValue

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

value object

The value.

Returns

MvtValue

Exceptions

ArgumentNullException

value is null; MVT has no null value.

Int(long)

Creates an int_value (int64, negative values take ten bytes).

public static MvtValue Int(long value)

Parameters

value long

The value.

Returns

MvtValue

SInt(long)

Creates a sint_value (zigzag encoded).

public static MvtValue SInt(long value)

Parameters

value long

The value.

Returns

MvtValue

String(string)

Creates a string_value.

public static MvtValue String(string value)

Parameters

value string

The string.

Returns

MvtValue

Exceptions

ArgumentNullException

value is null.

ToString()

The value in the invariant culture.

public override string ToString()

Returns

string

UInt(ulong)

Creates a uint_value.

public static MvtValue UInt(ulong value)

Parameters

value ulong

The value.

Returns

MvtValue