     :else []))
 
 (defn shape-aggregation-sql
-  [tenant-conn columns table-name geom-column popup-columns point-color-column where-clause current-layer layer-index]
+  [tenant-conn columns geom-column popup-columns point-color-column where-clause current-layer layer-index]
   (let [{:keys [table-name columns]} (db.dataset/dataset-by-id tenant-conn {:id (:aggregationDataset current-layer)})
         point-table-name table-name
         point-columns columns

                         where-clause (filter/sql-str kw-columns filters)
                         popup-columns (mapv :column popup)
                         point-color-column (find-column kw-columns pointColorColumn)
                         sql (get-sql tenant-conn columns table-name geom-column
                                      popup-columns point-color-column
                                      where-clause layer idx)]


          (or max "255")
          (or end-color "#000000")))

(defn- get-layers [tenant-conn layers metadata-array]
  (map-indexed (fn [idx {:keys [datasetId rasterId filters geom popup pointColorColumn]
                         :as layer}]
                 (if (= (:layerType layer) "raster")
