mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Case and diacritic folding for filter operations #548

Closed 1ec5 closed 7 years ago

1ec5 commented 7 years ago

As discussed in mapbox/mapbox-gl-native#6781, it can often be necessary for a filter to perform a case-insensitive or diacritic-insensitive comparison. Variations on the existing operators should be added to support these options.

Here’s an example design (but by no means the best):

[
  {
    "operator": "in",
    "case-sensitive": false,
    "diacritic-sensitive": false,
  },
  "key",
  "value 1",
  "value 2"
]

Implementing case-insensitive comparisons should be trivial on all the platforms supported by Mapbox GL. On the other hand, while there are fine options for diacritic folding on the native platforms, JavaScript would have to rely on a library for diacritic-insensitive comparisons.

/cc @incanus @lucaswoj @jfirebaugh

lucaswoj commented 7 years ago

This issue was moved to mapbox/mapbox-gl-js#4136