Feature metadata key/value Maps are completely untyped. All keys
and values used by Features across a common parent Layer are stored in that
parent. Raw Features themselves only store indices into the parent's
key/value lists. So, for an example MultiPoint Feature of fire hydrant locations,
its metadata could look like:
{ name: "Hydrants",
colour: "red",
model: 5
}
That's fine if interpreted as JSON, but bad as Scala, as it doesn't give us
a clean Map[String, ConcreteTypeHere]. Furthermore, Features within the
same Layer don't have to agree on the Value type for the same key:
Nor, actually, do Layers have to agree on key sets for their Features.
The sealed trait Value here and its extensions aim to provide some
type safety in light of the situation described here.
Feature metadata key/value Maps are completely untyped. All keys and values used by Features across a common parent Layer are stored in that parent. Raw Features themselves only store indices into the parent's key/value lists. So, for an example MultiPoint Feature of fire hydrant locations, its metadata could look like:
That's fine if interpreted as JSON, but bad as Scala, as it doesn't give us a clean
Map[String, ConcreteTypeHere]
. Furthermore, Features within the same Layer don't have to agree on the Value type for the same key:Nor, actually, do Layers have to agree on key sets for their Features. The sealed trait
Value
here and its extensions aim to provide some type safety in light of the situation described here.