Search code examples
kepler.gl

Keplergl Filters : multiple attributes per field?


Is the keplergl filter system able to parse arrays with multiple categories ? For example a point representing a industrial building who would have all of thoses attributes in the same field ["Non-hazardous waste", "Hazardous waste", "Inert waste"]

if not is there a way to inject the filter action or the data parsing action ?


Solution

  • This feature does not seem to be implemented yet

    Kepler's data-processor parses Arrays and Objects as it is GeoJson

    processors/data-processor.js line 399

      switch (aType) {
    case DATE:
      return ALL_FIELD_TYPES.date;
    case TIME:
    case DATETIME:
      return ALL_FIELD_TYPES.timestamp;
    case FLOAT:
      return ALL_FIELD_TYPES.real;
    case INT:
      return ALL_FIELD_TYPES.integer;
    case BOOLEAN:
      return ALL_FIELD_TYPES.boolean;
    case GEOMETRY:
    case GEOMETRY_FROM_STRING:
    case PAIR_GEOMETRY_FROM_STRING:
    case ARRAY:
    case OBJECT:
      // TODO: create a new data type for objects and arrays
      return ALL_FIELD_TYPES.geojson;
    case NUMBER:
    case STRING:
    case ZIPCODE:
      return ALL_FIELD_TYPES.string;
    default:
      globalConsole.warn(`Unsupported analyzer type: ${aType}`);
      return ALL_FIELD_TYPES.string;
    }