ColumnRangeFilter

The ColumnRangeFilter operator allows filtering FeatureCollections. Users can define one or more data ranges for a column in the data table that is then filtered. The filter can be used for numerical as well as textual columns. Each range is inclusive, i.e., [start, end] includes as well the start as the end.

For instance, you can filter a collection to only include column values that are either in the range 0-10 or 20-30. Moreover, you can specify the range a to k to dismiss all column values that start with larger letters in the alphabet.

Parameters

ParameterTypeDescriptionExample Value
columnstringa column name of the FeatureCollection
"precipitation"
rangesList of either string or number rangesone or more ranges of either strings or numbers; each range works as an or for the filter
[[42,43]]
keepNullsbooleanshould null values be kept or discarded?
true

Inputs

The ColumnRangeFilter operator expects exactly one vector input.

ParameterType
vectorSingleVectorSource

Errors

If the value in the column parameter is not a column of the feature collection, an error is thrown.

Example JSON

{
  "type": "ColumnRangeFilter",
  "params": {
    "column": "population",
    "ranges": [[1000, 10000]],
    "keepNulls": false
  },
  "sources": {
    "vector": {
      "type": "OgrSource",
      "params": {
        "dataset": {
          "type": "internal",
          "datasetId": "e977b123-ca47-4c5b-aace-481119826aaf"
        },
        "attributeProjection": ["name", "population"]
      }
    }
  }
}
{
  "type": "ColumnRangeFilter",
  "params": {
    "column": "name",
    "ranges": [
      ["a", "k"],
      ["v", "z"]
    ],
    "keepNulls": false
  },
  "sources": {
    "vector": {
      "type": "OgrSource",
      "params": {
        "dataset": {
          "type": "internal",
          "datasetId": "e977b123-ca47-4c5b-aace-481119826aaf"
        },
        "attributeProjection": ["name", "population"]
      }
    }
  }
}