 
 
 (comment
+
   ;; Example map spec
   {"type" "visualisation",
    "name" "Untitled visualisation",

  (:require [akvo.lumen.lib :as lib]
            [cheshire.core :as json]
            [clj-http.client :as client]
            [clojure.pprint :refer [pprint]]))

;; Localhost to keep within pod?
(def url "http://windshaft:4000/lumen_tenant_1/layergroup")

(defn headers []
  {"x-db-host" "postgres"
   "x-db-last-update" (quot (System/currentTimeMillis) 1000)
   "x-db-password" "password"
   "x-db-port" 5432
   "x-db-user" "lumen"})

(def sql-statement
  "SELECT 'Batman cave' as label, ST_SetSRID(ST_MakePoint(12.069034,57.74119), 4326) AS geom;")

(def cartocss
  "#s { marker-width: 10; marker-fill: #e00050;}")


(defn create [tenant-db visualisation-spec]
  (prn tenant-db)
  #_(pprint visualisation-spec)
  ;; Handle if available
  ;; dataset -> yank out relevant ds_<...>,
  ;; geom
  ;; interactivity
  (let [sql-statement (sql-statement locations)
        _ (prn sql-statement)
        resp (client/post (url tenant-db)
                          {:body (json/encode (map-config cartocss
                                                          "geom"
                                                          "label"
