spectriclabs / elastic_datashader

:earth_americas: Datashader enabled TMS server with ElasticSearch backend
Apache License 2.0
4 stars 1 forks source link

"custom" filters are not supported by Datashader #5

Closed maihde closed 1 year ago

maihde commented 4 years ago

If you add a filter and use the "Edit As Query DSL" it will be passed to Datashader with type equal to "custom" and the dsl itself will be in a field equal to "value". Code similar to this needs to be added:

elif f.get("meta", {}).get("type") == "custom" and f.get("meta", {}).get("key") is not None:
  filter_key = f.get("meta", {}).get("key")
  if f.get("meta", {}).get("negate"):
    filter["must_not"].append({filter_key : f.get(filter_key) })
  else:
    filter["filter"].append({filter_key : f.get(filter_key) })

This code is just an example and likely would want additional protection and/or checking of corner cases.

mrecachinas commented 3 years ago

Was this ever added, @maihde?

desean1625 commented 1 year ago

support was added October 7th, 2020