mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Prohibit categorical functions with fractional stop domain values #610

Closed jfirebaugh closed 7 years ago

jfirebaugh commented 7 years ago

Because categorical functions rely on equality-based identity, and floating point values cannot reliably be compared for equality, the validator should prohibit categorical functions which use stop domain values that aren't integers. For example, the following should be disallowed:

{
  "type": "categorical",
  "property": "ratio",
  "stops": [
    [0.333, 0.3],
    [0.666, 0.6]
  ]
}